Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2222202iof; Tue, 7 Jun 2022 23:40:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy10jXb+/zgkaFlNkIHiIS6KtVBjGo7c8UK9lZK+GU1Cere+Uy1X/oa4ul03K0dHEFqWPyd X-Received: by 2002:a05:6a00:1307:b0:50d:b02e:11df with SMTP id j7-20020a056a00130700b0050db02e11dfmr33660582pfu.4.1654670418007; Tue, 07 Jun 2022 23:40:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654670418; cv=none; d=google.com; s=arc-20160816; b=JXlku3Stxg7XOYtj7WcDbcg5gYDyYnQRSFhq0sXiWizWCcH5L9dxis8Hsx31Tn/bFv vtpbCYNu1eWQ+nlkVLkqlCZ39HFUAC5hh9lX4TprP/8UrYrgX9tDiGkbA7ZfvhuksjQ3 FkAyNK1uaOnCBb/THDE0YHxxYtcKnsNdFFO+Oll8pSmrUHj8jcRJ+AqshAQOi7aMZ7m5 DKoUeQvU6tkP5viNNNBz2u+BjNPiz3j0Tg1BbUWvL0DJsC1sFCrwmywVTpEx9Fo5+gqR f/R8biBu6pDhRowNLCfe3CR9TykMnFIwkq2z/ziavBkMo/iqstoWsBfHc5w8cXgPtwfN jlTw== 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=2PPoXIOH0sn1jznsNM3AYzzRxUknXjRn8a7KIbuOlyQ=; b=Vq+xaJ/YMKwI5R68oxuGulaWuuFYV/NM8DQlWhtowte2gxdX5Udgwfhb6pz7/4SorC n9dagfUha1d9gxdj6uCfj0ttfEBr/a1K9Z2qb8e6bN27mIf1gyQxMHf8DOt+tImij+TN S1n4yseNoXkFiJskqf6lMdKKGkjrvWwf2CHJWP2VcTpZ9acB/QlzKM06E6H58na4L6yP kUS9Fd5gAQzplqTY9lTX8ciQY25qC/f/trtbPxmVRuiFotBLWE6By0RegRg+rQ3rUkR1 hKFsB7RrmWTPa3tsgBdlQMKyHhVOSt2NVtjt5C20G1MAAfOq0bYoZgxncCFRA9l5D5i4 w/uA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PAvfCbaI; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id w1-20020a170902d3c100b0016158ec5ac9si24845504plb.431.2022.06.07.23.40.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 23:40:17 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PAvfCbaI; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 60F10139032; Tue, 7 Jun 2022 23:01:56 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351194AbiFHCtm (ORCPT + 99 others); Tue, 7 Jun 2022 22:49:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1447800AbiFHCoG (ORCPT ); Tue, 7 Jun 2022 22:44:06 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAFA719CB5B; Tue, 7 Jun 2022 12:25:52 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 30ED460C7F; Tue, 7 Jun 2022 19:25:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3683FC385A2; Tue, 7 Jun 2022 19:25:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629951; bh=rkERNKpOfn6T0eA4c7TR4X0IcpRfjhKzKBjVLUtGSes=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PAvfCbaILws8Bt5nD8dHRbnB1DW56ZfyzlVVVaftzKLqYx0ZCAicGFNvppb++C/IH xKDXlBWmf4t5SI8oHMioxyd37VR5mbc3Ne04+28DmvVAkoVOr2rHdO7nyJ3ZQDo7+f zxEkMisvbUdSDLgruDOyoEsZ5+xiP2+KqnygPs6E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xiao Ni , Song Liu Subject: [PATCH 5.18 876/879] md: fix double free of io_acct_set bioset Date: Tue, 7 Jun 2022 19:06:34 +0200 Message-Id: <20220607165028.283893773@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 From: Xiao Ni commit 42b805af102471f53e3c7867b8c2b502ea4eef7e upstream. Now io_acct_set is alloc and free in personality. Remove the codes that free io_acct_set in md_free and md_stop. Fixes: 0c031fd37f69 (md: Move alloc/free acct bioset in to personality) Signed-off-by: Xiao Ni Signed-off-by: Song Liu Signed-off-by: Greg Kroah-Hartman --- drivers/md/md.c | 4 ---- 1 file changed, 4 deletions(-) --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -5598,8 +5598,6 @@ static void md_free(struct kobject *ko) bioset_exit(&mddev->bio_set); bioset_exit(&mddev->sync_set); - if (mddev->level != 1 && mddev->level != 10) - bioset_exit(&mddev->io_acct_set); kfree(mddev); } @@ -6286,8 +6284,6 @@ void md_stop(struct mddev *mddev) __md_stop(mddev); bioset_exit(&mddev->bio_set); bioset_exit(&mddev->sync_set); - if (mddev->level != 1 && mddev->level != 10) - bioset_exit(&mddev->io_acct_set); } EXPORT_SYMBOL_GPL(md_stop);