Commit bb152f53 authored by Arjan van de Ven's avatar Arjan van de Ven Committed by Linus Torvalds

[PATCH] x86/x86_64: mark rodata section read-only: make some datastructures const

Mark some key kernel datastructures readonly.  This patch was previously
posted on Jun 28th but was back then not merged because nothing was enforcing
rodata anyway..  well that changed now :)

Patch by Christoph Lameter <christoph@lameter.com> and Dave Jones
<davej@redhat.com>
Signed-off-by: default avatarArjan van de Ven <arjan@infradead.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Cc: Andi Kleen <ak@muc.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 67df197b
...@@ -657,6 +657,7 @@ ENTRY(spurious_interrupt_bug) ...@@ -657,6 +657,7 @@ ENTRY(spurious_interrupt_bug)
pushl $do_spurious_interrupt_bug pushl $do_spurious_interrupt_bug
jmp error_code jmp error_code
.section .rodata,"a"
#include "syscall_table.S" #include "syscall_table.S"
syscall_table_size=(.-sys_call_table) syscall_table_size=(.-sys_call_table)
.data
ENTRY(sys_call_table) ENTRY(sys_call_table)
.long sys_restart_syscall /* 0 - old "setup()" system call, used for restarting */ .long sys_restart_syscall /* 0 - old "setup()" system call, used for restarting */
.long sys_exit .long sys_exit
......
...@@ -341,7 +341,7 @@ ENTRY(ia32_ptregs_common) ...@@ -341,7 +341,7 @@ ENTRY(ia32_ptregs_common)
jmp ia32_sysret /* misbalances the return cache */ jmp ia32_sysret /* misbalances the return cache */
CFI_ENDPROC CFI_ENDPROC
.data .section .rodata,"a"
.align 8 .align 8
.globl ia32_sys_call_table .globl ia32_sys_call_table
ia32_sys_call_table: ia32_sys_call_table:
......
...@@ -19,7 +19,7 @@ typedef void (*sys_call_ptr_t)(void); ...@@ -19,7 +19,7 @@ typedef void (*sys_call_ptr_t)(void);
extern void sys_ni_syscall(void); extern void sys_ni_syscall(void);
sys_call_ptr_t sys_call_table[__NR_syscall_max+1] __cacheline_aligned = { const sys_call_ptr_t sys_call_table[__NR_syscall_max+1] = {
/* Smells like a like a compiler bug -- it doesn't work when the & below is removed. */ /* Smells like a like a compiler bug -- it doesn't work when the & below is removed. */
[0 ... __NR_syscall_max] = &sys_ni_syscall, [0 ... __NR_syscall_max] = &sys_ni_syscall,
#include <asm-x86_64/unistd.h> #include <asm-x86_64/unistd.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment