diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/include/asm/elf.h | 20 | ||||
-rw-r--r-- | arch/x86/um/vdso/vma.c | 2 | ||||
-rw-r--r-- | arch/x86/vdso/vdso32-setup.c | 19 | ||||
-rw-r--r-- | arch/x86/vdso/vma.c | 6 |
4 files changed, 25 insertions, 22 deletions
diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h index 2c71182d30ef..e96df2c0dd69 100644 --- a/arch/x86/include/asm/elf.h +++ b/arch/x86/include/asm/elf.h | |||
@@ -75,7 +75,12 @@ typedef struct user_fxsr_struct elf_fpxregset_t; | |||
75 | 75 | ||
76 | #include <asm/vdso.h> | 76 | #include <asm/vdso.h> |
77 | 77 | ||
78 | extern unsigned int vdso_enabled; | 78 | #ifdef CONFIG_X86_64 |
79 | extern unsigned int vdso64_enabled; | ||
80 | #endif | ||
81 | #if defined(CONFIG_X86_32) || defined(CONFIG_COMPAT) | ||
82 | extern unsigned int vdso32_enabled; | ||
83 | #endif | ||
79 | 84 | ||
80 | /* | 85 | /* |
81 | * This is used to ensure we don't load something for the wrong architecture. | 86 | * This is used to ensure we don't load something for the wrong architecture. |
@@ -269,9 +274,9 @@ extern int force_personality32; | |||
269 | 274 | ||
270 | struct task_struct; | 275 | struct task_struct; |
271 | 276 | ||
272 | #define ARCH_DLINFO_IA32(vdso_enabled) \ | 277 | #define ARCH_DLINFO_IA32 \ |
273 | do { \ | 278 | do { \ |
274 | if (vdso_enabled) { \ | 279 | if (vdso32_enabled) { \ |
275 | NEW_AUX_ENT(AT_SYSINFO, VDSO_ENTRY); \ | 280 | NEW_AUX_ENT(AT_SYSINFO, VDSO_ENTRY); \ |
276 | NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_CURRENT_BASE); \ | 281 | NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_CURRENT_BASE); \ |
277 | } \ | 282 | } \ |
@@ -281,7 +286,7 @@ do { \ | |||
281 | 286 | ||
282 | #define STACK_RND_MASK (0x7ff) | 287 | #define STACK_RND_MASK (0x7ff) |
283 | 288 | ||
284 | #define ARCH_DLINFO ARCH_DLINFO_IA32(vdso_enabled) | 289 | #define ARCH_DLINFO ARCH_DLINFO_IA32 |
285 | 290 | ||
286 | /* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */ | 291 | /* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */ |
287 | 292 | ||
@@ -292,14 +297,15 @@ do { \ | |||
292 | 297 | ||
293 | #define ARCH_DLINFO \ | 298 | #define ARCH_DLINFO \ |
294 | do { \ | 299 | do { \ |
295 | if (vdso_enabled) \ | 300 | if (vdso64_enabled) \ |
296 | NEW_AUX_ENT(AT_SYSINFO_EHDR, \ | 301 | NEW_AUX_ENT(AT_SYSINFO_EHDR, \ |
297 | (unsigned long)current->mm->context.vdso); \ | 302 | (unsigned long)current->mm->context.vdso); \ |
298 | } while (0) | 303 | } while (0) |
299 | 304 | ||
305 | /* As a historical oddity, the x32 and x86_64 vDSOs are controlled together. */ | ||
300 | #define ARCH_DLINFO_X32 \ | 306 | #define ARCH_DLINFO_X32 \ |
301 | do { \ | 307 | do { \ |
302 | if (vdso_enabled) \ | 308 | if (vdso64_enabled) \ |
303 | NEW_AUX_ENT(AT_SYSINFO_EHDR, \ | 309 | NEW_AUX_ENT(AT_SYSINFO_EHDR, \ |
304 | (unsigned long)current->mm->context.vdso); \ | 310 | (unsigned long)current->mm->context.vdso); \ |
305 | } while (0) | 311 | } while (0) |
@@ -310,7 +316,7 @@ do { \ | |||
310 | if (test_thread_flag(TIF_X32)) \ | 316 | if (test_thread_flag(TIF_X32)) \ |
311 | ARCH_DLINFO_X32; \ | 317 | ARCH_DLINFO_X32; \ |
312 | else \ | 318 | else \ |
313 | ARCH_DLINFO_IA32(sysctl_vsyscall32) | 319 | ARCH_DLINFO_IA32 |
314 | 320 | ||
315 | #define COMPAT_ELF_ET_DYN_BASE (TASK_UNMAPPED_BASE + 0x1000000) | 321 | #define COMPAT_ELF_ET_DYN_BASE (TASK_UNMAPPED_BASE + 0x1000000) |
316 | 322 | ||
diff --git a/arch/x86/um/vdso/vma.c b/arch/x86/um/vdso/vma.c index af91901babb8..916cda4cd5b4 100644 --- a/arch/x86/um/vdso/vma.c +++ b/arch/x86/um/vdso/vma.c | |||
@@ -12,7 +12,7 @@ | |||
12 | #include <asm/page.h> | 12 | #include <asm/page.h> |
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | 14 | ||
15 | unsigned int __read_mostly vdso_enabled = 1; | 15 | static unsigned int __read_mostly vdso_enabled = 1; |
16 | unsigned long um_vdso_addr; | 16 | unsigned long um_vdso_addr; |
17 | 17 | ||
18 | extern unsigned long task_size; | 18 | extern unsigned long task_size; |
diff --git a/arch/x86/vdso/vdso32-setup.c b/arch/x86/vdso/vdso32-setup.c index 00348980a3a6..5a657d93c6e0 100644 --- a/arch/x86/vdso/vdso32-setup.c +++ b/arch/x86/vdso/vdso32-setup.c | |||
@@ -37,7 +37,6 @@ | |||
37 | #endif | 37 | #endif |
38 | 38 | ||
39 | #ifdef CONFIG_X86_64 | 39 | #ifdef CONFIG_X86_64 |
40 | #define vdso_enabled sysctl_vsyscall32 | ||
41 | #define arch_setup_additional_pages syscall32_setup_pages | 40 | #define arch_setup_additional_pages syscall32_setup_pages |
42 | #endif | 41 | #endif |
43 | 42 | ||
@@ -45,13 +44,13 @@ | |||
45 | * Should the kernel map a VDSO page into processes and pass its | 44 | * Should the kernel map a VDSO page into processes and pass its |
46 | * address down to glibc upon exec()? | 45 | * address down to glibc upon exec()? |
47 | */ | 46 | */ |
48 | unsigned int __read_mostly vdso_enabled = VDSO_DEFAULT; | 47 | unsigned int __read_mostly vdso32_enabled = VDSO_DEFAULT; |
49 | 48 | ||
50 | static int __init vdso_setup(char *s) | 49 | static int __init vdso32_setup(char *s) |
51 | { | 50 | { |
52 | vdso_enabled = simple_strtoul(s, NULL, 0); | 51 | vdso32_enabled = simple_strtoul(s, NULL, 0); |
53 | 52 | ||
54 | if (vdso_enabled > 1) | 53 | if (vdso32_enabled > 1) |
55 | pr_warn("vdso32 values other than 0 and 1 are no longer allowed; vdso disabled\n"); | 54 | pr_warn("vdso32 values other than 0 and 1 are no longer allowed; vdso disabled\n"); |
56 | 55 | ||
57 | return 1; | 56 | return 1; |
@@ -62,12 +61,10 @@ static int __init vdso_setup(char *s) | |||
62 | * behavior on both 64-bit and 32-bit kernels. | 61 | * behavior on both 64-bit and 32-bit kernels. |
63 | * On 32-bit kernels, vdso=[012] means the same thing. | 62 | * On 32-bit kernels, vdso=[012] means the same thing. |
64 | */ | 63 | */ |
65 | __setup("vdso32=", vdso_setup); | 64 | __setup("vdso32=", vdso32_setup); |
66 | 65 | ||
67 | #ifdef CONFIG_X86_32 | 66 | #ifdef CONFIG_X86_32 |
68 | __setup_param("vdso=", vdso32_setup, vdso_setup, 0); | 67 | __setup_param("vdso=", vdso_setup, vdso32_setup, 0); |
69 | |||
70 | EXPORT_SYMBOL_GPL(vdso_enabled); | ||
71 | #endif | 68 | #endif |
72 | 69 | ||
73 | static struct page **vdso32_pages; | 70 | static struct page **vdso32_pages; |
@@ -160,7 +157,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) | |||
160 | return x32_setup_additional_pages(bprm, uses_interp); | 157 | return x32_setup_additional_pages(bprm, uses_interp); |
161 | #endif | 158 | #endif |
162 | 159 | ||
163 | if (vdso_enabled != 1) /* Other values all mean "disabled" */ | 160 | if (vdso32_enabled != 1) /* Other values all mean "disabled" */ |
164 | return 0; | 161 | return 0; |
165 | 162 | ||
166 | down_write(&mm->mmap_sem); | 163 | down_write(&mm->mmap_sem); |
@@ -244,7 +241,7 @@ subsys_initcall(sysenter_setup); | |||
244 | static struct ctl_table abi_table2[] = { | 241 | static struct ctl_table abi_table2[] = { |
245 | { | 242 | { |
246 | .procname = "vsyscall32", | 243 | .procname = "vsyscall32", |
247 | .data = &sysctl_vsyscall32, | 244 | .data = &vdso32_enabled, |
248 | .maxlen = sizeof(int), | 245 | .maxlen = sizeof(int), |
249 | .mode = 0644, | 246 | .mode = 0644, |
250 | .proc_handler = proc_dointvec | 247 | .proc_handler = proc_dointvec |
diff --git a/arch/x86/vdso/vma.c b/arch/x86/vdso/vma.c index 1ad102613127..8b790398ed1d 100644 --- a/arch/x86/vdso/vma.c +++ b/arch/x86/vdso/vma.c | |||
@@ -17,7 +17,7 @@ | |||
17 | #include <asm/page.h> | 17 | #include <asm/page.h> |
18 | 18 | ||
19 | #if defined(CONFIG_X86_64) | 19 | #if defined(CONFIG_X86_64) |
20 | unsigned int __read_mostly vdso_enabled = 1; | 20 | unsigned int __read_mostly vdso64_enabled = 1; |
21 | 21 | ||
22 | DECLARE_VDSO_IMAGE(vdso); | 22 | DECLARE_VDSO_IMAGE(vdso); |
23 | extern unsigned short vdso_sync_cpuid; | 23 | extern unsigned short vdso_sync_cpuid; |
@@ -160,7 +160,7 @@ static int setup_additional_pages(struct linux_binprm *bprm, | |||
160 | unsigned long addr; | 160 | unsigned long addr; |
161 | int ret; | 161 | int ret; |
162 | 162 | ||
163 | if (!vdso_enabled) | 163 | if (!vdso64_enabled) |
164 | return 0; | 164 | return 0; |
165 | 165 | ||
166 | down_write(&mm->mmap_sem); | 166 | down_write(&mm->mmap_sem); |
@@ -203,7 +203,7 @@ int x32_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) | |||
203 | 203 | ||
204 | static __init int vdso_setup(char *s) | 204 | static __init int vdso_setup(char *s) |
205 | { | 205 | { |
206 | vdso_enabled = simple_strtoul(s, NULL, 0); | 206 | vdso64_enabled = simple_strtoul(s, NULL, 0); |
207 | return 0; | 207 | return 0; |
208 | } | 208 | } |
209 | __setup("vdso=", vdso_setup); | 209 | __setup("vdso=", vdso_setup); |