summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorAndrey Albershteyn <aalbersh@kernel.org>2026-01-26 12:56:57 +0100
committerChristian Brauner <brauner@kernel.org>2026-01-29 16:00:57 +0100
commit0e6b7eae1fded85f94a357d6132f07d64c614cfa (patch)
tree35df86a6c9cfb181de95e2da604215e89b268f42 /fs
parent40210c2b11a873ff64a812c2d2600f529f01a83e (diff)
fs: add FS_XFLAG_VERITY for fs-verity files
fs-verity introduced inode flag for inodes with enabled fs-verity on them. This patch adds FS_XFLAG_VERITY file attribute which can be retrieved with FS_IOC_FSGETXATTR ioctl() and file_getattr() syscall. This flag is read-only and can not be set with corresponding set ioctl() and file_setattr(). The FS_IOC_SETFLAGS requires file to be opened for writing which is not allowed for verity files. The FS_IOC_FSSETXATTR and file_setattr() clears this flag from the user input. As this is now common flag for both flag interfaces (flags/xflags) add it to overlapping flags list to exclude it from overwrite. Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org> Link: https://patch.msgid.link/20260126115658.27656-2-aalbersh@kernel.org Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/file_attr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/file_attr.c b/fs/file_attr.c
index f3704881c126..dfde87401817 100644
--- a/fs/file_attr.c
+++ b/fs/file_attr.c
@@ -36,6 +36,8 @@ void fileattr_fill_xflags(struct file_kattr *fa, u32 xflags)
fa->flags |= FS_DAX_FL;
if (fa->fsx_xflags & FS_XFLAG_PROJINHERIT)
fa->flags |= FS_PROJINHERIT_FL;
+ if (fa->fsx_xflags & FS_XFLAG_VERITY)
+ fa->flags |= FS_VERITY_FL;
}
EXPORT_SYMBOL(fileattr_fill_xflags);
@@ -66,6 +68,8 @@ void fileattr_fill_flags(struct file_kattr *fa, u32 flags)
fa->fsx_xflags |= FS_XFLAG_DAX;
if (fa->flags & FS_PROJINHERIT_FL)
fa->fsx_xflags |= FS_XFLAG_PROJINHERIT;
+ if (fa->flags & FS_VERITY_FL)
+ fa->fsx_xflags |= FS_XFLAG_VERITY;
}
EXPORT_SYMBOL(fileattr_fill_flags);