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. Signed-off-by: Andrey Albershteyn --- fs/file_attr.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fs/file_attr.c b/fs/file_attr.c index bfb00d256dd5..5424ec4e3949 100644 --- a/fs/file_attr.c +++ b/fs/file_attr.c @@ -246,6 +246,11 @@ static int fileattr_set_prepare(struct inode *inode, if (fa->fsx_cowextsize == 0) fa->fsx_xflags &= ~FS_XFLAG_COWEXTSIZE; + /* Can not enable DAX on fsverity file */ + if ((old_ma->fsx_xflags & FS_XFLAG_VERITY) && + fa->fsx_xflags & FS_XFLAG_DAX) + return -EINVAL; + return 0; } -- 2.54.0