Skip to content

seccomp: improve handling of SECCOMP_IOCTL_NOTIF_RECV

Andrei Vagin lkml 2 versions – Applied

Status from this message: Applied to for-next/seccomp, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 3 repliesApplied
  2. v23 patches 8 repliesSuperseded

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/4seccomp: interrupt SECCOMP_IOCTL_NOTIF_RECV when all users have exitedkernel/seccomp.c+6 -11 reply
2/4seccomp: release task filters when the task exitskernel/exit.c kernel/seccomp.c+20 -60 replies
3/4selftests/seccomp: add test for NOTIF_RECV and unused filterstools/testing/selftests/seccomp/seccomp_bpf.c+54 -00 replies
4/4selftests/seccomp: check that a zombie leader doesn't affect otherstools/testing/selftests/seccomp/seccomp_bpf.c+77 -00 replies

Reviews trailers per patch

2 of 4 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchChristian BraunerOleg NesterovTycho Andersen
SeriesR-b
1/4R-b R-b
2/4R-b
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v3 thread

Cover letter [PATCH 0/4 v3] seccomp: improve handling of SECCOMP_IOCTL_NOTIF_RECV

This patch set addresses two problems with the SECCOMP_IOCTL_NOTIF_RECV ioctl:
* it doesn't return when the seccomp filter becomes unused (all tasks have exited).
* EPOLLHUP is triggered not when a task exits, but rather when its zombie is collected.

v2: - Remove unnecessary checks of PF_EXITING.
- Take siglock with disabling irqs.
Thanks to Oleg for the review and the help with the first version.
v3: - a few fixes suggested by Kees.
- add a test to ensure that a dead thread leader doesn't prevent installing new filters with SECCOMP_FILTER_FLAG_TSYNC.

Andrei Vagin (3):
seccomp: interrupt SECCOMP_IOCTL_NOTIF_RECV when all users have exited
seccomp: release task filters when the task exits selftests/seccomp: add test for NOTIF_RECV and unused filters selftests/seccomp: check that a zombie leader doesn't affect others

 kernel/exit.c                                 |   3 +-
 kernel/seccomp.c                              |  30 +++-
 tools/testing/selftests/seccomp/seccomp_bpf.c | 131 ++++++++++++++++++
 3 files changed, 157 insertions(+), 7 deletions(-)
Signature · 1 line
2.45.0.rc1.225.g2a3ae87e7f-goog