All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] seccomp: Use FIFO semantics to order notifications
@ 2022-04-28  1:54 Sargun Dhillon
  2022-04-28  1:54 ` [PATCH 2/2] selftests/seccomp: Ensure that notifications come in FIFO order Sargun Dhillon
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Sargun Dhillon @ 2022-04-28  1:54 UTC (permalink / raw)
  To: Kees Cook, LKML, Tycho Andersen, Andy Lutomirski
  Cc: Sargun Dhillon, Christian Brauner

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>
---
 kernel/seccomp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/seccomp.c b/kernel/seccomp.c
index db10e73d06e0..2cb3bcd90eb3 100644
--- a/kernel/seccomp.c
+++ b/kernel/seccomp.c
@@ -1101,7 +1101,7 @@ static int seccomp_do_user_notification(int this_syscall,
 	n.data = sd;
 	n.id = seccomp_next_notify_id(match);
 	init_completion(&n.ready);
-	list_add(&n.list, &match->notif->notifications);
+	list_add_tail(&n.list, &match->notif->notifications);
 	INIT_LIST_HEAD(&n.addfd);
 
 	up(&match->notif->request);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-04-29 18:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-28  1:54 [PATCH 1/2] seccomp: Use FIFO semantics to order notifications Sargun Dhillon
2022-04-28  1:54 ` [PATCH 2/2] selftests/seccomp: Ensure that notifications come in FIFO order Sargun Dhillon
2022-04-28 13:15   ` Tycho Andersen
2022-04-28 16:38     ` Sargun Dhillon
2022-04-28 19:34       ` Tycho Andersen
2022-04-28  8:04 ` [PATCH 1/2] seccomp: Use FIFO semantics to order notifications Christian Brauner
2022-04-29 18:50 ` Kees Cook

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.