Skip to content

Commit

Permalink
system: fix detection of WAIT_KILLABLE_RECV flag
Browse files Browse the repository at this point in the history
The kernel returns EINVAL when this flag is passed to seccomp
without the new listener flag so we should pass the along as well.

Reference on where the check happens in the kernel:
https://github.com/torvalds/linux/blob/aea6bf908d730b01bd264a8821159db9463c111c/kernel/seccomp.c#L1926-L1932

Signed-off-by: Ali Polatel <alip@chesswob.org>
  • Loading branch information
alip committed Nov 4, 2023
1 parent f1c3196 commit b6600d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ int sys_chk_seccomp_flag(int flag)
return state.sup_flag_tsync_esrch;
case SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV:
if (state.sup_flag_wait_kill < 0)
state.sup_flag_wait_kill = _sys_chk_flag_kernel(flag);
state.sup_flag_wait_kill = _sys_chk_flag_kernel(flag|SECCOMP_FILTER_FLAG_NEW_LISTENER);
return state.sup_flag_wait_kill;
}

Expand Down

0 comments on commit b6600d3

Please sign in to comment.