From patchwork Thu Oct 6 06:00:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengen Du X-Patchwork-Id: 1686663 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=DT3kBxGR; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MjjWH4ptDz23jM for ; Thu, 6 Oct 2022 18:19:54 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1ogLAP-0005ue-OL; Thu, 06 Oct 2022 07:19:37 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ogJvq-0000sQ-Cc for kernel-team@lists.ubuntu.com; Thu, 06 Oct 2022 06:00:30 +0000 Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 29DAA3F337 for ; Thu, 6 Oct 2022 06:00:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1665036030; bh=dlcML0W48R6aRgt+yTk7XMGy+yUY2lXAYx7/QwJEii8=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=DT3kBxGRFAiaE2v8EzxWVZEvLm27qoUReyU1peg/D+oXMv34ytAfVzy0gPprSxST7 GnmtjO403AvIbRKbdxM7R6sH7fHTbtWgIIBdhccSCQbFK98/yQR92BREDzPGiEXlr6 lNFYnaW1u8dxfQda1UP1qpGzMwXqmQQ3nzenDo0k3y1BFniAPhhQ+i3DnLuc+FsZew 0U8W9cOOtBSE9MHmAhRYNDRLx/uYfGfI5DlTqFwNkE+7flbJ6rPh28f7QQgDZU7Dve eqTRPJ8JjSusoi7u7eRN07isjR8qqa5Np5Z2zpsEoc6zg2exCZxV+jQ/9MT+6Jzn8k rUZATolRFtGoQ== Received: by mail-pj1-f71.google.com with SMTP id l23-20020a17090a071700b0020a8232ddb1so417805pjl.8 for ; Wed, 05 Oct 2022 23:00:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dlcML0W48R6aRgt+yTk7XMGy+yUY2lXAYx7/QwJEii8=; b=fx7S/uQOalG3o5deH5gA6M3LeUx88RaPOhApy+FLC4e/5evGLLV6z9/awzlVB1Mx2F 6NINLJLL7ygEbm77amnLyF3klU7xG7hiL1xB4hRMTk4+/0qLbrOPZHu2mFZ/BkqKsslm Jv+s+0odfxZuyuSLGnp4AlDQtaIfWNKJnAORBTLlLzkBdB7TvZzVPUw2yfCBwzYO12hM 6pOXCD8D8xPX0aCRtxzoubEXg4vP4XheStwjQUd2MYiBrMgUQAl9gkctCLKafD8CSKK8 sVHmRKA1Fe2bmMX5TKfkmuO7IoiROZyJ3sjCuUOj9crpMHpK/cwBsjhF6x5GArvxrfnf eQNA== X-Gm-Message-State: ACrzQf1WCE9u5qxp4/XqF8bwk7LkPZxNMtTe3DOXWfQWCY3t/u7TSUDV segOOonMnxPSqiGdbwhQOOUPMwQ3rGz1NbgUOe7gqXDGiBsOeWIwSIsSeh3AFg2vWUiDSVHdqK7 QfR9f09IIekeb7jos7h4Zufbqd62zZh305gWwdDR4Vw== X-Received: by 2002:a17:903:2289:b0:17f:6aeb:a47f with SMTP id b9-20020a170903228900b0017f6aeba47fmr2816125plh.48.1665036028271; Wed, 05 Oct 2022 23:00:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7h6ideuDBmGFnpJ8U1elmZ2nAyQGxIVEK82gmtmRRwTtE86lba7JFhcgj/Dzifj8iY4Sh9dg== X-Received: by 2002:a17:903:2289:b0:17f:6aeb:a47f with SMTP id b9-20020a170903228900b0017f6aeba47fmr2816091plh.48.1665036027809; Wed, 05 Oct 2022 23:00:27 -0700 (PDT) Received: from chengendu-Inspiron-3910.. (111-248-165-186.dynamic-ip.hinet.net. [111.248.165.186]) by smtp.gmail.com with ESMTPSA id f33-20020a17090a702400b0020647f279fbsm2080272pjk.29.2022.10.05.23.00.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Oct 2022 23:00:27 -0700 (PDT) From: Chengen Du To: kernel-team@lists.ubuntu.com Subject: [SRU][Bionic][PATCH 1/1] (upstream) netfilter: nf_queue: Fix memory leak in nf_queue_entry_get_refs Date: Thu, 6 Oct 2022 14:00:23 +0800 Message-Id: <20221006060023.27373-2-chengen.du@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221006060023.27373-1-chengen.du@canonical.com> References: <20221006060023.27373-1-chengen.du@canonical.com> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 06 Oct 2022 07:19:35 +0000 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: "Chengen Du" BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1991774 Remove sock_hold to align upstream commit c3873070247d9e3c7a6b0cf9bf9b45e8018427b1. Signed-off-by: Chengen Du Acked-by: Stefan Bader Acked-by: Thadeu Lima de Souza Cascardo --- net/netfilter/nf_queue.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/net/netfilter/nf_queue.c b/net/netfilter/nf_queue.c index dbc45165c533..46984cdee658 100644 --- a/net/netfilter/nf_queue.c +++ b/net/netfilter/nf_queue.c @@ -91,8 +91,6 @@ bool nf_queue_entry_get_refs(struct nf_queue_entry *entry) dev_hold(state->in); if (state->out) dev_hold(state->out); - if (state->sk) - sock_hold(state->sk); #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) if (entry->skb->nf_bridge) { struct net_device *physdev;