Commit a1f3bb9ae4497a2ed3eac773fd7798ac33a0371f
Committed by
Linus Torvalds
1 parent
7f6ee1adc7
Exists in
master
and in
4 other branches
[PATCH] Fix CONFIG_COMPAT_VDSO
I wouldn't mind if CONFIG_COMPAT_VDSO went away entirely. But if it's there, it should work properly. Currently it's quite haphazard: both real vma and fixmap are mapped, both are put in the two different AT_* slots, sysenter returns to the vma address rather than the fixmap address, and core dumps yet are another story. This patch makes CONFIG_COMPAT_VDSO disable the real vma and use the fixmap area consistently. This makes it actually compatible with what the old vdso implementation did. Signed-off-by: Roland McGrath <roland@redhat.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Paul Mackerras <paulus@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Andi Kleen <ak@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 5 changed files with 13 additions and 4 deletions Side-by-side Diff
arch/i386/kernel/entry.S
| ... | ... | @@ -302,12 +302,16 @@ |
| 302 | 302 | pushl $(__USER_CS) |
| 303 | 303 | CFI_ADJUST_CFA_OFFSET 4 |
| 304 | 304 | /*CFI_REL_OFFSET cs, 0*/ |
| 305 | +#ifndef CONFIG_COMPAT_VDSO | |
| 305 | 306 | /* |
| 306 | 307 | * Push current_thread_info()->sysenter_return to the stack. |
| 307 | 308 | * A tiny bit of offset fixup is necessary - 4*4 means the 4 words |
| 308 | 309 | * pushed above; +8 corresponds to copy_thread's esp0 setting. |
| 309 | 310 | */ |
| 310 | 311 | pushl (TI_sysenter_return-THREAD_SIZE+8+4*4)(%esp) |
| 312 | +#else | |
| 313 | + pushl $SYSENTER_RETURN | |
| 314 | +#endif | |
| 311 | 315 | CFI_ADJUST_CFA_OFFSET 4 |
| 312 | 316 | CFI_REL_OFFSET eip, 0 |
| 313 | 317 |
arch/i386/kernel/sysenter.c
include/asm-i386/elf.h
| ... | ... | @@ -143,12 +143,9 @@ |
| 143 | 143 | # define VDSO_PRELINK 0 |
| 144 | 144 | #endif |
| 145 | 145 | |
| 146 | -#define VDSO_COMPAT_SYM(x) \ | |
| 146 | +#define VDSO_SYM(x) \ | |
| 147 | 147 | (VDSO_COMPAT_BASE + (unsigned long)(x) - VDSO_PRELINK) |
| 148 | 148 | |
| 149 | -#define VDSO_SYM(x) \ | |
| 150 | - (VDSO_BASE + (unsigned long)(x) - VDSO_PRELINK) | |
| 151 | - | |
| 152 | 149 | #define VDSO_HIGH_EHDR ((const struct elfhdr *) VDSO_HIGH_BASE) |
| 153 | 150 | #define VDSO_EHDR ((const struct elfhdr *) VDSO_COMPAT_BASE) |
| 154 | 151 | |
| 155 | 152 | |
| ... | ... | @@ -156,10 +153,12 @@ |
| 156 | 153 | |
| 157 | 154 | #define VDSO_ENTRY VDSO_SYM(&__kernel_vsyscall) |
| 158 | 155 | |
| 156 | +#ifndef CONFIG_COMPAT_VDSO | |
| 159 | 157 | #define ARCH_HAS_SETUP_ADDITIONAL_PAGES |
| 160 | 158 | struct linux_binprm; |
| 161 | 159 | extern int arch_setup_additional_pages(struct linux_binprm *bprm, |
| 162 | 160 | int executable_stack); |
| 161 | +#endif | |
| 163 | 162 | |
| 164 | 163 | extern unsigned int vdso_enabled; |
| 165 | 164 |
include/asm-i386/fixmap.h
include/asm-i386/page.h