seccomp: don't use semaphore and wait_queue together
authorAndrei Vagin <avagin@google.com>
Wed, 8 Mar 2023 07:31:56 +0000 (23:31 -0800)
committerKees Cook <keescook@chromium.org>
Mon, 17 Jul 2023 23:08:08 +0000 (16:08 -0700)
commit4943b66df18a0e8aedd006792ed73257cd2da8f8
treee6b3132439cb92e619d1c3a360bcb2e9011fc2c7
parentfdf0eaf11452d72945af31804e2a1048ee1b574c
seccomp: don't use semaphore and wait_queue together

The main reason is to use new wake_up helpers that will be added in the
following patches. But here are a few other reasons:

* if we use two different ways, we always need to call them both. This
  patch fixes seccomp_notify_recv where we forgot to call wake_up_poll
  in the error path.

* If we use one primitive, we can control how many waiters are woken up
  for each request. Our goal is to wake up just one that will handle a
  request. Right now, wake_up_poll can wake up one waiter and
  up(&match->notif->request) can wake up one more.

Signed-off-by: Andrei Vagin <avagin@google.com>
Acked-by: "Peter Zijlstra (Intel)" <peterz@infradead.org>
Link: https://lore.kernel.org/r/20230308073201.3102738-2-avagin@google.com
Signed-off-by: Kees Cook <keescook@chromium.org>
kernel/seccomp.c