From 645e75f8038d1b177ead2d6ea0b3ade6f7f9d985 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 7 Jun 2018 15:32:16 +0200 Subject: executor: make syscall table and number constant We see some crashes that suggest corruption of the syscall number: invalid command number 1296 (errno 11) invalid command number 107 (errno 110) Make the table and the number constant to prevent corruption. --- executor/syscalls_linux.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'executor/syscalls_linux.h') diff --git a/executor/syscalls_linux.h b/executor/syscalls_linux.h index d093d0b6d..0d9bba2aa 100644 --- a/executor/syscalls_linux.h +++ b/executor/syscalls_linux.h @@ -6,8 +6,8 @@ #define SYZ_PAGE_SIZE 4096 #define SYZ_NUM_PAGES 4096 #define SYZ_DATA_OFFSET 536870912 -unsigned syscall_count = 1949; -call_t syscalls[] = { +#define SYZ_SYSCALL_COUNT 1949 +const call_t syscalls[] = { {"accept4", 364}, {"accept4$alg", 364}, {"accept4$ax25", 364}, @@ -1967,8 +1967,8 @@ call_t syscalls[] = { #define SYZ_PAGE_SIZE 4096 #define SYZ_NUM_PAGES 4096 #define SYZ_DATA_OFFSET 536870912 -unsigned syscall_count = 2001; -call_t syscalls[] = { +#define SYZ_SYSCALL_COUNT 2001 +const call_t syscalls[] = { {"accept", 43}, {"accept$alg", 43}, {"accept$ax25", 43}, @@ -3980,8 +3980,8 @@ call_t syscalls[] = { #define SYZ_PAGE_SIZE 4096 #define SYZ_NUM_PAGES 4096 #define SYZ_DATA_OFFSET 536870912 -unsigned syscall_count = 1958; -call_t syscalls[] = { +#define SYZ_SYSCALL_COUNT 1958 +const call_t syscalls[] = { {"accept", 285}, {"accept$alg", 285}, {"accept$ax25", 285}, @@ -5950,8 +5950,8 @@ call_t syscalls[] = { #define SYZ_PAGE_SIZE 4096 #define SYZ_NUM_PAGES 4096 #define SYZ_DATA_OFFSET 536870912 -unsigned syscall_count = 1930; -call_t syscalls[] = { +#define SYZ_SYSCALL_COUNT 1930 +const call_t syscalls[] = { {"accept", 202}, {"accept$alg", 202}, {"accept$ax25", 202}, @@ -7892,8 +7892,8 @@ call_t syscalls[] = { #define SYZ_PAGE_SIZE 4096 #define SYZ_NUM_PAGES 4096 #define SYZ_DATA_OFFSET 536870912 -unsigned syscall_count = 1819; -call_t syscalls[] = { +#define SYZ_SYSCALL_COUNT 1819 +const call_t syscalls[] = { {"accept", 330}, {"accept$alg", 330}, {"accept$ax25", 330}, -- cgit mrf-deployment