Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 9bf33a06 authored by Kees Cook's avatar Kees Cook Committed by Ravi Kumar Siddojigari
Browse files

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.

Change-Id: I0522f45e98bf655a6d91905b68a4b6f501fa9936
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Reviewed-by: default avatarOleg Nesterov <oleg@redhat.com>
Reviewed-by: default avatarAndy Lutomirski <luto@amacapital.net>
Git-commit: b6a12bf4dd762236c7f637b19cfe10a268304b9b
Git-repo: https://www.codeaurora.org/cgit/external/gigabyte/kernel/msm


Signed-off-by: default avatarRavi Kumar Siddojigari <rsiddoji@codeaurora.org>
parent e23a3d62
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment