From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3385EEB64D7 for ; Mon, 26 Jun 2023 18:25:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232033AbjFZSZe (ORCPT ); Mon, 26 Jun 2023 14:25:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232035AbjFZSZR (ORCPT ); Mon, 26 Jun 2023 14:25:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 862482974 for ; Mon, 26 Jun 2023 11:24:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9F7FF60F4D for ; Mon, 26 Jun 2023 18:23:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A97BAC433C9; Mon, 26 Jun 2023 18:23:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1687803839; bh=wNkBY1az243WiHCcVzdWlQDF8CSoO1SrrEccfHheBdo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SrPY1+VBELGgzPqEkP3hgtIxVZHE17HjYecSOH+5bxozbfMvKBR3QZPRHDLHJhqWl iPhPHH224oX8btvGtjaZrCjAV4gEOQo3dYkdQL48oOM60OkxbeaOp5c0yHQaGhcxZU OujFvNxQwGpSoDIza7wd77oAdcnLDHYVefreH5Gs= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Pablo Neira Ayuso Subject: [PATCH 6.3 195/199] netfilter: nf_tables: drop module reference after updating chain Date: Mon, 26 Jun 2023 20:11:41 +0200 Message-ID: <20230626180814.298714943@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230626180805.643662628@linuxfoundation.org> References: <20230626180805.643662628@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Pablo Neira Ayuso commit 043d2acf57227db1fdaaa620b2a420acfaa56d6e upstream. Otherwise the module reference counter is leaked. Fixes b9703ed44ffb ("netfilter: nf_tables: support for adding new devices to an existing netdev chain") Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- net/netfilter/nf_tables_api.c | 2 ++ 1 file changed, 2 insertions(+) --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -2664,6 +2664,8 @@ static int nf_tables_updchain(struct nft nft_trans_basechain(trans) = basechain; INIT_LIST_HEAD(&nft_trans_chain_hooks(trans)); list_splice(&hook.list, &nft_trans_chain_hooks(trans)); + if (nla[NFTA_CHAIN_HOOK]) + module_put(hook.type->owner); nft_trans_commit_list_add_tail(ctx->net, trans);