]> git.ipfire.org Git - thirdparty/linux.git/commit
fs: reset read-only fsflags together with xflags
authorAndrey Albershteyn <aalbersh@kernel.org>
Wed, 21 Jan 2026 19:36:43 +0000 (20:36 +0100)
committerChristian Brauner <brauner@kernel.org>
Fri, 23 Jan 2026 14:55:40 +0000 (15:55 +0100)
commit9396bfdacb5aa2bcb3d2242b0de527e7d4f8a3cd
treeca6921d64452ea901af92cbdc31d52333019a979
parentfc94368bcee555b2cc44c2f4e7c4fcbb50404cd3
fs: reset read-only fsflags together with xflags

While setting file attributes, the read-only flags are reset
for ->xflags, but not for ->flags if flag is shared between both. This
is fine for now as all read-only xflags don't overlap with flags.
However, for any read-only shared flag this will create inconsistency
between xflags and flags. The non-shared flag will be reset in
vfs_fileattr_set() to the current value, but shared one is past further
to ->fileattr_set.

Reported-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
Link: https://patch.msgid.link/20260121193645.3611716-1-aalbersh@kernel.org
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/file_attr.c