<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/xattr.c, branch linux-6.15.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-06-27T10:13:30Z</updated>
<entry>
<title>fs/xattr.c: fix simple_xattr_list()</title>
<updated>2025-06-27T10:13:30Z</updated>
<author>
<name>Stephen Smalley</name>
</author>
<published>2025-06-05T16:51:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2faba6d932ca9c27e4e49ee650bb8f151a2e0948'/>
<id>urn:sha1:2faba6d932ca9c27e4e49ee650bb8f151a2e0948</id>
<content type='text'>
[ Upstream commit 800d0b9b6a8b1b354637b4194cc167ad1ce2bdd3 ]

commit 8b0ba61df5a1 ("fs/xattr.c: fix simple_xattr_list to always
include security.* xattrs") failed to reset err after the call to
security_inode_listsecurity(), which returns the length of the
returned xattr name. This results in simple_xattr_list() incorrectly
returning this length even if a POSIX acl is also set on the inode.

Reported-by: Collin Funk &lt;collin.funk1@gmail.com&gt;
Closes: https://lore.kernel.org/selinux/8734ceal7q.fsf@gmail.com/
Reported-by: Paul Eggert &lt;eggert@cs.ucla.edu&gt;
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2369561
Fixes: 8b0ba61df5a1 ("fs/xattr.c: fix simple_xattr_list to always include security.* xattrs")

Signed-off-by: Stephen Smalley &lt;stephen.smalley.work@gmail.com&gt;
Link: https://lore.kernel.org/20250605165116.2063-1-stephen.smalley.work@gmail.com
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>fs/xattr.c: fix simple_xattr_list to always include security.* xattrs</title>
<updated>2025-04-28T08:53:22Z</updated>
<author>
<name>Stephen Smalley</name>
</author>
<published>2025-04-24T15:28:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8b0ba61df5a1c44e2b3cf683831a4fc5e24ea99d'/>
<id>urn:sha1:8b0ba61df5a1c44e2b3cf683831a4fc5e24ea99d</id>
<content type='text'>
The vfs has long had a fallback to obtain the security.* xattrs from the
LSM when the filesystem does not implement its own listxattr, but
shmem/tmpfs and kernfs later gained their own xattr handlers to support
other xattrs. Unfortunately, as a side effect, tmpfs and kernfs-based
filesystems like sysfs no longer return the synthetic security.* xattr
names via listxattr unless they are explicitly set by userspace or
initially set upon inode creation after policy load. coreutils has
recently switched from unconditionally invoking getxattr for security.*
for ls -Z via libselinux to only doing so if listxattr returns the xattr
name, breaking ls -Z of such inodes.

Before:
$ getfattr -m.* /run/initramfs
&lt;no output&gt;
$ getfattr -m.* /sys/kernel/fscaps
&lt;no output&gt;
$ setfattr -n user.foo /run/initramfs
$ getfattr -m.* /run/initramfs
user.foo

After:
$ getfattr -m.* /run/initramfs
security.selinux
$ getfattr -m.* /sys/kernel/fscaps
security.selinux
$ setfattr -n user.foo /run/initramfs
$ getfattr -m.* /run/initramfs
security.selinux
user.foo

Link: https://lore.kernel.org/selinux/CAFqZXNtF8wDyQajPCdGn=iOawX4y77ph0EcfcqcUUj+T87FKyA@mail.gmail.com/
Link: https://lore.kernel.org/selinux/20250423175728.3185-2-stephen.smalley.work@gmail.com/
Signed-off-by: Stephen Smalley &lt;stephen.smalley.work@gmail.com&gt;
Link: https://lore.kernel.org/20250424152822.2719-1-stephen.smalley.work@gmail.com
Fixes: b09e0fa4b4ea66266058ee ("tmpfs: implement generic xattr support")
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
<entry>
<title>fs/xattr: Fix handling of AT_FDCWD in setxattrat(2) and getxattrat(2)</title>
<updated>2025-04-25T10:11:56Z</updated>
<author>
<name>Jan Kara</name>
</author>
<published>2025-04-24T13:22:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f520bed25d17bb31c2d2d72b0a785b593a4e3179'/>
<id>urn:sha1:f520bed25d17bb31c2d2d72b0a785b593a4e3179</id>
<content type='text'>
Currently, setxattrat(2) and getxattrat(2) are wrongly handling the
calls of the from setxattrat(AF_FDCWD, NULL, AT_EMPTY_PATH, ...) and
fail with -EBADF error instead of operating on CWD. Fix it.

Fixes: 6140be90ec70 ("fs/xattr: add *at family syscalls")
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Link: https://lore.kernel.org/20250424132246.16822-2-jack@suse.cz
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
<entry>
<title>xattr: remove redundant check on variable err</title>
<updated>2024-11-06T18:00:01Z</updated>
<author>
<name>Colin Ian King</name>
</author>
<published>2024-10-30T18:25:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=46a7fcec097da5b3188dce608362fe6bf4ea26ee'/>
<id>urn:sha1:46a7fcec097da5b3188dce608362fe6bf4ea26ee</id>
<content type='text'>
Curretly in function generic_listxattr the for_each_xattr_handler loop
checks err and will return out of the function if err is non-zero.
It's impossible for err to be non-zero at the end of the function where
err is checked again for a non-zero value. The final non-zero check is
therefore redundant and can be removed. Also move the declaration of
err into the loop.

Signed-off-by: Colin Ian King &lt;colin.i.king@gmail.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>fs/xattr: add *at family syscalls</title>
<updated>2024-11-06T17:59:44Z</updated>
<author>
<name>Christian Göttsche</name>
</author>
<published>2024-04-26T16:20:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6140be90ec70c39fa844741ca3cc807dd0866394'/>
<id>urn:sha1:6140be90ec70c39fa844741ca3cc807dd0866394</id>
<content type='text'>
Add the four syscalls setxattrat(), getxattrat(), listxattrat() and
removexattrat().  Those can be used to operate on extended attributes,
especially security related ones, either relative to a pinned directory
or on a file descriptor without read access, avoiding a
/proc/&lt;pid&gt;/fd/&lt;fd&gt; detour, requiring a mounted procfs.

One use case will be setfiles(8) setting SELinux file contexts
("security.selinux") without race conditions and without a file
descriptor opened with read access requiring SELinux read permission.

Use the do_{name}at() pattern from fs/open.c.

Pass the value of the extended attribute, its length, and for
setxattrat(2) the command (XATTR_CREATE or XATTR_REPLACE) via an added
struct xattr_args to not exceed six syscall arguments and not
merging the AT_* and XATTR_* flags.

[AV: fixes by Christian Brauner folded in, the entire thing rebased on
top of {filename,file}_...xattr() primitives, treatment of empty
pathnames regularized.  As the result, AT_EMPTY_PATH+NULL handling
is cheap, so f...(2) can use it]

Signed-off-by: Christian Göttsche &lt;cgzones@googlemail.com&gt;
Link: https://lore.kernel.org/r/20240426162042.191916-1-cgoettsche@seltendoof.de
Reviewed-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Reviewed-by: Christian Brauner &lt;brauner@kernel.org&gt;
CC: x86@kernel.org
CC: linux-alpha@vger.kernel.org
CC: linux-kernel@vger.kernel.org
CC: linux-arm-kernel@lists.infradead.org
CC: linux-ia64@vger.kernel.org
CC: linux-m68k@lists.linux-m68k.org
CC: linux-mips@vger.kernel.org
CC: linux-parisc@vger.kernel.org
CC: linuxppc-dev@lists.ozlabs.org
CC: linux-s390@vger.kernel.org
CC: linux-sh@vger.kernel.org
CC: sparclinux@vger.kernel.org
CC: linux-fsdevel@vger.kernel.org
CC: audit@vger.kernel.org
CC: linux-arch@vger.kernel.org
CC: linux-api@vger.kernel.org
CC: linux-security-module@vger.kernel.org
CC: selinux@vger.kernel.org
[brauner: slight tweaks]
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>new helpers: file_removexattr(), filename_removexattr()</title>
<updated>2024-11-06T17:59:39Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2024-09-30T19:21:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=22a4d1954cf5d51d5aa82eccb0b5fd4d8be92551'/>
<id>urn:sha1:22a4d1954cf5d51d5aa82eccb0b5fd4d8be92551</id>
<content type='text'>
switch path_removexattrat() and fremovexattr(2) to those

Reviewed-by: Christian Brauner &lt;brauner@kernel.org&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>new helpers: file_listxattr(), filename_listxattr()</title>
<updated>2024-11-06T17:59:39Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2024-09-26T21:53:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=60ad149cf395ff0a502976963d9a89c2f5dfe424'/>
<id>urn:sha1:60ad149cf395ff0a502976963d9a89c2f5dfe424</id>
<content type='text'>
switch path_listxattr() and flistxattr(2) to those

Reviewed-by: Christian Brauner &lt;brauner@kernel.org&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>replace do_getxattr() with saner helpers.</title>
<updated>2024-11-06T17:59:39Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2024-09-26T21:07:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0158005aaa3c946ecac9d251c34708a40a85cbe1'/>
<id>urn:sha1:0158005aaa3c946ecac9d251c34708a40a85cbe1</id>
<content type='text'>
similar to do_setxattr() in the previous commit...

Reviewed-by: Christian Brauner &lt;brauner@kernel.org&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>replace do_setxattr() with saner helpers.</title>
<updated>2024-11-06T17:59:39Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2024-09-26T03:57:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=66d7ac6bdb07fbe69ca6971558a996ac04bbb643'/>
<id>urn:sha1:66d7ac6bdb07fbe69ca6971558a996ac04bbb643</id>
<content type='text'>
io_uring setxattr logics duplicates stuff from fs/xattr.c; provide
saner helpers (filename_setxattr() and file_setxattr() resp.) and
use them.

NB: putname(ERR_PTR()) is a no-op

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>new helper: import_xattr_name()</title>
<updated>2024-11-06T17:59:39Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2024-09-26T18:11:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a10c4c5e01bdab617eaf3aaac9a96c22ddefa97e'/>
<id>urn:sha1:a10c4c5e01bdab617eaf3aaac9a96c22ddefa97e</id>
<content type='text'>
common logics for marshalling xattr names.

Reviewed-by: Christian Brauner &lt;brauner@kernel.org&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
</feed>
