Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3294105rwa; Tue, 23 Aug 2022 02:09:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR443WMcBzGGvL2T+6bmCKtV8iDzJA0qmtTBzuiop5KpB1Tooa+LeqUNrnmyEZ1RZFdXg6IM X-Received: by 2002:a05:6402:329:b0:446:3137:b4fd with SMTP id q9-20020a056402032900b004463137b4fdmr2900883edw.426.1661245778383; Tue, 23 Aug 2022 02:09:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661245778; cv=none; d=google.com; s=arc-20160816; b=AlB/1gbU9iky2smCeMQ2ydyj/nJ0NKzi5s74xa5X5YoUdqNalH0+o+OH6ramPK9nOD djieo/qZgkVmxZb9Lp7tpF1wHK33ruCUFlLTGf8HJGIxxxgB3ZFQOAQ30nw+cycMK0rr fcU2s5S3Ket0rlmXeg7MLKFtCLGw1FJY3Vbjt2nVecbyoehJ79hFgWfnWd7I0+fT9NSA VcqeXzEoop0lINVSicYe+B9KBOX5scQVnXLt46axD2DwRVgr3PJgbk8PauBsJPibClMx sWGhFXO7bo0E946zGOxAuqf31LOCpXrI+wctJ5a8hF0XeMiYa6RUAl5DnIU8OQJlJAmQ 5KYA== 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=cd1KZUv70PG7Z8mqU8qpb0oDdCkc/6mAodOyC3/lYPI=; b=MJ6YZgo9tEC8X3x1No8WjP7Sm8FKg/oOaYu6NwV8xUH5sK9fmhEWzU4vU2FAxyK/9W jY/tFNaamxJEW5F4syLkg6Mv0xdIESBVzItb62F+I0bcBEDnI+azKIwEyqNnqUWusq+Q sqXDVabENmYIO35CuA1wyZZsA+dLtc/jbGeYPWek7jsu74l867wGd7rpWIBKx0BM3XQ2 SsQOG7XrCcI5PVg7/yZBWPS2xHb/RhwCyVJJAQb3HWFqQ/sKv9ZD9j3WTIrnrMHyp2+l c6R2yxMd011PiBLAasiY6hJvzQdxN5NxoRXVyK7kJSzPpiLrjPmPtABGzpm0yv3seYaA KVlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LMVgb3pm; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o5-20020a170906974500b00734bc147380si12910098ejy.52.2022.08.23.02.09.11; Tue, 23 Aug 2022 02:09:38 -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=LMVgb3pm; 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 S1347539AbiHWJCQ (ORCPT + 99 others); Tue, 23 Aug 2022 05:02:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240444AbiHWJBn (ORCPT ); Tue, 23 Aug 2022 05:01:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA8D383054; Tue, 23 Aug 2022 01:28:07 -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 2C2F361494; Tue, 23 Aug 2022 08:27:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF6D1C433C1; Tue, 23 Aug 2022 08:27:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661243233; bh=PTSYZ9FApOOBJKtWbi9ijKt7DTtB+H8+ux8d997unJk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LMVgb3pmmyU449SVqw4vMLqnBwy4N8fzyfacpxoJPVkPKUpcnT9Cyu2m14SIDFWz4 m5l99GuDD9guNRVUDXaY8wIJaDQgDUBPF5HmELwyHfW8LxPmzvV9bqGjNGhdPtmMaM KWEqewzTNkVClF4vAywVomBdDS2fAf8n84F7JfpE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhengchao Shao , Nikolay Aleksandrov , Jakub Kicinski Subject: [PATCH 5.19 212/365] net: rtnetlink: fix module reference count leak issue in rtnetlink_rcv_msg Date: Tue, 23 Aug 2022 10:01:53 +0200 Message-Id: <20220823080127.075499596@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080118.128342613@linuxfoundation.org> References: <20220823080118.128342613@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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,T_SCC_BODY_TEXT_LINE 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 From: Zhengchao Shao commit 5b22f62724a0a09e00d301abf5b57b0c12be8a16 upstream. When bulk delete command is received in the rtnetlink_rcv_msg function, if bulk delete is not supported, module_put is not called to release the reference counting. As a result, module reference count is leaked. Fixes: a6cec0bcd342 ("net: rtnetlink: add bulk delete support flag") Signed-off-by: Zhengchao Shao Acked-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20220815024629.240367-1-shaozhengchao@huawei.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/core/rtnetlink.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index ac45328607f7..4b5b15c684ed 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -6070,6 +6070,7 @@ static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, if (kind == RTNL_KIND_DEL && (nlh->nlmsg_flags & NLM_F_BULK) && !(flags & RTNL_FLAG_BULK_DEL_SUPPORTED)) { NL_SET_ERR_MSG(extack, "Bulk delete is not supported"); + module_put(owner); goto err_unlock; } -- 2.37.2