Skip to content

Commit 4cbf6f6

Browse files
sargunkees
authored andcommitted
seccomp: Use FIFO semantics to order notifications
Previously, the seccomp notifier used LIFO semantics, where each notification would be added on top of the stack, and notifications were popped off the top of the stack. This could result one process that generates a large number of notifications preventing other notifications from being handled. This patch moves from LIFO (stack) semantics to FIFO (queue semantics). Signed-off-by: Sargun Dhillon <sargun@sargun.me> Reviewed-by: Christian Brauner (Microsoft) <brauner@kernel.org> Signed-off-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20220428015447.13661-1-sargun@sargun.me
1 parent 95a126d commit 4cbf6f6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernel/seccomp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,7 @@ static int seccomp_do_user_notification(int this_syscall,
11001100
n.data = sd;
11011101
n.id = seccomp_next_notify_id(match);
11021102
init_completion(&n.ready);
1103-
list_add(&n.list, &match->notif->notifications);
1103+
list_add_tail(&n.list, &match->notif->notifications);
11041104
INIT_LIST_HEAD(&n.addfd);
11051105

11061106
up(&match->notif->request);

0 commit comments

Comments
 (0)