[RFC PATCH 0/2] seccomp: defer syscall_rollback() to get_signal()
From: Oleg Nesterov
Date: Tue Apr 14 2026 - 12:50:41 EST
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.