[PATCH v3 bpf-next 0/3] introduce new VFS based BPF kfuncs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



G'day!

The original cover letter providing background context and motivating
factors around the needs for these new VFS related BPF kfuncs
introduced within this patch series can be found here [0]. Please do
reference that if needed.

The changes contained within this version of the patch series mainly
came at the back of discussions held with Christian at LSFMMBPF
recently. In summary, the primary difference within this patch series
when compared to the last [1] is that I've reduced the number of VFS
related BPF kfuncs being introduced, housed them under fs/, and added
more selftests.

Changes since v2 [1]:

* All new VFS related BPF kfuncs now reside in fs/bpf_fs_kfuncs.c
  rather than kernel/trace/bpf_trace.c. This was something that was
  explicitly requested by Christian after discussing these new VFS
  related BPF kfuncs recently at LSFMMBPF.
  
* Dropped other initially proposed VFS related BPF kfuncs, including
  bpf_get_mm_exe_file(), bpf_get_task_fs_root(),
  bpf_get_task_fs_pwd(), and bpf_put_path().

* bpf_path_d_path() now makes use of __sz argument annotations such
  that the BPF verifier can enforce relevant size checks on the
  supplied buf that ends up being passed to d_path(). Relevant
  selftests have been added to assert __sz checking semantics are
  enforced.

[0] https://lore.kernel.org/bpf/cover.1708377880.git.mattbobrowski@xxxxxxxxxx/
[1] https://lore.kernel.org/bpf/cover.1709675979.git.mattbobrowski@xxxxxxxxxx/

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                            | 133 ++++++++++++
 .../testing/selftests/bpf/bpf_experimental.h  |  26 +++
 .../selftests/bpf/prog_tests/verifier.c       |   4 +
 .../selftests/bpf/progs/verifier_vfs_accept.c |  71 +++++++
 .../selftests/bpf/progs/verifier_vfs_reject.c | 196 ++++++++++++++++++
 6 files changed, 431 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

-- 
2.46.0.rc1.232.g9752f9e123-goog





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux