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/executor.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'executor/executor.h') diff --git a/executor/executor.h b/executor/executor.h index eb8474e4d..d5122cc71 100644 --- a/executor/executor.h +++ b/executor/executor.h @@ -165,7 +165,7 @@ struct kcov_comparison_t { bool operator<(const struct kcov_comparison_t& other) const; }; -long execute_syscall(call_t* c, long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8); +long execute_syscall(const call_t* c, long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8); thread_t* schedule_call(int call_index, int call_num, bool colliding, uint64 copyout_index, uint64 num_args, uint64* args, uint64* pos); void handle_completion(thread_t* th); void execute_call(thread_t* th); @@ -393,7 +393,7 @@ retry: } // Normal syscall. - if (call_num >= syscall_count) + if (call_num >= SYZ_SYSCALL_COUNT) fail("invalid command number %llu", call_num); uint64 copyout_index = read_input(&input_pos); uint64 num_args = read_input(&input_pos); @@ -634,7 +634,7 @@ void* worker_thread(void* arg) void execute_call(thread_t* th) { event_reset(&th->ready); - call_t* call = &syscalls[th->call_num]; + const call_t* call = &syscalls[th->call_num]; debug("#%d: %s(", th->id, call->name); for (int i = 0; i < th->num_args; i++) { if (i != 0) -- cgit mrf-deployment