Skip to content

Commit 6fdc6dd

Browse files
committed
x86/vdso: Plug race between mapping and ELF header setup
The vsyscall32 sysctl can racy against a concurrent fork when it switches from disabled to enabled: arch_setup_additional_pages() if (vdso32_enabled) --> No mapping sysctl.vsysscall32() --> vdso32_enabled = true create_elf_tables() ARCH_DLINFO_IA32 if (vdso32_enabled) { --> Add VDSO entry with NULL pointer Make ARCH_DLINFO_IA32 check whether the VDSO mapping has been set up for the newly forked process or not. Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Andy Lutomirski <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Mathias Krause <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
1 parent c06989d commit 6fdc6dd

File tree

1 file changed

+1
-1
lines changed
  • arch/x86/include/asm

1 file changed

+1
-1
lines changed

arch/x86/include/asm/elf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ struct task_struct;
287287

288288
#define ARCH_DLINFO_IA32 \
289289
do { \
290-
if (vdso32_enabled) { \
290+
if (VDSO_CURRENT_BASE) { \
291291
NEW_AUX_ENT(AT_SYSINFO, VDSO_ENTRY); \
292292
NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_CURRENT_BASE); \
293293
} \

0 commit comments

Comments
 (0)