BACKPORT: seccomp: create internal mode-setting function

In preparation for having other callers of the seccomp mode setting
logic, split the prctl entry point away from the core logic that performs
seccomp mode setting.

Signed-off-by: Kees Cook <>
Reviewed-by: Oleg Nesterov <>
Reviewed-by: Andy Lutomirski <>

Bug: 28020023
Patchset: seccomp

(cherry picked from kernel/msm commit 82e69a633c6f19551fb75fcea5a998d57bbddde7)
Signed-off-by: Kees Cook <>
Change-Id: I40ac488c5bfa57ce8e4deee4d0f7e6248dcb2d30
1 file changed