x86, um: actually mark system call tables readonly
Subsystems (2)
PATCH 1/1 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_sizeAfter:
$ 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--- arch/x86/um/sys_call_table_32.c | 2 +- arch/x86/um/sys_call_table_64.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/um/sys_call_table_32.c +1 -1
@@ -34,7 +34,7 @@ typedef asmlinkage void (*sys_call_ptr_t)(void); extern asmlinkage void sys_ni_syscall(void); -const sys_call_ptr_t sys_call_table[] __cacheline_aligned = { +const sys_call_ptr_t sys_call_table[]____cacheline_aligned = {/* * Smells like a compiler bug -- it doesn't work * when the & below is removed.
arch/x86/um/sys_call_table_64.c +1 -1
@@ -47,7 +47,7 @@ typedef void (*sys_call_ptr_t)(void);extern void sys_ni_syscall (void ); -const sys_call_ptr_t sys_call_table[] __cacheline_aligned = { +const sys_call_ptr_t sys_call_table[]____cacheline_aligned = {/* * Smells like a compiler bug -- it doesn't work * when the & below is removed.
Signature · 1 line
1.7.11.7
Richard Weinberger
maintainerAm 03.01.2015 um 13:11 schrieb Daniel Borkmann:
Quoted 6 lines
Commit
a074335a370e("x86, um: Mark system call tables readonly") was supposed to mark thesys_call_tablein 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_alignedenforcessys_call_tablebeing placed into .data..cacheline_aligned instead. We need to use the____cacheline_alignedversion instead to fix this issue.
__ vs. ___ oh my...
I'll pick up this patch.
Thanks a lot Daniel!
//richard
On 01/03/2015 10:40 PM, Richard Weinberger wrote:
...
Quoted 1 line
I'll pick up this patch.
Thanks a lot, Richard!