]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bpf: fs/xattr: Add BPF kfuncs to set and remove xattrs
authorSong Liu <song@kernel.org>
Thu, 30 Jan 2025 21:35:48 +0000 (13:35 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 14 Feb 2025 03:35:32 +0000 (19:35 -0800)
commit56467292794b800164df20c076c409ac548e56ec
treeee680ae2fc50f2c0cf1e8a06d77dcf8319ba477a
parent7587d735b150bc593c812615bbd232980418eea3
bpf: fs/xattr: Add BPF kfuncs to set and remove xattrs

Add the following kfuncs to set and remove xattrs from BPF programs:

  bpf_set_dentry_xattr
  bpf_remove_dentry_xattr
  bpf_set_dentry_xattr_locked
  bpf_remove_dentry_xattr_locked

The _locked version of these kfuncs are called from hooks where
dentry->d_inode is already locked. Instead of requiring the user
to know which version of the kfuncs to use, the verifier will pick
the proper kfunc based on the calling hook.

Signed-off-by: Song Liu <song@kernel.org>
Acked-by: Christian Brauner <brauner@kernel.org>
Reviewed-by: Matt Bobrowski <mattbobrowski@google.com>
Link: https://lore.kernel.org/r/20250130213549.3353349-5-song@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
fs/bpf_fs_kfuncs.c
include/linux/bpf_lsm.h
kernel/bpf/verifier.c