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 719BDC83F1E for ; Mon, 28 Aug 2023 10:30:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231383AbjH1K3q (ORCPT ); Mon, 28 Aug 2023 06:29:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231365AbjH1K33 (ORCPT ); Mon, 28 Aug 2023 06:29:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1600AB for ; Mon, 28 Aug 2023 03:29:26 -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 5FBAF63C1D for ; Mon, 28 Aug 2023 10:29:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E5F8C433C8; Mon, 28 Aug 2023 10:29:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1693218565; bh=ddk0cAu4CDskoA0JDs1iFwbOL/KBQD0flRr1Nyf6rNo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T0Ut8FxYgzJEwHQdse0rEazlXkuCDCnaJzUCQnD9/8wu+KgKSA/VdlGFo2yANWcck VSY40Ii4IjnriTnJzJqj3CuOqPtdL62bmYYACQJxIT9ZJcQ3/bBhQkXF8c9qwEeKTI +nDY1AfWS0dxlQml412DAvv3xjx/SgLZoQjd0wgA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Vimal Agrawal , Florian Westphal , Vamsi Krishna Brahmajosyula Subject: [PATCH 4.19 123/129] netfilter: nf_queue: fix socket leak Date: Mon, 28 Aug 2023 12:13:37 +0200 Message-ID: <20230828101157.708846120@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230828101153.030066927@linuxfoundation.org> References: <20230828101153.030066927@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Vamsi Krishna Brahmajosyula Removal of the sock_hold got lost when backporting commit c3873070247d ("netfilter: nf_queue: fix possible use-after-free") to 4.19 Fixes: 34dc4a6a7f26 ("netfilter: nf_queue: fix possible use-after-free") in 4.19 Fixed in 4.14 with https://lore.kernel.org/all/20221024112958.115275475@linuxfoundation.org/ Signed-off-by: Vimal Agrawal Reviewed-by: Florian Westphal [vbrahmajosyula: The fix to the backport was missed in 4.19] Signed-off-by: Vamsi Krishna Brahmajosyula Signed-off-by: Greg Kroah-Hartman --- net/netfilter/nf_queue.c | 2 -- 1 file changed, 2 deletions(-) --- a/net/netfilter/nf_queue.c +++ b/net/netfilter/nf_queue.c @@ -93,8 +93,6 @@ bool nf_queue_entry_get_refs(struct nf_q 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;