From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 3F8153DFC93; Mon, 4 May 2026 14:26:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777904762; cv=none; b=ND96jV2oz+zjnMEqZzDKlZhyC/wbBc+2LX/OatMBf70DZGDIuRh8BgF3Jb2W0WyxkDGZzgB+r03haYaRE83IwJLJiWSbjmHBMYEC8EUqd2FEndaglYiCj8DQX3DWd57DXxXFS7n60ICO1Awfan2+6PsuG8k9gBctcfdCLDNjSRg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777904762; c=relaxed/simple; bh=z6U2JsyCQUKy/QdzUKB6Jw+m8Vc7Z6QgsbM7Hu+FtRg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=f6ALnnkU2AdrX3wKCJK5dK7dHN9aseYHBzwlb5i6TziawlP4n7Zi4GK3noZXQNqRTibQdku30nx2cUCogpq7Wki9k8gD4R6t2f4+R/AjoXAZnZwM+Jm7J82WSegWjG+QqNdpv1M9NQwce/7u/DJ7CeCei4Um+MwR6h/jZ+zelnw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=zFqky4Rp; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="zFqky4Rp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CC675C2BCB8; Mon, 4 May 2026 14:26:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777904762; bh=z6U2JsyCQUKy/QdzUKB6Jw+m8Vc7Z6QgsbM7Hu+FtRg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zFqky4Rp4E3h9TQmaDq0PX8slJMBkfmPQwoZoxQo/5tzVV863uLzqUw6qmSes/jer e/LWraixpnJHvYjQbVsFdRcP9fZCBRaHQlv0NbtKQMstuj38Eo1caBTgjYb31VjxQE t1rLu4m9dlOJ8CfeYyOKuwgV2z6Kk5JPlDK5i0sM= 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 6.12 137/215] ext4: fix missing brelse() in ext4_xattr_inode_dec_ref_all() Date: Mon, 4 May 2026 15:52:36 +0200 Message-ID: <20260504135135.158163803@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260504135130.169210693@linuxfoundation.org> References: <20260504135130.169210693@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 6.12-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 @@ -1165,7 +1165,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; @@ -1260,6 +1260,8 @@ ext4_xattr_inode_dec_ref_all(handle_t *h ext4_warning_inode(parent, "handle dirty metadata err=%d", err); } + + brelse(iloc.bh); } /*