BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/8] BPF LSM xattrs at inode creation support
@ 2026-09-15 15:07 Daniel Borkmann
  2026-09-15 15:07 ` [PATCH bpf-next 1/8] ocfs2: Copy the xattr name in ocfs2_initxattrs Daniel Borkmann
                   ` (8 more replies)
  0 siblings, 9 replies; 31+ messages in thread
From: Daniel Borkmann @ 2026-09-15 15:07 UTC (permalink / raw)
  To: alexei.starovoitov
  Cc: brauner, dwindsor, john.fastabend, memxor, kpsingh, matt, bpf

Many in-kernel LSMs store security labels in extended file system attributes
(xattrs). For these LSMs, atomic labeling during inode creation is critical:
If the inode becomes accessible before its xattr is set, it is briefly
unlabeled, which can disrupt LSMs making policy decisions based on file
labels. Existing LSMs solve this by setting xattrs in the inode_init_security
hook, which runs before the inode becomes accessible. BPF LSM programs
currently lack this capability, and this series addresses this gap along
with BPF selftests. Thanks!

Daniel Borkmann (6):
  ocfs2: Copy the xattr name in ocfs2_initxattrs
  bpf, lsm: Reject writes into the BPF LSM program context
  bpf, lsm: Mark the BPF LSM hook overrides noinline
  selftests/bpf: Test that the BPF LSM context is read-only
  selftests/bpf: Add verifier tests for the __ctx_out plumbing
  selftests/bpf: Add tests for BPF LSM inode init labelling

David Windsor (2):
  bpf: Support passing context output arguments to kfuncs
  bpf, lsm: Let BPF LSM provide xattrs at inode creation

 Documentation/bpf/kfuncs.rst                  |  23 +
 fs/bpf_fs_kfuncs.c                            |  99 +++++
 fs/ocfs2/namei.c                              |   2 +
 fs/ocfs2/xattr.c                              |   5 +-
 include/linux/bpf.h                           |   3 +
 include/linux/bpf_lsm.h                       |  11 +-
 kernel/bpf/bpf_lsm.c                          |  26 +-
 kernel/bpf/bpf_lsm_proto.c                    |  19 +-
 kernel/bpf/btf.c                              |   7 +-
 kernel/bpf/diagnostics.c                      |   2 +
 kernel/bpf/verifier.c                         |  36 +-
 security/bpf/hooks.c                          |   1 +
 tools/testing/selftests/bpf/bpf_kfuncs.h      |  19 +-
 tools/testing/selftests/bpf/config            |   2 +
 .../bpf/prog_tests/lsm_inode_init_xattr.c     | 399 ++++++++++++++++++
 .../selftests/bpf/prog_tests/verifier.c       |   2 +
 .../bpf/progs/lsm_inode_init_xattr.c          |  98 +++++
 .../bpf/progs/lsm_inode_init_xattr_budget.c   |  37 ++
 .../bpf/progs/lsm_inode_init_xattr_value.c    |  47 +++
 .../selftests/bpf/progs/verifier_lsm.c        |  13 +
 .../bpf/progs/verifier_lsm_init_xattr.c       | 245 +++++++++++
 21 files changed, 1080 insertions(+), 16 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/lsm_inode_init_xattr.c
 create mode 100644 tools/testing/selftests/bpf/progs/lsm_inode_init_xattr.c
 create mode 100644 tools/testing/selftests/bpf/progs/lsm_inode_init_xattr_budget.c
 create mode 100644 tools/testing/selftests/bpf/progs/lsm_inode_init_xattr_value.c
 create mode 100644 tools/testing/selftests/bpf/progs/verifier_lsm_init_xattr.c

-- 
2.43.0


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

end of thread, other threads:[~2026-09-24 19:34 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-15 15:07 [PATCH bpf-next 0/8] BPF LSM xattrs at inode creation support Daniel Borkmann
2026-09-15 15:07 ` [PATCH bpf-next 1/8] ocfs2: Copy the xattr name in ocfs2_initxattrs Daniel Borkmann
2026-09-15 15:16   ` sashiko-bot
2026-09-15 16:26   ` bot+bpf-ci
2026-09-16  2:47   ` Heming Zhao
2026-09-16  7:07     ` Daniel Borkmann
2026-09-16  7:28       ` Heming Zhao
2026-09-16  7:28   ` Joseph Qi
2026-09-16  7:37     ` Daniel Borkmann
2026-09-16  7:49       ` Joseph Qi
2026-09-16  7:29   ` Heming Zhao
2026-09-15 15:07 ` [PATCH bpf-next 2/8] bpf, lsm: Reject writes into the BPF LSM program context Daniel Borkmann
2026-09-15 15:07 ` [PATCH bpf-next 3/8] bpf: Support passing context output arguments to kfuncs Daniel Borkmann
2026-09-15 15:07 ` [PATCH bpf-next 4/8] bpf, lsm: Let BPF LSM provide xattrs at inode creation Daniel Borkmann
2026-09-23 16:57   ` Paul Moore
2026-09-23 19:11     ` Daniel Borkmann
2026-09-23 20:51       ` Paul Moore
2026-09-23 19:14     ` David Windsor
2026-09-23 20:56       ` Paul Moore
2026-09-23 21:07       ` Paul Moore
2026-09-24 16:14       ` Justin Suess
2026-09-24 16:23         ` Paul Moore
2026-09-24 18:37           ` Justin Suess
2026-09-24 19:33             ` Paul Moore
2026-09-24 19:34               ` Paul Moore
2026-09-15 15:07 ` [PATCH bpf-next 5/8] bpf, lsm: Mark the BPF LSM hook overrides noinline Daniel Borkmann
2026-09-15 15:07 ` [PATCH bpf-next 6/8] selftests/bpf: Test that the BPF LSM context is read-only Daniel Borkmann
2026-09-15 15:07 ` [PATCH bpf-next 7/8] selftests/bpf: Add verifier tests for the __ctx_out plumbing Daniel Borkmann
2026-09-15 16:26   ` bot+bpf-ci
2026-09-15 15:07 ` [PATCH bpf-next 8/8] selftests/bpf: Add tests for BPF LSM inode init labelling Daniel Borkmann
2026-09-19 19:10 ` [PATCH bpf-next 0/8] BPF LSM xattrs at inode creation support patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox