x86/vdso: Error out if the vDSO isn't a valid DSO
authorAndy Lutomirski <luto@kernel.org>
Mon, 18 Jul 2016 21:46:35 +0000 (14:46 -0700)
committerIngo Molnar <mingo@kernel.org>
Tue, 19 Jul 2016 06:50:24 +0000 (08:50 +0200)
commit57f90c3dfc75da89358735c06bf9bc9815b4183e
treebdcfcbc1e2d76bc8e791f60608e5f9aed6185fc8
parentbe8a18e2e98e04a5def5887d913b267865562448
x86/vdso: Error out if the vDSO isn't a valid DSO

Some distros has been playing with toolchain changes that can affect
the type of ELF objects built.  Occasionally, this goes wrong and
the vDSO ends up not being a DSO at all.  This causes the kernel to
end up broken in a surprisingly subtle way -- glibc apparently
silently ignores a vDSO that isn't a DSO, so everything works,
albeit slowly, until users try a different libc implementation.

Make the kernel build process a bit more robust: fail outright if
the vDSO isn't ET_DYN or is missing its PT_DYNAMIC segment.  I've
never seen this in an unmodified kernel.

See: https://github.com/docker/docker/issues/23378

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/8a30e0a07c3b47ff917a8daa2df5e407cc0c6698.1468878336.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/entry/vdso/vdso2c.h