x86, um: actually mark system call tables readonly
authorDaniel Borkmann <dborkman@redhat.com>
Sat, 3 Jan 2015 12:11:10 +0000 (13:11 +0100)
committerJiri Slaby <jslaby@suse.cz>
Thu, 29 Jan 2015 14:44:47 +0000 (15:44 +0100)
commitf465346bc77a7c444f6c83b789fae23df454322f
treec2cc26531d01d66c114fd7d79217615440bf59d6
parentad63ddb0b121132417f91578791e88306396a41b
x86, um: actually mark system call tables readonly

commit b485342bd79af363c77ef1a421c4a0aef2de9812 upstream.

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>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
arch/x86/um/sys_call_table_32.c
arch/x86/um/sys_call_table_64.c