Re: [syzbot] [ext4?] WARNING in ext4_xattr_inode_update_ref (2)
From: Lizhi Xu
Date: Mon Nov 03 2025 - 02:50:10 EST
#syz test
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
index ce7253b3f549..b7860b96e8bb 100644
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
@@ -1041,6 +1041,13 @@ static int ext4_xattr_inode_update_ref(handle_t *handle, struct inode *ea_inode,
goto out;
}
ref_count += ref_change;
+ if (overflows_type(ref_count, u64)) {
+ ext4_error_inode(ea_inode, __func__, __LINE__, 0,
+ "EA inode %lu ref overflows: ref_count=%lld ref_change=%d",
+ ea_inode->i_ino, ref_count, ref_change);
+ ret = -EFSCORRUPTED;
+ goto out;
+ }
ext4_xattr_inode_set_ref(ea_inode, ref_count);
if (ref_change > 0) {