projects/linux·commit d250bdf5

ext4: fix iloc.bh leak in ext4_xattr_inode_update_ref

d250bdf5 · Yang Erkun <[email protected]> · 2025-12-13 13:57:06 +08:00

The error branch for ext4_xattr_inode_update_ref forget to release the
refcount for iloc.bh. Find this when review code.

Fixes: 57295e835408 ("ext4: guard against EA inode refcount underflow in xattr update")
Signed-off-by: Yang Erkun <[email protected]>
Reviewed-by: Baokun Li <[email protected]>
Reviewed-by: Zhang Yi <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Theodore Ts'o <[email protected]>
Cc: [email protected]
Commit
d250bdf531d9cd4096fedbb9f172bb2ca660c868
Parents
0ef7ef42

Changes

1 files changed · +1 −0

FileStatusAddDelContent
fs/ext4/xattr.cmodified+1−0View file

fs/ext4/xattr.c

View file
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
index 2e02efb..4ed8ddf 100644
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
@@ -1037,6 +1037,7 @@ static int ext4_xattr_inode_update_ref(handle_t *handle, struct inode *ea_inode,
ext4_error_inode(ea_inode, __func__, __LINE__, 0,
"EA inode %lu ref wraparound: ref_count=%lld ref_change=%d",
ea_inode->i_ino, ref_count, ref_change);
+ brelse(iloc.bh);
ret = -EFSCORRUPTED;
goto out;
}