aboutsummaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-06-07 15:32:16 +0200
committerDmitry Vyukov <dvyukov@google.com>2018-06-07 15:32:30 +0200
commit645e75f8038d1b177ead2d6ea0b3ade6f7f9d985 (patch)
treeabdb1ba3d8b7dff944d0ca84fc382bc0094f8635 /sys
parent7fb9023fd78f6c0641624e3169c405e384f14691 (diff)
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.
Diffstat (limited to 'sys')
-rw-r--r--sys/syz-sysgen/sysgen.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/syz-sysgen/sysgen.go b/sys/syz-sysgen/sysgen.go
index cef35ba05..ea8525cbc 100644
--- a/sys/syz-sysgen/sysgen.go
+++ b/sys/syz-sysgen/sysgen.go
@@ -251,8 +251,8 @@ var archTempl = template.Must(template.New("").Parse(`
#define SYZ_PAGE_SIZE {{.PageSize}}
#define SYZ_NUM_PAGES {{.NumPages}}
#define SYZ_DATA_OFFSET {{.DataOffset}}
-unsigned syscall_count = {{len $.Calls}};
-call_t syscalls[] = {
+#define SYZ_SYSCALL_COUNT {{len $.Calls}}
+const call_t syscalls[] = {
{{range $c := $.Calls}} {"{{$c.Name}}", {{$c.NR}}{{if $c.NeedCall}}, (syscall_t){{$c.CallName}}{{end}}},
{{end}}
};