Received: by 2002:a17:90a:9103:0:0:0:0 with SMTP id k3csp11793991pjo; Thu, 2 Jan 2020 14:23:31 -0800 (PST) X-Google-Smtp-Source: APXvYqwxvHyM/SvdoYRYNimlxEvQOIXtNEQ+w2aYzwBKp4EEG/0naLz7zZd3CUbtttIWo5AOIWIH X-Received: by 2002:a54:4595:: with SMTP id z21mr3160409oib.136.1578003811864; Thu, 02 Jan 2020 14:23:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578003811; cv=none; d=google.com; s=arc-20160816; b=HGI5Nu8YW/iy36vznY8n13bmc2qjvmgB/ULVduRe0h5DFXi9SlqwG0i16VN7VI+sra h6V74Al7U+55g0OFD53u1Gvb7+f15884PqT7arJPpRUXH9pAIoxTcy89m3vnrFvipGrV YtPue/skxSIBticGNOMunhG9byEUfUzXpYOIlDsEw+ITluQa4KsuvvibRheoWcHKDOJF vfpYwFx7ca0eYjMtuuRMQrVcDZAJetYweR8z/vMvt0CP9xwfdIF6aunQ65fPZocaaSdU NLJoqqE4w5OEYLwusQKa4H3jyAPY4ZPYbMD5WoPhWhky9trWB1nhnJ1z+ZgRAxQdE+Hg CURA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=HMibg2t+WK88dJxHCZPhA0MbV5el+5wJjQqTJcRY6Cw=; b=P6x2VuVn5+4Py6rPK5O2PjBO1h9maRXeViS0gT0CTr7qPhqRalZGZcWDRQhjmet3jk tz5eQh1OHiKN63LDBjggPFxLfuTFoh6VklS9YXnLa9KaNMX/PqqoSi4gxnOVLlmUQ9oc 18T77nT0tD8q3JYLDDyMzWNLsc8HF73lMlDnHCUp3R7OvTOcTnFR8DA7sOVh7R7MDv00 D7FRpP9ZAZvrJR1y8PsaJehfXsv7hhnqkU9jkQMrZga6fu1mr+aHgcKq0OCOL+9tlwrJ JayltrxuOHSuiHI6PleelgDxgFiK0NlOFt44zP0CBahObEFAXniWrlZoGj7bJBVwFtfa SGaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=szDIJgyA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q26si24294139oij.38.2020.01.02.14.23.20; Thu, 02 Jan 2020 14:23:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=szDIJgyA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728840AbgABWWo (ORCPT + 99 others); Thu, 2 Jan 2020 17:22:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:43482 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729165AbgABWWj (ORCPT ); Thu, 2 Jan 2020 17:22:39 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 04EE4222C3; Thu, 2 Jan 2020 22:22:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003759; bh=ibTZwRKS6VoVkzjX7po10SasPNuQ7+a9R/Nk96beczE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=szDIJgyA2O6KAVWEG43/9EJGNtCCBYufGqAcu4BaDol0WWjk1kznZscTVMaJ4ULD+ k3PFEDZx9r9h96wf+9hHn++uw+FcBpDl/0dwM77URS8YgoFSqxQvzSG0UBvPcZKfco 6jCSgybZw1gPAVVEHz8U/sqMm8bXFaFyq/ipwLVo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marco Oliverio , Rocco Folino , Florian Westphal , Pablo Neira Ayuso , Sasha Levin Subject: [PATCH 4.19 076/114] netfilter: nf_queue: enqueue skbs with NULL dst Date: Thu, 2 Jan 2020 23:07:28 +0100 Message-Id: <20200102220036.754351976@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102220029.183913184@linuxfoundation.org> References: <20200102220029.183913184@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marco Oliverio [ Upstream commit 0b9173f4688dfa7c5d723426be1d979c24ce3d51 ] Bridge packets that are forwarded have skb->dst == NULL and get dropped by the check introduced by b60a77386b1d4868f72f6353d35dabe5fbe981f2 (net: make skb_dst_force return true when dst is refcounted). To fix this we check skb_dst() before skb_dst_force(), so we don't drop skb packet with dst == NULL. This holds also for skb at the PRE_ROUTING hook so we remove the second check. Fixes: b60a77386b1d ("net: make skb_dst_force return true when dst is refcounted") Signed-off-by: Marco Oliverio Signed-off-by: Rocco Folino Acked-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- net/netfilter/nf_queue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netfilter/nf_queue.c b/net/netfilter/nf_queue.c index a96a8c16baf9..ee6d98355081 100644 --- a/net/netfilter/nf_queue.c +++ b/net/netfilter/nf_queue.c @@ -174,7 +174,7 @@ static int __nf_queue(struct sk_buff *skb, const struct nf_hook_state *state, goto err; } - if (!skb_dst_force(skb) && state->hook != NF_INET_PRE_ROUTING) { + if (skb_dst(skb) && !skb_dst_force(skb)) { status = -ENETDOWN; goto err; } -- 2.20.1