Skip to content

bpf: introduce new VFS based BPF kfuncs

Matt Bobrowski bpf linux-fsdevel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest3 patches 2 repliesIn review
  2. v33 patches 19 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3bpf: introduce new VFS based BPF kfuncsfs/Makefile fs/bpf_fs_kfuncs.c+128 -02 replies
2/3selftests/bpf: add negative tests for new VFS based BPF kfuncstools/testing/selftests/bpf/bpf_experimental.h tools/testing/selftests/bpf/prog_tests/verifier.c tools/testing/selftests/bpf/progs/verifier_vfs_reject.c+189 -00 replies
3/3selftests/bpf: add positive tests for new VFS based BPF kfuncstools/testing/selftests/bpf/prog_tests/verifier.c tools/testing/selftests/bpf/progs/verifier_vfs_accept.c+87 -00 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchChristian BraunerSong Liu
1/3A-b A-b
2/3A-b A-b
3/3A-b A-b

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

Read the v4 thread

Cover letter [PATCH v4 bpf-next 0/3] bpf: introduce new VFS based BPF kfuncs

G'day!

A respin based off v3, which can be found here [0]. Original motivations for introducing this suite of BPF kfuncs can be found here [1].

The primary difference in this version of the patch series is that the suite of VFS related BPF kfuncs added can be used from both sleepable and non-sleepable BPF LSM program types. IOW, the KF_SLEEPABLE annotation has been removed from all of them.

Changes sinve v3:

* KF_SLEEPABLE annotation has been dropped from all newly introduced VFS related BPF kfuncs. This includes bpf_get_task_exe_file(), bpf_put_file(), and bpf_path_d_path(). Both negative and positive selftests backing these new BPF kfuncs have also been updated accordingly.

* buf__sz conditional in bpf_path_d_path() has been updated from buf__sz <= 0, to !buf__sz.

* Syntax issues as reported so here [2] have been corrected.

[0] https://lore.kernel.org/bpf/[email protected]/
[1] https://lore.kernel.org/bpf/[email protected]/#t
[2] https://netdev.bots.linux.dev/static/nipa/874023/13742510/checkpatch/stdout

Matt Bobrowski (3):
bpf: introduce new VFS based BPF kfuncs selftests/bpf: add negative tests for new VFS based BPF kfuncs selftests/bpf: add positive tests for new VFS based BPF kfuncs

 fs/Makefile                                   |   1 +
 fs/bpf_fs_kfuncs.c                            | 127 ++++++++++++++
 .../testing/selftests/bpf/bpf_experimental.h  |  26 +++
 .../selftests/bpf/prog_tests/verifier.c       |   4 +
 .../selftests/bpf/progs/verifier_vfs_accept.c |  85 +++++++++
 .../selftests/bpf/progs/verifier_vfs_reject.c | 161 ++++++++++++++++++
 6 files changed, 404 insertions(+)
 create mode 100644 fs/bpf_fs_kfuncs.c
 create mode 100644 tools/testing/selftests/bpf/progs/verifier_vfs_accept.c
 create mode 100644 tools/testing/selftests/bpf/progs/verifier_vfs_reject.c
Signature · 1 line
2.46.0.rc2.264.g509ed76dc8-goog