Skip to contentSkip to conversation

xfs: Fix assert failure in xfs_setattr_size()

PATCH In review Yumei Huang 4 participants 4 messages Jan 15, 2021 – Jan 20, 2021 1 message not in the archive XFS filesystem

lore
Share & tools
lore
#1 lore raw

PATCH 1/1 xfs: Fix assert failure in xfs_setattr_size()

In reply to a message not in the archive

An assert failure is triggered by syzkaller test due to ATTR_KILL_PRIV is not cleared before xfs_setattr_size. As ATTR_KILL_PRIV is not checked/used by xfs_setattr_size, just remove it from the assert.

---
 fs/xfs/xfs_iops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_iops.c +1 -1
index 67c8dc9..f1e21b6 100644
@@ -846,7 +846,7 @@
         ASSERT(xfs_isilocked(ip, XFS_MMAPLOCK_EXCL));
         ASSERT(S_ISREG(inode->i_mode));
         ASSERT((iattr->ia_valid & (ATTR_UID|ATTR_GID|ATTR_ATIME|ATTR_ATIME_SET|
-                ATTR_MTIME_SET|ATTR_KILL_PRIV|ATTR_TIMES_SET)) == 0);
+                ATTR_MTIME_SET|ATTR_TIMES_SET)) == 0);
 
         oldsize = inode->i_size;
         newsize = iattr->ia_size;
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#2 lore raw
Quoted 7 lines · Yumei Huang

An assert failure is triggered by syzkaller test due to ATTR_KILL_PRIV is not cleared before xfs_setattr_size. As ATTR_KILL_PRIV is not checked/used by xfs_setattr_size, just remove it from the assert.

---

LGTM. Thanks for the patch.

Quoted 19 lines
 fs/xfs/xfs_iops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_iops.c +1 -1
index 67c8dc9..f1e21b6 100644
@@ -846,7 +846,7 @@
         ASSERT(xfs_isilocked(ip, XFS_MMAPLOCK_EXCL));
         ASSERT(S_ISREG(inode->i_mode));
         ASSERT((iattr->ia_valid & (ATTR_UID|ATTR_GID|ATTR_ATIME|ATTR_ATIME_SET|
-                ATTR_MTIME_SET|ATTR_KILL_PRIV|ATTR_TIMES_SET)) == 0);
+                ATTR_MTIME_SET|ATTR_TIMES_SET)) == 0);
 
         oldsize = inode->i_size;
         newsize = iattr->ia_size;
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#4 lore raw
In reply to Yumei Huang
Quoted 6 lines · Yumei Huang

An assert failure is triggered by syzkaller test due to ATTR_KILL_PRIV is not cleared before xfs_setattr_size. As ATTR_KILL_PRIV is not checked/used by xfs_setattr_size, just remove it from the assert.

Looks ok,

--D

Quoted 20 lines
---
 fs/xfs/xfs_iops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_iops.c +1 -1
index 67c8dc9..f1e21b6 100644
@@ -846,7 +846,7 @@
         ASSERT(xfs_isilocked(ip, XFS_MMAPLOCK_EXCL));
         ASSERT(S_ISREG(inode->i_mode));
         ASSERT((iattr->ia_valid & (ATTR_UID|ATTR_GID|ATTR_ATIME|ATTR_ATIME_SET|
-                ATTR_MTIME_SET|ATTR_KILL_PRIV|ATTR_TIMES_SET)) == 0);
+                ATTR_MTIME_SET|ATTR_TIMES_SET)) == 0);
 
         oldsize = inode->i_size;
         newsize = iattr->ia_size;
Signature · 1 line
1.8.3.1