anthraxx / linux-hardened

Minimal supplement to upstream Kernel Self Protection Project changes. Features already provided by SELinux + Yama and archs other than multiarch arm64 / x86_64 aren't in scope. Only tags have stable history. Shared IRC channel with KSPP: irc.libera.chat #linux-hardening
Other
554 stars 55 forks source link

Linux-Hardened: Restore align_vdso_addr #86

Closed sempervictus closed 11 months ago

sempervictus commented 11 months ago

Clang16 and 17 throw a C99 error for the missing align_vdso_addr function referenced in arch/x86/entry/vdso/vma.c. Daniel removed it in 06aba60cf x86_64: move vdso to mmap region from stack region.

Restore the function delcalration and header without reverting the original mapping mechanism using vdso_addr in vma.c.

Fixes:

error: call to undeclared function 'align_vdso_addr'; ISO C99 and
later do not support implicit function declarations
[-Wimplicit-function-declaration]
sempervictus commented 11 months ago

Started hitting that C99 error a couple of revisions back - have been building with kCFI/LTO since the spring, this popped up sometime in August on 6.1 builds.

Digging back a bit, found commit 9ad49178 which changes static unsigned long vdso_addr(unsigned long start, unsigned len) in arch/x86/entry/vdso/vma.c. Since we're not actually using it, i guess its probably better to re-remove the function than reintroducing this one.

sempervictus commented 11 months ago

I think this is something @anthraxx will catch in the rebase and fix, so going to close this incorrect PR since it can easily be found for reference.