Skip to content

Commit 51fbc05

Browse files
Daniel Borkmanngregkh
authored andcommitted
x86, um: actually mark system call tables readonly
commit b485342 upstream. Commit a074335 ("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: a074335 ("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b9d078c commit 51fbc05

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎arch/x86/um/sys_call_table_32.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ typedef asmlinkage void (*sys_call_ptr_t)(void);
3434

3535
extern asmlinkage void sys_ni_syscall(void);
3636

37-
const sys_call_ptr_t sys_call_table[] __cacheline_aligned = {
37+
const sys_call_ptr_t sys_call_table[] ____cacheline_aligned = {
3838
/*
3939
* Smells like a compiler bug -- it doesn't work
4040
* when the & below is removed.

‎arch/x86/um/sys_call_table_64.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ typedef void (*sys_call_ptr_t)(void);
4646

4747
extern void sys_ni_syscall(void);
4848

49-
const sys_call_ptr_t sys_call_table[] __cacheline_aligned = {
49+
const sys_call_ptr_t sys_call_table[] ____cacheline_aligned = {
5050
/*
5151
* Smells like a compiler bug -- it doesn't work
5252
* when the & below is removed.

0 commit comments

Comments
 (0)