<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/fs/file_attr.c, branch v6.18.22</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.18.22</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.18.22'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-03-19T15:08:09+00:00</updated>
<entry>
<title>fs: init flags_valid before calling vfs_fileattr_get</title>
<updated>2026-03-19T15:08:09+00:00</updated>
<author>
<name>Edward Adam Davis</name>
<email>eadavis@qq.com</email>
</author>
<published>2026-02-06T06:20:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=379e19e820dd1c6145426b97467728b3b89c0b42'/>
<id>urn:sha1:379e19e820dd1c6145426b97467728b3b89c0b42</id>
<content type='text'>
[ Upstream commit cb184dd19154fc486fa3d9e02afe70a97e54e055 ]

syzbot reported a uninit-value bug in [1].

Similar to the "*get" context where the kernel's internal file_kattr
structure is initialized before calling vfs_fileattr_get(), we should
use the same mechanism when using fa.

[1]
BUG: KMSAN: uninit-value in fuse_fileattr_get+0xeb4/0x1450 fs/fuse/ioctl.c:517
 fuse_fileattr_get+0xeb4/0x1450 fs/fuse/ioctl.c:517
 vfs_fileattr_get fs/file_attr.c:94 [inline]
 __do_sys_file_getattr fs/file_attr.c:416 [inline]

Local variable fa.i created at:
 __do_sys_file_getattr fs/file_attr.c:380 [inline]
 __se_sys_file_getattr+0x8c/0xbd0 fs/file_attr.c:372

Reported-by: syzbot+7c31755f2cea07838b0c@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=7c31755f2cea07838b0c
Tested-by: syzbot+7c31755f2cea07838b0c@syzkaller.appspotmail.com
Signed-off-by: Edward Adam Davis &lt;eadavis@qq.com&gt;
Link: https://patch.msgid.link/tencent_B6C4583771D76766D71362A368696EC3B605@qq.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: return EOPNOTSUPP from file_setattr/file_getattr syscalls</title>
<updated>2025-10-10T11:46:00+00:00</updated>
<author>
<name>Andrey Albershteyn</name>
<email>aalbersh@redhat.com</email>
</author>
<published>2025-10-08T12:44:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d90ad28e8aa482e397150e22f3762173d918a724'/>
<id>urn:sha1:d90ad28e8aa482e397150e22f3762173d918a724</id>
<content type='text'>
These syscalls call to vfs_fileattr_get/set functions which return
ENOIOCTLCMD if filesystem doesn't support setting file attribute on an
inode. For syscalls EOPNOTSUPP would be more appropriate return error.

Signed-off-by: Andrey Albershteyn &lt;aalbersh@kernel.org&gt;
Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
Reviewed-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
<entry>
<title>Revert "fs: make vfs_fileattr_[get|set] return -EOPNOTSUPP"</title>
<updated>2025-10-10T11:44:03+00:00</updated>
<author>
<name>Andrey Albershteyn</name>
<email>aalbersh@redhat.com</email>
</author>
<published>2025-10-08T12:44:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4dd5b5ac089bb6ea719b7ffb748707ac9cbce4e4'/>
<id>urn:sha1:4dd5b5ac089bb6ea719b7ffb748707ac9cbce4e4</id>
<content type='text'>
This reverts commit 474b155adf3927d2c944423045757b54aa1ca4de.

This patch caused regression in ioctl_setflags(). Underlying filesystems
use EOPNOTSUPP to indicate that flag is not supported. This error is
also gets converted in ioctl_setflags(). Therefore, for unsupported
flags error changed from EOPNOSUPP to ENOIOCTLCMD.

Link: https://lore.kernel.org/linux-xfs/a622643f-1585-40b0-9441-cf7ece176e83@kernel.org/
Signed-off-by: Andrey Albershteyn &lt;aalbersh@kernel.org&gt;
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
<entry>
<title>fs: tighten a sanity check in file_attr_to_fileattr()</title>
<updated>2025-07-16T08:22:01+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@linaro.org</email>
</author>
<published>2025-07-15T23:03:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e85931d1cd699307e6a3f1060cbe4c42748f3fff'/>
<id>urn:sha1:e85931d1cd699307e6a3f1060cbe4c42748f3fff</id>
<content type='text'>
The fattr-&gt;fa_xflags is a u64 that comes from the user.  This is a sanity
check to ensure that the users are only setting allowed flags.  The
problem is that it doesn't check the upper 32 bits.  It doesn't really
affect anything but for more flexibility in the future, we want to enforce
users zero out those bits.

Fixes: be7efb2d20d6 ("fs: introduce file_getattr and file_setattr syscalls")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@linaro.org&gt;
Link: https://lore.kernel.org/baf7b808-bcf2-4ac1-9313-882c91cc87b2@sabinyo.mountain
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
<entry>
<title>tree-wide: s/struct fileattr/struct file_kattr/g</title>
<updated>2025-07-04T14:14:39+00:00</updated>
<author>
<name>Christian Brauner</name>
<email>brauner@kernel.org</email>
</author>
<published>2025-07-03T07:36:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ca115d7e754691c0219eec95ec94dbac7f87daef'/>
<id>urn:sha1:ca115d7e754691c0219eec95ec94dbac7f87daef</id>
<content type='text'>
Now that we expose struct file_attr as our uapi struct rename all the
internal struct to struct file_kattr to clearly communicate that it is a
kernel internal struct. This is similar to struct mount_{k}attr and
others.

Link: https://lore.kernel.org/20250703-restlaufzeit-baurecht-9ed44552b481@brauner
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
<entry>
<title>fs: introduce file_getattr and file_setattr syscalls</title>
<updated>2025-07-02T15:05:17+00:00</updated>
<author>
<name>Andrey Albershteyn</name>
<email>aalbersh@redhat.com</email>
</author>
<published>2025-06-30T16:20:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=be7efb2d20d67f334a7de2aef77ae6c69367e646'/>
<id>urn:sha1:be7efb2d20d67f334a7de2aef77ae6c69367e646</id>
<content type='text'>
Introduce file_getattr() and file_setattr() syscalls to manipulate inode
extended attributes. The syscalls takes pair of file descriptor and
pathname. Then it operates on inode opened accroding to openat()
semantics. The struct file_attr is passed to obtain/change extended
attributes.

This is an alternative to FS_IOC_FSSETXATTR ioctl with a difference
that file don't need to be open as we can reference it with a path
instead of fd. By having this we can manipulated inode extended
attributes not only on regular files but also on special ones. This
is not possible with FS_IOC_FSSETXATTR ioctl as with special files
we can not call ioctl() directly on the filesystem inode using fd.

This patch adds two new syscalls which allows userspace to get/set
extended inode attributes on special files by using parent directory
and a path - *at() like syscall.

CC: linux-api@vger.kernel.org
CC: linux-fsdevel@vger.kernel.org
CC: linux-xfs@vger.kernel.org
Signed-off-by: Andrey Albershteyn &lt;aalbersh@kernel.org&gt;
Link: https://lore.kernel.org/20250630-xattrat-syscall-v6-6-c4e3bc35227b@kernel.org
Acked-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
<entry>
<title>fs: prepare for extending file_get/setattr()</title>
<updated>2025-07-02T12:29:15+00:00</updated>
<author>
<name>Amir Goldstein</name>
<email>amir73il@gmail.com</email>
</author>
<published>2025-06-30T16:20:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=276e136bff7edcdecc6e206c81594ef06aa40743'/>
<id>urn:sha1:276e136bff7edcdecc6e206c81594ef06aa40743</id>
<content type='text'>
We intend to add support for more xflags to selective filesystems and
We cannot rely on copy_struct_from_user() to detect this extension.

In preparation of extending the API, do not allow setting xflags unknown
by this kernel version.

Also do not pass the read-only flags and read-only field fsx_nextents to
filesystem.

These changes should not affect existing chattr programs that use the
ioctl to get fsxattr before setting the new values.

Link: https://lore.kernel.org/linux-fsdevel/20250216164029.20673-4-pali@kernel.org/
Cc: Pali Rohár &lt;pali@kernel.org&gt;
Cc: Andrey Albershteyn &lt;aalbersh@redhat.com&gt;
Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Andrey Albershteyn &lt;aalbersh@kernel.org&gt;
Link: https://lore.kernel.org/20250630-xattrat-syscall-v6-5-c4e3bc35227b@kernel.org
Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
<entry>
<title>fs: make vfs_fileattr_[get|set] return -EOPNOTSUPP</title>
<updated>2025-07-02T12:29:10+00:00</updated>
<author>
<name>Andrey Albershteyn</name>
<email>aalbersh@redhat.com</email>
</author>
<published>2025-06-30T16:20:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=474b155adf3927d2c944423045757b54aa1ca4de'/>
<id>urn:sha1:474b155adf3927d2c944423045757b54aa1ca4de</id>
<content type='text'>
Future patches will add new syscalls which use these functions. As
this interface won't be used for ioctls only, the EOPNOSUPP is more
appropriate return code.

This patch converts return code from ENOIOCTLCMD to EOPNOSUPP for
vfs_fileattr_get and vfs_fileattr_set. To save old behavior translate
EOPNOSUPP back for current users - overlayfs, encryptfs and fs/ioctl.c.

Signed-off-by: Andrey Albershteyn &lt;aalbersh@kernel.org&gt;
Link: https://lore.kernel.org/20250630-xattrat-syscall-v6-4-c4e3bc35227b@kernel.org
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
<entry>
<title>lsm: introduce new hooks for setting/getting inode fsxattr</title>
<updated>2025-07-01T20:44:29+00:00</updated>
<author>
<name>Andrey Albershteyn</name>
<email>aalbersh@redhat.com</email>
</author>
<published>2025-06-30T16:20:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=defdd02d783c6fa22d0005bdc238ccd9174faf20'/>
<id>urn:sha1:defdd02d783c6fa22d0005bdc238ccd9174faf20</id>
<content type='text'>
Introduce new hooks for setting and getting filesystem extended
attributes on inode (FS_IOC_FSGETXATTR).

Cc: selinux@vger.kernel.org
Cc: Paul Moore &lt;paul@paul-moore.com&gt;

Acked-by: Paul Moore &lt;paul@paul-moore.com&gt;
Signed-off-by: Andrey Albershteyn &lt;aalbersh@kernel.org&gt;
Link: https://lore.kernel.org/20250630-xattrat-syscall-v6-2-c4e3bc35227b@kernel.org
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
<entry>
<title>fs: split fileattr related helpers into separate file</title>
<updated>2025-07-01T20:44:22+00:00</updated>
<author>
<name>Andrey Albershteyn</name>
<email>aalbersh@kernel.org</email>
</author>
<published>2025-06-30T16:20:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2f952c9e8fe13c6ee15c05189f1f87c1a70b866c'/>
<id>urn:sha1:2f952c9e8fe13c6ee15c05189f1f87c1a70b866c</id>
<content type='text'>
This patch moves function related to file extended attributes
manipulations to separate file. Refactoring only.

Signed-off-by: Andrey Albershteyn &lt;aalbersh@kernel.org&gt;
Link: https://lore.kernel.org/20250630-xattrat-syscall-v6-1-c4e3bc35227b@kernel.org
Reviewed-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Reviewed-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
</feed>
