Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3548002ybd; Fri, 28 Jun 2019 10:31:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqyhnvvQN3JAqlZLkH9ES1skPwOvj16Yp+Yf0Caan4Nq7dNcQZj5fGgHylfjvPsqoMf3tKMF X-Received: by 2002:a63:fa0d:: with SMTP id y13mr10313364pgh.258.1561743064726; Fri, 28 Jun 2019 10:31:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561743064; cv=none; d=google.com; s=arc-20160816; b=oaVIRPVsvR+WnbOE8I+OrYfekDl2YhhN7/Uz9VcZgs5N00Jbm/ocwsXv+2EjI5Xjo1 kTbSfVQvLt0TpU7rlZc3Tjh1S5Ek45vaJBAOyW6hingjBo1Vao/LFGhtRmo+4WQVsYFa XXs0eIyEiZV7EdwMkPXkKZM824OyMEes8yZXHjhg5GSmQSd2I1dokRJnkQce2N/gYThM 8yDgbT0Ua51rSKVyTsHkdszTYaPwU19r8clbWpj35kF5axeUN4oCx6I0DtK06yJ5JoMg b3IVZrC6LaxF4ajLtsusgSsohuJQP4Nc2hdbPZCW61S7W0ZasyeDGLF3KhNP9I+/7B4B /Lmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=hUK826yv98VtsDYkAX+3bX09d1M49sUzBe+VrlNvkR4=; b=N11LhajQz1J/bj+zoVpDpQMogTILOStk3HA1S+cUXGBN/EcKKuM++5QRWJaGzmV4+2 0RrO2QhaUFbS3qtuMZMlR4QgJHJ5OEnaONhjRzYzRgO3Xf5zWeEvd4tdJvI4aYpaTadP OgFqVwFVL8Xo/HZixXGiuNXi4dzPpUEZh4yUcQaWnnZ/TIJ1lcmSEz/ifYRbs04U6XGu uAREYpzaQ6vvYWvnaqXholmFjd4OJaLWZRxT92dBLVXJoReorjqYsQKJ8fWYon96SUco g2wM+hyIG/kpEII0eIAM/HkjapW2tRX+1yX/2n4n0ilx9jYwsJMVgoRB7vmAeCOX45Rr Btwg== ARC-Authentication-Results: i=1; mx.google.com; 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 z10si2491144pgv.233.2019.06.28.10.30.48; Fri, 28 Jun 2019 10:31:04 -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; 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 S1726834AbfF1Rab (ORCPT + 99 others); Fri, 28 Jun 2019 13:30:31 -0400 Received: from mail.us.es ([193.147.175.20]:49310 "EHLO mail.us.es" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726514AbfF1Raa (ORCPT ); Fri, 28 Jun 2019 13:30:30 -0400 Received: from antivirus1-rhel7.int (unknown [192.168.2.11]) by mail.us.es (Postfix) with ESMTP id C777119D8BF for ; Fri, 28 Jun 2019 19:30:28 +0200 (CEST) Received: from antivirus1-rhel7.int (localhost [127.0.0.1]) by antivirus1-rhel7.int (Postfix) with ESMTP id AE18C1021B2 for ; Fri, 28 Jun 2019 19:30:28 +0200 (CEST) Received: by antivirus1-rhel7.int (Postfix, from userid 99) id 8CEC54EDAF; Fri, 28 Jun 2019 19:30:28 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on antivirus1-rhel7.int X-Spam-Level: X-Spam-Status: No, score=-108.2 required=7.5 tests=ALL_TRUSTED,BAYES_50, SMTPAUTH_US2,USER_IN_WHITELIST autolearn=disabled version=3.4.1 Received: from antivirus1-rhel7.int (localhost [127.0.0.1]) by antivirus1-rhel7.int (Postfix) with ESMTP id 684BFA5B8; Fri, 28 Jun 2019 19:30:24 +0200 (CEST) Received: from 192.168.1.97 (192.168.1.97) by antivirus1-rhel7.int (F-Secure/fsigk_smtp/550/antivirus1-rhel7.int); Fri, 28 Jun 2019 19:30:24 +0200 (CEST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/antivirus1-rhel7.int) Received: from us.es (unknown [31.4.195.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: 1984lsi) by entrada.int (Postfix) with ESMTPSA id 282454265A2F; Fri, 28 Jun 2019 19:30:24 +0200 (CEST) Date: Fri, 28 Jun 2019 19:30:23 +0200 X-SMTPAUTHUS: auth mail.us.es From: Pablo Neira Ayuso To: zhe.he@windriver.com Cc: kadlec@blackhole.kfki.hu, fw@strlen.de, davem@davemloft.net, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] netfilter: Fix remainder of pseudo-header protocol 0 Message-ID: <20190628173023.f45mvwcdhnavnt42@salvia> References: <1561346258-272481-1-git-send-email-zhe.he@windriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1561346258-272481-1-git-send-email-zhe.he@windriver.com> User-Agent: NeoMutt/20170113 (1.7.2) X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 24, 2019 at 11:17:38AM +0800, zhe.he@windriver.com wrote: > From: He Zhe > > Since v5.1-rc1, some types of packets do not get unreachable reply with the > following iptables setting. Fox example, > > $ iptables -A INPUT -p icmp --icmp-type 8 -j REJECT > $ ping 127.0.0.1 -c 1 > PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data. > — 127.0.0.1 ping statistics — > 1 packets transmitted, 0 received, 100% packet loss, time 0ms > > We should have got the following reply from command line, but we did not. > From 127.0.0.1 icmp_seq=1 Destination Port Unreachable > > Yi Zhao reported it and narrowed it down to: > 7fc38225363d ("netfilter: reject: skip csum verification for protocols that don't support it"), > > This is because nf_ip_checksum still expects pseudo-header protocol type 0 for > packets that are of neither TCP or UDP, and thus ICMP packets are mistakenly > treated as TCP/UDP. > > This patch corrects the conditions in nf_ip_checksum and all other places that > still call it with protocol 0. Applied, thanks.