Unverified Commit e6a30224 authored by Jisheng Zhang's avatar Jisheng Zhang Committed by Palmer Dabbelt
Browse files

riscv: Constify sys_call_table



Constify the sys_call_table so that it will be placed in the .rodata
section. This will cause attempts to modify the table to fail when
strict page permissions are in place.

Signed-off-by: default avatarJisheng Zhang <jszhang@kernel.org>
Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
parent de31ea4a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@
#include <linux/err.h>

/* The array of function pointers for syscalls. */
extern void *sys_call_table[];
extern void * const sys_call_table[];

/*
 * Only the low 32 bits of orig_r0 are meaningful, so we return int.
+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@
#undef __SYSCALL
#define __SYSCALL(nr, call)	[nr] = (call),

void *sys_call_table[__NR_syscalls] = {
void * const sys_call_table[__NR_syscalls] = {
	[0 ... __NR_syscalls - 1] = sys_ni_syscall,
#include <asm/unistd.h>
};