linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/2] bpf: Add more dentry kfuncs for BPF LSM programs
@ 2025-09-24 23:24 David Windsor
  2025-09-24 23:24 ` [PATCH bpf-next 1/2] bpf: Add " David Windsor
  2025-09-24 23:24 ` [PATCH bpf-next 2/2] selftests/bpf: Add tests for dentry kfuncs David Windsor
  0 siblings, 2 replies; 10+ messages in thread
From: David Windsor @ 2025-09-24 23:24 UTC (permalink / raw)
  To: bpf
  Cc: ast, daniel, andrii, martin.lau, song, kpsingh, john.fastabend,
	viro, brauner, jack, dwindsor, linux-fsdevel

BPF LSM programs often need to perform path-based access control and
security monitoring that requires walking filesystem structures. Currently,
BPF programs can access basic file information but lack the ability to
safely navigate dentry relationships or perform reference-counted
operations on filesystem objects.

This series extends the existing collection of filesystem kfuncs by adding
dentry-specific operations that enable BPF LSM programs to:

1. Safely acquire and release dentry references (bpf_dget/bpf_dput)
2. Navigate parent-child relationships (bpf_dget_parent)
3. Find dentry aliases for inodes (bpf_d_find_alias)
4. Access trusted dentry/vfsmount pointers from files
   (bpf_file_dentry/bpf_file_vfsmount)

David Windsor (2):
  bpf: Add dentry kfuncs for BPF LSM programs
  selftests/bpf: Add tests for dentry kfuncs

 fs/bpf_fs_kfuncs.c                            | 104 ++++++++++++++++++
 .../selftests/bpf/prog_tests/dentry_lsm.c     |  48 ++++++++
 .../testing/selftests/bpf/progs/dentry_lsm.c  |  51 +++++++++
 3 files changed, 203 insertions(+)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/dentry_lsm.c
 create mode 100644 tools/testing/selftests/bpf/progs/dentry_lsm.c

-- 
2.43.0


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

end of thread, other threads:[~2025-09-29  8:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-24 23:24 [PATCH bpf-next 0/2] bpf: Add more dentry kfuncs for BPF LSM programs David Windsor
2025-09-24 23:24 ` [PATCH bpf-next 1/2] bpf: Add " David Windsor
2025-09-24 23:55   ` Al Viro
2025-09-25  0:08     ` David Windsor
2025-09-25  0:29       ` Al Viro
2025-09-25  0:44         ` David Windsor
2025-09-25  0:47           ` Al Viro
2025-09-25  0:56             ` David Windsor
2025-09-29  8:24     ` Christian Brauner
2025-09-24 23:24 ` [PATCH bpf-next 2/2] selftests/bpf: Add tests for dentry kfuncs David Windsor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).