From patchwork Mon Oct 24 11:27:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9714 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp545314wru; Mon, 24 Oct 2022 09:34:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7s+xmhqQCCP5ITGA64cmmdS2DJkKMAn1kulz5q6I+aZFKwKHgVS85Z4moCa3Y7L3zV0IWE X-Received: by 2002:a17:907:2d0b:b0:78e:674:6b32 with SMTP id gs11-20020a1709072d0b00b0078e06746b32mr27899375ejc.226.1666629249816; Mon, 24 Oct 2022 09:34:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666629249; cv=none; d=google.com; s=arc-20160816; b=Qwea7Z9xIWeg8AZyMhWRHvr/grHdOhOJiOznD7R1rb8G89XmFpU0WGB3j0N12+yv4M lPs0wBNOesdIZwGdGpcGGJiQSNEICXnyHxLdGBgNnHOc9K/EOXv2m1m2LHeRnmtbLq9l DVg88/lXv+W3yPguKcNzZqkRMseuX1wNP2REu6s/I+wXlLLIylzUw7KWlfhRGoGyHJil oRJIp1mfWU+cXnA0ModBG6tA2NA6Q5f59/3YjrQvv/fHPr7dd99xYDLqwJNfjEEP5sYd NaONko0szznqYVzSeAoydg/FaLcbThJHLRQoI/7FFF7LCgYVFoDORpV2PuIAmKcqQ2o9 hKaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=J+VM+zBZxb3Vn8CGSa1yNCzIUpKgdkvXVHvjiENLezo=; b=mNIIdPHwx17JAZ0dmuRfyTD0xOxf45/khGHA4x2rgOnire3EDWuFMknzO1WwkG/oUm d9twTzaN3wbuBZisoCtLyJpm5ZKZ7w7XZUhjxnbjA4ycDiasYZaaTZrDZ13j4rAR6vSe /r94U8FzblqjXjyvbFPuQVp1nHLNcuMv22XcEVACu32KYQ026A9y9TDCBGh7aL5/jitm a6PzXH9ME+scQPGAtkEZKy2EBcFlrQyDeHfj6w1CeM/vhFEiSlDvbyeCKKhjXp5qRX6A 4OWrR9Tp3F6MPWJPYSaHrIihYcQen3WRdzer7Z0118K4LGx1f3B4rrzc72MQnSErZbqW 88cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="vGlaruj/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a18-20020a056402169200b0045c9904fdafsi173632edv.74.2022.10.24.09.33.45; Mon, 24 Oct 2022 09:34:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="vGlaruj/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233022AbiJXQUQ (ORCPT + 99 others); Mon, 24 Oct 2022 12:20:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234257AbiJXQRf (ORCPT ); Mon, 24 Oct 2022 12:17:35 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0739538A29; Mon, 24 Oct 2022 08:04:17 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 06819B8162C; Mon, 24 Oct 2022 12:18:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 64B9EC433D6; Mon, 24 Oct 2022 12:18:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613905; bh=uVz+BDY/wMcdakK3a2zAGCIAkzkiJQgDSwU4vNQtw5o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vGlaruj/hGXKrkl3SQXIDjL8QikNrnJdtzuac1oMml+4Bt08Lx7+E4OsUprKH+Me0 p/GrwQElybSWCKwtis3GjcCIcP+sD3Ms2SIZvAGxefeIvKqPREHt+fqERyRuDMrAdF rYz/cxJNS2sgyrSQ7c5MNthwsGQ+Zju8D1MzwrjM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, stable@kernel.org, Ye Bin , Jan Kara , Theodore Tso Subject: [PATCH 5.10 059/390] jbd2: add miss release buffer head in fc_do_one_pass() Date: Mon, 24 Oct 2022 13:27:36 +0200 Message-Id: <20221024113025.158258028@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747587432092352472?= X-GMAIL-MSGID: =?utf-8?q?1747587432092352472?= From: Ye Bin commit dfff66f30f66b9524b661f311bbed8ff3d2ca49f upstream. In fc_do_one_pass() miss release buffer head after use which will lead to reference count leak. Cc: stable@kernel.org Signed-off-by: Ye Bin Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220917093805.1782845-1-yebin10@huawei.com Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman --- fs/jbd2/recovery.c | 1 + 1 file changed, 1 insertion(+) --- a/fs/jbd2/recovery.c +++ b/fs/jbd2/recovery.c @@ -256,6 +256,7 @@ static int fc_do_one_pass(journal_t *jou err = journal->j_fc_replay_callback(journal, bh, pass, next_fc_block - journal->j_fc_first, expected_commit_id); + brelse(bh); next_fc_block++; if (err < 0 || err == JBD2_FC_REPLAY_STOP) break;