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 5BFCB17BA2; Tue, 16 Dec 2025 12:38:31 +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=1765888711; cv=none; b=MQCdpfd1iZ/+4/JyE67GRpSoTMr7ezq8r29Vr3w9X3lJAc3oG0PykpWJ4JnTFiAuynkCYE9er4gwaM0Fb3CDrGv2llQGHJvlrmAZgw1J6rg4+hLQ7zktYnlfiqA1DHgAvQx26k6ARP/z4jI5UVxRWNpRNaeCgVZB+PLN4ZINo8U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765888711; c=relaxed/simple; bh=N80jDzvewwjLOHS3XdNKGUYv8RqlVy5lO1TQ8DhuCWA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=V2YkqLT1fnf6g+VHIQnsZ651xTAzxYO2y7hD2nkDOL4XWgab8YMNX94dFt+NyDuyW3D8mckyuMlVTDqtnEgTeyPwar+XE8L0SdWpQZeWbB6A+oNJY5CTNNx38gemDN1hYRz+L8/P3OO4JrpoB4AjKDIQ1YpWUMbGp2H+Hs1d7tg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=CMQ3asj8; 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="CMQ3asj8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D68FC4CEF5; Tue, 16 Dec 2025 12:38:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765888711; bh=N80jDzvewwjLOHS3XdNKGUYv8RqlVy5lO1TQ8DhuCWA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CMQ3asj8vsAxnw5YWTYCgWb1fRlt67l0Qh/4B93u+gZwTMLMTw++06uojrfbVwkhm lL5oPjZz9iOEz0kacwc9A1l8kVw1JZU8zc/E6yQMYFrRCVmCViK3/tUMkxq0uhuN4z WiIMQpnNr0UlF2sDE44kvV7gAT7rEiahbo0rrCtU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Dmitry Antipov , syzbot+cfc7cab3bb6eaa7c4de2@syzkaller.appspotmail.com, Heming Zhao , Joseph Qi , Mark Fasheh , Joel Becker , Junxiao Bi , Changwei Ge , Jun Piao , Andrew Morton , Sasha Levin Subject: [PATCH 6.18 599/614] ocfs2: fix memory leak in ocfs2_merge_rec_left() Date: Tue, 16 Dec 2025 12:16:06 +0100 Message-ID: <20251216111423.096049260@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251216111401.280873349@linuxfoundation.org> References: <20251216111401.280873349@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dmitry Antipov [ Upstream commit 2214ec4bf89d0fd27717322d3983a2f3b469c7f3 ] In 'ocfs2_merge_rec_left()', do not reset 'left_path' to NULL after move, thus allowing 'ocfs2_free_path()' to free it before return. Link: https://lkml.kernel.org/r/20251205065159.392749-1-dmantipov@yandex.ru Fixes: 677b975282e4 ("ocfs2: Add support for cross extent block") Signed-off-by: Dmitry Antipov Reported-by: syzbot+cfc7cab3bb6eaa7c4de2@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=cfc7cab3bb6eaa7c4de2 Reviewed-by: Heming Zhao Acked-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Cc: Jun Piao Signed-off-by: Andrew Morton Signed-off-by: Sasha Levin --- fs/ocfs2/alloc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index 162711cc5b201..a0ced11e0c24a 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c @@ -3654,7 +3654,6 @@ static int ocfs2_merge_rec_left(struct ocfs2_path *right_path, * So we use the new rightmost path. */ ocfs2_mv_path(right_path, left_path); - left_path = NULL; } else ocfs2_complete_edge_insert(handle, left_path, right_path, subtree_index); -- 2.51.0