From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB9C921ADC7; Sat, 30 May 2026 18:29:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780165793; cv=none; b=M1JuCiP+Vi7BIxfybKMp6OJJ/vQ3YitIRDgqlsN3BmxZXrCDuw8weDHDf24tQnXfe8VP1q4eBhehxDwkjx6wSAtc9K6e1EOLpIIr63WEUvd3VaAeYIZLs/sQFVlPS3W6kqGkZKPQuucIi7ZsmdRT6B1pL6YGnuCIwDlY5zTxirM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780165793; c=relaxed/simple; bh=+y0eA0GRTCphf8J5M+aqWXzbf5BzY9jIrzLWfXkQ/D4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YhT+lNw15U9hque6CZ3iuE94lYmbfYReNXdM3Suj+87j4ER7cAOyRNwgjpDX4V+vStInxNw4j+fs2vYWnr7odjOdCLomeNLSMiqRQ9yPOR54akIQxg2qaFMSk/g+6fOnAk03bz86nNie0FyFeytYxY4AcxHGE5pI7cKe6ICTZkU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=DHRtQa1s; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="DHRtQa1s" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 178051F00893; Sat, 30 May 2026 18:29:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780165792; bh=i+/rs5xxoeWAP4j4kczU8fqXX6zmyZJ1IdzN0sVjdpk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=DHRtQa1s3v0WOmVl7BNDFNC+5lm4tBWjnV67ogrpetp7w4EBLi2ZWQ69PKyRM4YXP nTJw6dajCP5u+mODOhsHk8/e0Iq9gUszjHPtHKbzceB7+imEqh2+2x/dvzjEKqX6Fq pu7nTgv5VakJ90p1kzbkd1xj38ICk/wNBTLxjqGE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sohei Koyama , Andreas Dilger , "Ritesh Harjani (IBM)" , Zhang Yi , Baokun Li , Theodore Tso Subject: [PATCH 5.10 184/589] ext4: fix missing brelse() in ext4_xattr_inode_dec_ref_all() Date: Sat, 30 May 2026 18:01:05 +0200 Message-ID: <20260530160229.725251015@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260530160224.570625122@linuxfoundation.org> References: <20260530160224.570625122@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sohei Koyama commit 77d059519382bd66283e6a4e83ee186e87e7708f upstream. 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 Reviewed-by: Andreas Dilger Reviewed-by: Ritesh Harjani (IBM) Cc: stable@vger.kernel.org Reviewed-by: Zhang Yi Reviewed-by: Baokun Li Link: https://patch.msgid.link/20260406074830.8480-1-skoyama@ddn.com Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman --- fs/ext4/xattr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c @@ -1108,7 +1108,7 @@ ext4_xattr_inode_dec_ref_all(handle_t *h { struct inode *ea_inode; struct ext4_xattr_entry *entry; - struct ext4_iloc iloc; + struct ext4_iloc iloc = { .bh = NULL }; bool dirty = false; unsigned int ea_ino; int err; @@ -1202,6 +1202,8 @@ ext4_xattr_inode_dec_ref_all(handle_t *h ext4_warning_inode(parent, "handle dirty metadata err=%d", err); } + + brelse(iloc.bh); } /*