Skip to content

bpf: Add more dentry kfuncs for BPF LSM programs

David Windsor bpf linux-fsdevel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2bpf: Add dentry kfuncs for BPF LSM programsfs/bpf_fs_kfuncs.c+104 -07 replies
2/2selftests/bpf: Add tests for dentry kfuncstools/testing/selftests/bpf/prog_tests/dentry_lsm.c tools/testing/selftests/bpf/progs/dentry_lsm.c+99 -00 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by.

PatchAl Viro
1/2NAKed-by
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH bpf-next 0/2] bpf: Add more dentry kfuncs for BPF LSM programs

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
Signature · 1 line
2.43.0