Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1684043pxb; Wed, 9 Feb 2022 02:07:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJyqV6ff1MaeUIAJWu5/c9R9ZUCKzrt8vyrVJulf3UJ7XnhU3DA0Wyo3mQjJ8gAvHJVJM4vT X-Received: by 2002:a17:902:b092:: with SMTP id p18mr1411584plr.30.1644401221348; Wed, 09 Feb 2022 02:07:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644401221; cv=none; d=google.com; s=arc-20160816; b=IbmSaEacc3DuXVBezOjAX5xrVaU+IPGuRM8fzBMHYncrg7rjdzYVsbNO2LPppoIHF/ iKHZCzWq3IFfl4U5Hb1lug4gS101JB9iHzBSlpeEeCw79k0w0Xnrg4VXraCFhlWpBrT6 OWqoBzO8fZ6eto2SZHc2N4Hbpb5/X70mlGlP3NRhGASLHjlfRx6yWk7KJoctraUNn5dr 4uesHoCKwGm7jvUnfZcvI+IdJ/efN3QGpHdW5H5YIICM7behpyGmKevRMdGzJsbRjIlY uETZvYcHAqF6BhXY7G77z5Yp7LQ6ao9NcNeoEnN9ZeRoQitNiqR5v67/vSkb7q7iZZQ2 VDgg== 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=+ju4nQgY2RZnFmUU4ATT5AkHM8D9Z19V0DM+TJpgxfM=; b=GBR59WkCdLjzFvmduS9ZAfowErIs3tdBI/RRQo1kKV4W41dVVTF5AivcPWt1ILEToo ICL7teL66vXRh/ep3nNIilVwKfVa8+gJylZurna5P5Ns3dnE8d3CYfPCGuA5jc+f4TW6 lGFSyXOvbDW7BFTyKwHS8mHOok0Pv8JCNnjTUDqqcNzjfQeJU3EfODUjPfpDacCek6rQ NrM/QezJXirR610+3W5rQak8orLuPy2OL6YuW16QQkee41CLHBL2/SBNZ6I/PiDrDicg BAlw3r7IeLefjzHuuVFyRY5HZdD5qcSZ4BMD20gaj+pZVXh8TC0Fhvzu52qMBpeIOLh9 flGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MvmIUapK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oa10si4887855pjb.146.2022.02.09.02.06.47; Wed, 09 Feb 2022 02:07:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MvmIUapK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1388989AbiBGLpw (ORCPT + 99 others); Mon, 7 Feb 2022 06:45:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1386113AbiBGLdj (ORCPT ); Mon, 7 Feb 2022 06:33:39 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 157DFC043181; Mon, 7 Feb 2022 03:33:38 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id CFE27B80EBD; Mon, 7 Feb 2022 11:33:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34DD8C004E1; Mon, 7 Feb 2022 11:33:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644233615; bh=56VyBmj+bRsCsk2a9Y/xPAhsRALIjjZvUHbCqINZASk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MvmIUapKyYuACRlhKOH9xvMDDUaXaS73G95dFiU6YUZORKE4rxbiOGo1luLjOFhhB glpG8qjrnblDpQ3ejMe+v/YDGAUEQL4xf755oMpw/tDfSIH6Lq3zr3cAGbWFqDDREA oPH2B8WPS6O8GxUAvqJdAXM2qqipS8q8twmlIDv8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Phil Sutter , Pablo Neira Ayuso Subject: [PATCH 5.16 068/126] netfilter: nft_reject_bridge: Fix for missing reply from prerouting Date: Mon, 7 Feb 2022 12:06:39 +0100 Message-Id: <20220207103806.467774635@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220207103804.053675072@linuxfoundation.org> References: <20220207103804.053675072@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=-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: Phil Sutter commit aeac4554eb549037ff2f719200c0a9c1c25e7eaa upstream. Prior to commit fa538f7cf05aa ("netfilter: nf_reject: add reject skbuff creation helpers"), nft_reject_bridge did not assign to nskb->dev before passing nskb on to br_forward(). The shared skbuff creation helpers introduced in above commit do which seems to confuse br_forward() as reject statements in prerouting hook won't emit a packet anymore. Fix this by simply passing NULL instead of 'dev' to the helpers - they use the pointer for just that assignment, nothing else. Fixes: fa538f7cf05aa ("netfilter: nf_reject: add reject skbuff creation helpers") Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- net/bridge/netfilter/nft_reject_bridge.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/net/bridge/netfilter/nft_reject_bridge.c +++ b/net/bridge/netfilter/nft_reject_bridge.c @@ -49,7 +49,7 @@ static void nft_reject_br_send_v4_tcp_re { struct sk_buff *nskb; - nskb = nf_reject_skb_v4_tcp_reset(net, oldskb, dev, hook); + nskb = nf_reject_skb_v4_tcp_reset(net, oldskb, NULL, hook); if (!nskb) return; @@ -65,7 +65,7 @@ static void nft_reject_br_send_v4_unreac { struct sk_buff *nskb; - nskb = nf_reject_skb_v4_unreach(net, oldskb, dev, hook, code); + nskb = nf_reject_skb_v4_unreach(net, oldskb, NULL, hook, code); if (!nskb) return; @@ -81,7 +81,7 @@ static void nft_reject_br_send_v6_tcp_re { struct sk_buff *nskb; - nskb = nf_reject_skb_v6_tcp_reset(net, oldskb, dev, hook); + nskb = nf_reject_skb_v6_tcp_reset(net, oldskb, NULL, hook); if (!nskb) return; @@ -98,7 +98,7 @@ static void nft_reject_br_send_v6_unreac { struct sk_buff *nskb; - nskb = nf_reject_skb_v6_unreach(net, oldskb, dev, hook, code); + nskb = nf_reject_skb_v6_unreach(net, oldskb, NULL, hook, code); if (!nskb) return;