summaryrefslogtreecommitdiff
path: root/kernel/sys.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2014-06-27 22:16:33 (GMT)
committerKees Cook <keescook@chromium.org>2014-07-18 19:13:39 (GMT)
commitc8bee430dc52cfca6c1aab27752a89275d78d50f (patch)
tree10e229d375150f64808709f5fe9c88b84236e327 /kernel/sys.c
parent1d4457f99928a968767f6405b4a1f50845aa15fd (diff)
downloadlinux-c8bee430dc52cfca6c1aab27752a89275d78d50f.tar.xz
seccomp: split filter prep from check and apply
In preparation for adding seccomp locking, move filter creation away from where it is checked and applied. This will allow for locking where no memory allocation is happening. The validation, filter attachment, and seccomp mode setting can all happen under the future locks. For extreme defensiveness, I've added a BUG_ON check for the calculated size of the buffer allocation in case BPF_MAXINSN ever changes, which shouldn't ever happen. The compiler should actually optimize out this check since the test above it makes it impossible. Signed-off-by: Kees Cook <keescook@chromium.org> Reviewed-by: Oleg Nesterov <oleg@redhat.com> Reviewed-by: Andy Lutomirski <luto@amacapital.net>
Diffstat (limited to 'kernel/sys.c')
0 files changed, 0 insertions, 0 deletions