Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp470569yba; Wed, 15 May 2019 04:42:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqxZLw7jK5EXeQ3lhwWEa2UFpP32T9aUmLS3fwo5xzEN0iWbVjyNm/7ACLAVKqHKQRVJ1Uej X-Received: by 2002:a65:6559:: with SMTP id a25mr19738203pgw.33.1557920545100; Wed, 15 May 2019 04:42:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557920545; cv=none; d=google.com; s=arc-20160816; b=YdgUr9QrN2Ac7b/oq4OABRFIudLAtAZy8wVzSylfF9aqSaPuoKZHtESA1HaOZDTn9w e9xzH2gbCvo8F6ivcyuKrpPLBTdAmyeSlmXDfJ/40Rt9K/aBKoBhdRSlyou5mnCbaj9h NtKNtN+UnlLoYhRop8K2LEcyUkQojdzA0gZOxzHhvgo+KrJbyYlh7qt34kjq/rqhsKoW gTipZ3U8Fbq5LPKxKXmp7yzJSEaFlkWqVtYvlRSZaSIbtxtK+dWqm40/BYvslz0WUBdx CIaKHt4/mWzkP11W+3WHXia6ojheziha5VZl/11bCxGZddlyhihkDMPHDDi5lqdnjqE3 Axwg== 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=zSKb2U61K2hveaYnhCvrPtFBLFzG7ZYaPALj96QwbYo=; b=kkihUA/Z6uDhyMCS3AyOJ622tw8VzWKUlIY1TUYjMuij6cB77ITmyFUcfqx8RXrRVL 4OD+JdBO0l9rAOb4DZ0ZdZSbMrAnDz7Z1g5L0BVz3cEALU86wLYdz9kdSR7Uas1NLVQ8 XoWbd6ISbt6aNsvwzSEBoVtO4ESadhsIrqclMOO18OH9NyWvmDgpAeoW4PO9YowURF8v DMW9hMBJdkY1H+FTjOMmwaD7V12rVGECfBrAmvBf8qcb3QvZK4WvPSmGcOrqjeNtiYNN 3+LZYyW43TkByVonf9oa9g/WH7YsnscDSoB6UERYpH/44O0BWziBroHi4aXcHHgpltQW K/Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=scnzcXYe; 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 n6si1546723plk.237.2019.05.15.04.42.10; Wed, 15 May 2019 04:42:25 -0700 (PDT) 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=scnzcXYe; 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 S1731854AbfEOLiy (ORCPT + 99 others); Wed, 15 May 2019 07:38:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:42362 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732777AbfEOLao (ORCPT ); Wed, 15 May 2019 07:30:44 -0400 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 DFFC920843; Wed, 15 May 2019 11:30:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557919844; bh=cCpzihbvXaaWTGpByLsxynU8DRIq2Yq+Ki/HH3TdJGw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=scnzcXYecBbUggojG1lCmaCA9QgI5it1rSfcirOymveqoRcYyoOsZVYGXB/TB19u/ 3dLHYIideyKAAbngZ5APWA0jBHnCCmB22lqMBQ5tfi7hv/+xj6P12bsvozRBxW16Tb rKqfBDGLNpaOYLvt+gs/rB0lZfcHI1PX5y4/K66Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Florian Westphal , Andrei Vagin , Pablo Neira Ayuso , Sasha Levin Subject: [PATCH 5.0 078/137] netfilter: fix nf_l4proto_log_invalid to log invalid packets Date: Wed, 15 May 2019 12:55:59 +0200 Message-Id: <20190515090659.109923422@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090651.633556783@linuxfoundation.org> References: <20190515090651.633556783@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 [ Upstream commit d48668052b2603b6262459625c86108c493588dd ] It doesn't log a packet if sysctl_log_invalid isn't equal to protonum OR sysctl_log_invalid isn't equal to IPPROTO_RAW. This sentence is always true. I believe we need to replace OR to AND. Cc: Florian Westphal Fixes: c4f3db1595827 ("netfilter: conntrack: add and use nf_l4proto_log_invalid") Signed-off-by: Andrei Vagin Acked-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- net/netfilter/nf_conntrack_proto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netfilter/nf_conntrack_proto.c b/net/netfilter/nf_conntrack_proto.c index 859f5d07a9159..78361e462e802 100644 --- a/net/netfilter/nf_conntrack_proto.c +++ b/net/netfilter/nf_conntrack_proto.c @@ -86,7 +86,7 @@ void nf_l4proto_log_invalid(const struct sk_buff *skb, struct va_format vaf; va_list args; - if (net->ct.sysctl_log_invalid != protonum || + if (net->ct.sysctl_log_invalid != protonum && net->ct.sysctl_log_invalid != IPPROTO_RAW) return; -- 2.20.1