Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1697842pxb; Wed, 9 Feb 2022 02:29:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJySsN47gK8CMBKqj8GUMLoLxFLX2uxY8duB3d2STNzkyTJN51g19rI8VsLblDGTX/ZePgM6 X-Received: by 2002:a63:9812:: with SMTP id q18mr1342483pgd.446.1644402571418; Wed, 09 Feb 2022 02:29:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644402571; cv=none; d=google.com; s=arc-20160816; b=tSvz0AxdFHetD8opkVmS0D8Ze7JtL2X8UjQLggEZFEQ3vtqqxJ7v8B1EF1CufyHL0n xzbSwWVNh6Uzl7MRgDU6dwyx2oCT1NxY+C/cgk2mBrJJBARZuMEGAUUxNidxoAKMBnpL OTWb87mBjUfDUPAnq+AUR9hPbmcksYfNqJi1ekKrARMM24Ts0UeHeSjEJRPoXFEJ1IFy KLwBhTCm4wZnS9oXXQeaFUYKXkgBYX4qKVFXsmMiOoUaby6osCOVslyHcVNyi7G/ELCE l0t7u9D+xqhmVojIN8tM9aRdFheoWUudiULPd5wueF39z/7AVwHedsb+s0ze1sCh0mYh d7SA== 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=sC5H8UL7728PVsd4nUH24yt62SDcuWwjmtlBczD/GraS6FgUummH2R8ji4RGlApplf 8QSEZgjUCbsrWU8yZ9fvh41nfI4/mcbwje11ufeMM7hCI+zznVtfdzV+pIYkcREv//4k HDWEViv6JNhqxAY3HM/ZVMEoVSqdfSvucEhrGCqwT6JorBGP5/qj0xVdPzTCUEmVB26W LDo4lwD/bFK/4Ay1EcNGKm+eT8jzHs+rEMTv5j47VmVzG8SjmVA+3/7xFsSowE/n+G69 L2/CKbQPzEPfk2F2IJ81CwMWG0h5zHTkcfl09I7aeeKtAhm+gDw62nOpO6l23H4EuIUR VSmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bcArg6rw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id pj11si4949305pjb.36.2022.02.09.02.29.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 02:29:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bcArg6rw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4EBFDE0A0E8E; Wed, 9 Feb 2022 01:21:26 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1387906AbiBGLmI (ORCPT + 99 others); Mon, 7 Feb 2022 06:42:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382505AbiBGL3U (ORCPT ); Mon, 7 Feb 2022 06:29:20 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EE4EC02B67B; Mon, 7 Feb 2022 03:27:25 -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 6F41AB80EC3; Mon, 7 Feb 2022 11:27:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 923AEC004E1; Mon, 7 Feb 2022 11:27:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644233231; bh=56VyBmj+bRsCsk2a9Y/xPAhsRALIjjZvUHbCqINZASk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bcArg6rwo0MAB5WA775Z+fi7A+BZzpIy5w/vLgyqn+6RvhFabP0W9tgb8FMOn95i7 gVu/yhpXVjC52E8QkOOWNtMZmuwjkGKaK48KfiBnHxJ+rWPM8MjDYIGvCGjBclQK1m 1WsInLAxGlCOPfmOTH5UmWNQotX+JcsO80BTNOcc= 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.15 059/110] netfilter: nft_reject_bridge: Fix for missing reply from prerouting Date: Mon, 7 Feb 2022 12:06:32 +0100 Message-Id: <20220207103804.278465638@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220207103802.280120990@linuxfoundation.org> References: <20220207103802.280120990@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=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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;