Skip to content

seccomp: support O_PATH descriptors in addfd

Cong Wang lkml 1 version Applied

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

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2seccomp: allow addfd to transfer O_PATH descriptorskernel/seccomp.c+1 -10 replies
2/2selftests/seccomp: test addfd with an O_PATH descriptortools/testing/selftests/seccomp/seccomp_bpf.c+59 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] seccomp: support O_PATH descriptors in addfd

From: Cong Wang <[email protected]>

The Sandlock project uses seccomp user notification to broker opens. To maintain user-space application compatibility, it needs to return a genuine O_PATH descriptor when an application requests one. Currently, SECCOMP_IOCTL_NOTIF_ADDFD rejects the supervisor's O_PATH descriptor with EBADF.

Allow addfd to transfer O_PATH descriptors and add a regression test for their flags and read behavior. All 112 seccomp functional tests and all 7 benchmark checks passed.

Cong Wang (2):
seccomp: allow addfd to transfer O_PATH descriptors selftests/seccomp: test addfd with an O_PATH descriptor

 kernel/seccomp.c                              |  2 +-
 tools/testing/selftests/seccomp/seccomp_bpf.c | 59 +++++++++++++++++++
 2 files changed, 60 insertions(+), 1 deletion(-)
Signature · 1 line
2.43.0