BACKPORT: seccomp: extract check/assign mode helpers

To support splitting mode 1 from mode 2, extract the mode checking and
assignment logic into common functions.

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

Bug: 28020023
Patchset: seccomp

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