diff options
| author | Daniel Borkmann <dborkman@redhat.com> | 2015-01-03 07:11:10 -0500 |
|---|---|---|
| committer | Richard Weinberger <richard@nod.at> | 2015-01-04 08:21:25 -0500 |
| commit | b485342bd79af363c77ef1a421c4a0aef2de9812 (patch) | |
| tree | ee1d63514ef4765a829b21849b5ae863bfe22a99 | |
| parent | f911d731054ab3d82ee72a16b889e17ca3a2332a (diff) | |
x86, um: actually mark system call tables readonly
Commit a074335a370e ("x86, um: Mark system call tables readonly") was
supposed to mark the sys_call_table in UML as RO by adding the const,
but it doesn't have the desired effect as it's nevertheless being placed
into the data section since __cacheline_aligned enforces sys_call_table
being placed into .data..cacheline_aligned instead. We need to use
the ____cacheline_aligned version instead to fix this issue.
Before:
$ nm -v arch/x86/um/sys_call_table_64.o | grep -1 "sys_call_table"
U sys_writev
0000000000000000 D sys_call_table
0000000000000000 D syscall_table_size
After:
$ nm -v arch/x86/um/sys_call_table_64.o | grep -1 "sys_call_table"
U sys_writev
0000000000000000 R sys_call_table
0000000000000000 D syscall_table_size
Fixes: a074335a370e ("x86, um: Mark system call tables readonly")
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
| -rw-r--r-- | arch/x86/um/sys_call_table_32.c | 2 | ||||
| -rw-r--r-- | arch/x86/um/sys_call_table_64.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/um/sys_call_table_32.c b/arch/x86/um/sys_call_table_32.c index 531d4269e2e3..bd16d6c370ec 100644 --- a/arch/x86/um/sys_call_table_32.c +++ b/arch/x86/um/sys_call_table_32.c | |||
| @@ -34,7 +34,7 @@ typedef asmlinkage void (*sys_call_ptr_t)(void); | |||
| 34 | 34 | ||
| 35 | extern asmlinkage void sys_ni_syscall(void); | 35 | extern asmlinkage void sys_ni_syscall(void); |
| 36 | 36 | ||
| 37 | const sys_call_ptr_t sys_call_table[] __cacheline_aligned = { | 37 | const sys_call_ptr_t sys_call_table[] ____cacheline_aligned = { |
| 38 | /* | 38 | /* |
| 39 | * Smells like a compiler bug -- it doesn't work | 39 | * Smells like a compiler bug -- it doesn't work |
| 40 | * when the & below is removed. | 40 | * when the & below is removed. |
diff --git a/arch/x86/um/sys_call_table_64.c b/arch/x86/um/sys_call_table_64.c index 20c3649d0691..5cdfa9db2217 100644 --- a/arch/x86/um/sys_call_table_64.c +++ b/arch/x86/um/sys_call_table_64.c | |||
| @@ -47,7 +47,7 @@ typedef void (*sys_call_ptr_t)(void); | |||
| 47 | 47 | ||
| 48 | extern void sys_ni_syscall(void); | 48 | extern void sys_ni_syscall(void); |
| 49 | 49 | ||
| 50 | const sys_call_ptr_t sys_call_table[] __cacheline_aligned = { | 50 | const sys_call_ptr_t sys_call_table[] ____cacheline_aligned = { |
| 51 | /* | 51 | /* |
| 52 | * Smells like a compiler bug -- it doesn't work | 52 | * Smells like a compiler bug -- it doesn't work |
| 53 | * when the & below is removed. | 53 | * when the & below is removed. |
