mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
fsverity: don't allow setting DAX file attribute on fsverity files
When fsverity is enabled on the file, with FS_IOC_ENABLE_VERITY ioctl(), it checks if file has DAX enabled and fails if that's true. However, the opposite case is not checked. Note, that the only other filesystem supporting DAX and fsverity is ext4, and ext4 does check for this case. Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> Reviewed-by: Eric Biggers <ebiggers@kernel.org> Link: https://patch.msgid.link/20261002223705.2175542-6-aalbersh@kernel.org Signed-off-by: Eric Biggers <ebiggers@kernel.org>
This commit is contained in:
parent
9e74c01463
commit
85cdd23fca
|
|
@ -235,10 +235,15 @@ static int fileattr_set_prepare(struct inode *inode,
|
|||
/*
|
||||
* It is only valid to set the DAX flag on regular files and
|
||||
* directories on filesystems.
|
||||
*
|
||||
* DAX and fsverity are incompatible.
|
||||
*/
|
||||
if ((fa->fsx_xflags & FS_XFLAG_DAX) &&
|
||||
!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode)))
|
||||
return -EINVAL;
|
||||
if (fa->fsx_xflags & FS_XFLAG_DAX) {
|
||||
if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode)))
|
||||
return -EINVAL;
|
||||
if (old_ma->fsx_xflags & FS_XFLAG_VERITY)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Extent size hints of zero turn off the flags. */
|
||||
if (fa->fsx_extsize == 0)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user