seccomp: Use -1 marker for end of mode 1 syscall list
authorKees Cook <keescook@chromium.org>
Fri, 19 Jun 2020 19:20:15 +0000 (12:20 -0700)
committerKees Cook <keescook@chromium.org>
Fri, 10 Jul 2020 23:01:52 +0000 (16:01 -0700)
commitfe4bfff86ec54773df3db79e8112e3b0f820c799
treecee16ed72bbd27d395c6394252ec9a9cd0160862
parent47e33c05f9f07cac3de833e531bcac9ae052c7ca
seccomp: Use -1 marker for end of mode 1 syscall list

The terminator for the mode 1 syscalls list was a 0, but that could be
a valid syscall number (e.g. x86_64 __NR_read). By luck, __NR_read was
listed first and the loop construct would not test it, so there was no
bug. However, this is fragile. Replace the terminator with -1 instead,
and make the variable name for mode 1 syscall lists more descriptive.

Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Will Drewry <wad@chromium.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
arch/mips/include/asm/seccomp.h
include/asm-generic/seccomp.h
kernel/seccomp.c