]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/xattr: test xattrs on various socket families
authorChristian Brauner <brauner@kernel.org>
Mon, 16 Feb 2026 13:32:10 +0000 (14:32 +0100)
committerChristian Brauner <brauner@kernel.org>
Mon, 2 Mar 2026 10:06:43 +0000 (11:06 +0100)
commit0f1f4e4e1503e605f2189bfa10290d7b8920187c
tree337031c82c583f1e4b6d29ee72bf9fea921eb0a9
parent0e75aea0b52dc8918fed4db40b035b2ef2cded40
selftests/xattr: test xattrs on various socket families

Test user.* xattr operations on sockets from different address families:
AF_INET, AF_INET6, AF_NETLINK, and AF_PACKET. All socket types use
sockfs for their inodes, so user.* xattrs should work regardless of
address family.

Each fixture creates a socket (no bind needed) and verifies the full
fsetxattr/fgetxattr/flistxattr/fremovexattr cycle. AF_INET6 skips if
not supported; AF_PACKET skips if CAP_NET_RAW is unavailable.

Also tests abstract namespace AF_UNIX sockets, which live in sockfs
(not on a filesystem) and should support user.* xattrs.

Link: https://patch.msgid.link/20260216-work-xattr-socket-v1-14-c2efa4f74cb7@kernel.org
Acked-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
tools/testing/selftests/filesystems/xattr/.gitignore
tools/testing/selftests/filesystems/xattr/Makefile
tools/testing/selftests/filesystems/xattr/xattr_socket_types_test.c [new file with mode: 0644]