Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ext4: fix missing brelse() in ext4_xattr_inode_dec_ref_all()

The commit c8e008b60492 ("ext4: ignore xattrs past end")
introduced a refcount leak in when block_csum is false.

ext4_xattr_inode_dec_ref_all() calls ext4_get_inode_loc() to
get iloc.bh, but never releases it with brelse().

Fixes: c8e008b60492 ("ext4: ignore xattrs past end")
Signed-off-by: Sohei Koyama <skoyama@ddn.com>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Cc: stable@vger.kernel.org
Reviewed-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: Baokun Li <libaokun@linux.alibaba.com>
Link: https://patch.msgid.link/20260406074830.8480-1-skoyama@ddn.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>

authored by

Sohei Koyama and committed by
Theodore Ts'o
77d05951 22f53f08

+3 -1
+3 -1
fs/ext4/xattr.c
··· 1165 1165 { 1166 1166 struct inode *ea_inode; 1167 1167 struct ext4_xattr_entry *entry; 1168 - struct ext4_iloc iloc; 1168 + struct ext4_iloc iloc = { .bh = NULL }; 1169 1169 bool dirty = false; 1170 1170 unsigned int ea_ino; 1171 1171 int err; ··· 1260 1260 ext4_warning_inode(parent, 1261 1261 "handle dirty metadata err=%d", err); 1262 1262 } 1263 + 1264 + brelse(iloc.bh); 1263 1265 } 1264 1266 1265 1267 /*