[GIT PULL 09/14 for v6.17] vfs bpf

From: Christian Brauner
Date: Fri Jul 25 2025 - 07:28:11 EST


Hey Linus,

/* Summary */
These changes allow bpf to read extended attributes from cgroupfs.
This is useful in redirecting AF_UNIX socket connections based on cgroup
membership of the socket. One use-case is the ability to implement log
namespaces in systemd so services and containers are redirected to
different journals.

Please note that I plan on merging bpf changes related to the vfs
exclusively via vfs trees.

/* Testing */

gcc (Debian 14.2.0-19) 14.2.0
Debian clang version 19.1.7 (3)

No build failures or warnings were observed.

/* Conflicts */

Merge conflicts with mainline
=============================

No known conflicts.

Merge conflicts with other trees
================================

No known conflicts.

The following changes since commit 19272b37aa4f83ca52bdf9c16d5d81bdd1354494:

Linux 6.16-rc1 (2025-06-08 13:44:43 -0700)

are available in the Git repository at:

git@xxxxxxxxxxxxxxxxxxx:pub/scm/linux/kernel/git/vfs/vfs tags/vfs-6.17-rc1.bpf

for you to fetch changes up to 70619d40e8307b4b2ce1d08405e7b827c61ba4a8:

selftests/kernfs: test xattr retrieval (2025-07-02 14:18:22 +0200)

Please consider pulling these changes from the signed vfs-6.17-rc1.bpf tag.

Thanks!
Christian

----------------------------------------------------------------
vfs-6.17-rc1.bpf

----------------------------------------------------------------
Christian Brauner (3):
kernfs: remove iattr_mutex
Merge patch series "Introduce bpf_cgroup_read_xattr"
selftests/kernfs: test xattr retrieval

Song Liu (3):
bpf: Introduce bpf_cgroup_read_xattr to read xattr of cgroup's node
bpf: Mark cgroup_subsys_state->cgroup RCU safe
selftests/bpf: Add tests for bpf_cgroup_read_xattr

fs/bpf_fs_kfuncs.c | 34 +++++
fs/kernfs/inode.c | 70 ++++-----
kernel/bpf/helpers.c | 3 +
kernel/bpf/verifier.c | 5 +
tools/testing/selftests/bpf/bpf_experimental.h | 3 +
.../selftests/bpf/prog_tests/cgroup_xattr.c | 145 +++++++++++++++++++
.../selftests/bpf/progs/cgroup_read_xattr.c | 158 +++++++++++++++++++++
.../selftests/bpf/progs/read_cgroupfs_xattr.c | 60 ++++++++
tools/testing/selftests/filesystems/.gitignore | 1 +
tools/testing/selftests/filesystems/Makefile | 2 +-
tools/testing/selftests/filesystems/kernfs_test.c | 38 +++++
11 files changed, 486 insertions(+), 33 deletions(-)
create mode 100644 tools/testing/selftests/bpf/prog_tests/cgroup_xattr.c
create mode 100644 tools/testing/selftests/bpf/progs/cgroup_read_xattr.c
create mode 100644 tools/testing/selftests/bpf/progs/read_cgroupfs_xattr.c
create mode 100644 tools/testing/selftests/filesystems/kernfs_test.c