Skip to content

RFC seccomp: defer syscall_rollback() to get_signal()

Oleg Nesterov lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2seccomp: introduce seccomp_nack_syscall() helperkernel/seccomp.c+10 -80 replies
2/2seccomp: defer syscall_rollback() to get_signal()kernel/seccomp.c kernel/signal.c+22 -24 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/2] seccomp: defer syscall_rollback() to get_signal()

Kees, Andy, et al, please comment. I think the usage of syscall_rollback() in __seccomp_filter() is not right.

This is just RFC.

In fact I think that syscall_exit_work() should do nothing if a syscall was rejected with force_sig_seccomp() by __seccomp_filter(). If nothing else, the syscall was never actually executed.

Perhaps we can add a new SYSCALL_WORK_SYSCALL_XXX to SYSCALL_WORK_EXIT. seccomp_nack_syscall() can set this flag, and syscall_exit_work() can do

	if (work & SYSCALL_WORK_SYSCALL_XXX) {
		clear_syscall_work(SYSCALL_XXX); // for the !force_coredump case
		return;
	}

after the "if (SYSCALL_WORK_SYSCALL_USER_DISPATCH)" block.

But I didn't dare to do such a change.

What do you think?

Oleg.