Re: [PATCH v6 bpf-next 3/4] bpf: add bpf_init_inode_xattr kfunc for atomic inode labeling
[email protected] Fri, 31 Jul 2026 00:04:10 +0000
| Newsgroups | org.kernel.vger.selinux,org.kernel.vger.bpf |
|---|---|
| Message-ID | <[email protected]> |
> Add bpf_init_inode_xattr() kfunc for BPF LSM programs to atomically set
> xattrs via the inode_init_security hook using security_lsmxattr_add().
> The hook now passes its xattr state as a single struct lsm_xattrs
> object, which the kfunc takes directly.
>=20
> This kfunc is only callable from inode_init_security; the verifier
> rejects attempts to call it elsewhere.
>=20
> A previous attempt [1] required a kmalloc string output protocol for
> the xattr name. Since commit 6bcdfd2cac55 ("security: Allow all LSMs to
> provide xattrs for inode_init_security hook") [2], the xattr name is no
> longer allocated; it is a static constant.
>=20
> Link: https://kernsec.org/pipermail/linux-security-module-archive/2022-Oc=
tober/034878.html [1]
> Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/=
commit/?id=3D6bcdfd2cac55 [2]
> Suggested-by: Song Liu <[email protected]>
> Signed-off-by: David Windsor <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
--=20
Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20260730234533.1912=
[email protected]?part=3D3