Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4853423pjb; Mon, 27 Jul 2020 06:53:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygE38VTLc463LjV6NnM0v1qQ1UgzBVamfsRRy2WfOCSCGKAiQfSNdEofkIADHq9NueFDSC X-Received: by 2002:a17:906:6412:: with SMTP id d18mr3738982ejm.473.1595858024389; Mon, 27 Jul 2020 06:53:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595858024; cv=none; d=google.com; s=arc-20160816; b=dJNJry+/zk0bLlfasx358XYT4XXwAXPAEQEAe929IA134Mu37k7lt4Da2WSz+OEH3s Fsv8u2esTjM4LY18dHCVK462VnLcxEQtoGF5I/KYVn9QfcqyLle0gpgMUJlkac5byoWp qWM0qCuJygWMINzkG8VBG7f8riIPPyKCgmFjh6zd20PJ5WJ6B0R7pbaB8qF4msxc0FR5 ml8Fc1iVnGst+KSCv41BJAwnb3H0dDY+l++4QbI5/EZv8Bd3nIC28PY/l6fk+gGPmJvE 5j0G5YvFwFom23vk6de1RrQnFdRYFynHpug1ATTnA4B1/i8YvZPR6q24/G/r46PB6smc F2pA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=YgsMZx5pwgpEVAvT6XOgIf4w7AHitJHDyTwwU4qEatA=; b=e6dWUwvn+QTPb16xgKIZC1ltWnePHLJN6C9pdsSLH888i/KQb4bf5vdu7B3YrNaIV/ Q9EBLtTqblbb4tGGWB2dkMR/r+nY73TPqZiwCeqZgKL4a61LFjCyD7oUQnmAxeoP3eSQ Fq5sP2OzO3QsuEFy+jdOTTaCgTdY1kQz0x9FzIDUrGU2Rz5kXjm6iY0d+TaZwaxDQ32g MkDTBW4hDGGK/3TcPkikBLuVw9S75PPaI4j0aXnMpFllBfXuVP59Cku/YsNWDxJw1cmI nnWJz/iUElCv5dJVfON257lWfTNvYiPe5jQ+BCZp6zVqcGDzxyeqidwaTwqjdoMPt6je yDcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=jQRpjra5; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cy5si5605556edb.554.2020.07.27.06.53.19; Mon, 27 Jul 2020 06:53:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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=@messagingengine.com header.s=fm3 header.b=jQRpjra5; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728934AbgG0Ndk (ORCPT + 99 others); Mon, 27 Jul 2020 09:33:40 -0400 Received: from new3-smtp.messagingengine.com ([66.111.4.229]:37971 "EHLO new3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728322AbgG0Ndk (ORCPT ); Mon, 27 Jul 2020 09:33:40 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 0448158053F; Mon, 27 Jul 2020 09:33:38 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 27 Jul 2020 09:33:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=YgsMZx 5pwgpEVAvT6XOgIf4w7AHitJHDyTwwU4qEatA=; b=jQRpjra5a+K9eBy0w+s+Vz mPB94ZBosBduEWOnSjljw+8hpjEzFFC904sOPmp7ARDe+7b/eXgsCKJmhtNyicBZ zCPwwjkkb05K0YfGiAlA2DjbQ1tDLUZN+JjPw3S7qjVj1grZEX4aHI1AiVsE9Io+ bNlBAGI/fkhfHIPXd+03GrSnOlle3YkzFc7ppSc0/mjvP7Ug0ymP/jml3M2cNzpZ 3nqHV1F7F7FdVxhEmwJMcva5WUKD1OYbGuvTFkmIgufIhR4Y72HrPEITOBAe68Cd fvWvVqG/K7r5+3fgppYIz90IWY9h/aEu1muFU3O5nc5cERR4JMg31zdbbJgisnTQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedriedtgdeijecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepkfguohcuufgt hhhimhhmvghluceoihguohhstghhsehiughoshgthhdrohhrgheqnecuggftrfgrthhtvg hrnheptdffkeekfeduffevgeeujeffjefhtefgueeugfevtdeiheduueeukefhudehleet necukfhppeejledrudekuddrvddrudejleenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehiughoshgthhesihguohhstghhrdhorhhg X-ME-Proxy: Received: from localhost (bzq-79-181-2-179.red.bezeqint.net [79.181.2.179]) by mail.messagingengine.com (Postfix) with ESMTPA id 9886A3280064; Mon, 27 Jul 2020 09:33:33 -0400 (EDT) Date: Mon, 27 Jul 2020 16:33:31 +0300 From: Ido Schimmel To: Christoph Hellwig Cc: "David S. Miller" , Jakub Kicinski , Alexei Starovoitov , Daniel Borkmann , Alexey Kuznetsov , Hideaki YOSHIFUJI , Eric Dumazet , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, linux-sctp@vger.kernel.org, linux-hams@vger.kernel.org, linux-bluetooth@vger.kernel.org, bridge@lists.linux-foundation.org, linux-can@vger.kernel.org, dccp@vger.kernel.org, linux-decnet-user@lists.sourceforge.net, linux-wpan@vger.kernel.org, linux-s390@vger.kernel.org, mptcp@lists.01.org, lvs-devel@vger.kernel.org, rds-devel@oss.oracle.com, linux-afs@lists.infradead.org, tipc-discussion@lists.sourceforge.net, linux-x25@vger.kernel.org Subject: Re: [PATCH 19/26] net/ipv6: switch ipv6_flowlabel_opt to sockptr_t Message-ID: <20200727133331.GA1851348@shredder> References: <20200723060908.50081-1-hch@lst.de> <20200723060908.50081-20-hch@lst.de> <20200727121505.GA1804864@shredder> <20200727130029.GA26393@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200727130029.GA26393@lst.de> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Mon, Jul 27, 2020 at 03:00:29PM +0200, Christoph Hellwig wrote: > On Mon, Jul 27, 2020 at 03:15:05PM +0300, Ido Schimmel wrote: > > I see a regression with IPv6 flowlabel that I bisected to this patch. > > When passing '-F 0' to 'ping' the flow label should be random, yet it's > > the same every time after this patch. > > Can you send a reproducer? ``` #!/bin/bash ip link add name dummy10 up type dummy ping -q -F 0 -I dummy10 ff02::1 &> /dev/null & tcpdump -nne -e -i dummy10 -vvv -c 1 dst host ff02::1 pkill ping echo ping -F 0 -I dummy10 ff02::1 &> /dev/null & tcpdump -nne -e -i dummy10 -vvv -c 1 dst host ff02::1 pkill ping ip link del dev dummy10 ``` Output with commit ff6a4cf214ef ("net/ipv6: split up ipv6_flowlabel_opt"): ``` dropped privs to tcpdump tcpdump: listening on dummy10, link-type EN10MB (Ethernet), capture size 262144 bytes 16:26:27.072559 62:80:34:1d:b4:b8 > 33:33:00:00:00:01, ethertype IPv6 (0x86dd), length 118: (flowlabel 0x920cf, hlim 1, next-header ICMPv6 (58) payload length: 64) fe80::6080:34ff:fe1d:b4b8 > ff02::1: [icmp6 sum ok] ICMP6, echo request, seq 2 1 packet captured 1 packet received by filter 0 packets dropped by kernel dropped privs to tcpdump tcpdump: listening on dummy10, link-type EN10MB (Ethernet), capture size 262144 bytes 16:26:28.352528 62:80:34:1d:b4:b8 > 33:33:00:00:00:01, ethertype IPv6 (0x86dd), length 118: (flowlabel 0xcdd97, hlim 1, next-header ICMPv6 (58) payload length: 64) fe80::6080:34ff:fe1d:b4b8 > ff02::1: [icmp6 sum ok] ICMP6, echo request, seq 2 1 packet captured 1 packet received by filter 0 packets dropped by kernel ``` Output with commit 86298285c9ae ("net/ipv6: switch ipv6_flowlabel_opt to sockptr_t"): ``` dropped privs to tcpdump tcpdump: listening on dummy10, link-type EN10MB (Ethernet), capture size 262144 bytes 16:32:17.848517 f2:9a:05:ff:cb:25 > 33:33:00:00:00:01, ethertype IPv6 (0x86dd), length 118: (flowlabel 0xfab36, hlim 1, next-header ICMPv6 (58) payload length: 64) fe80::f09a:5ff:feff:cb25 > ff02::1: [icmp6 sum ok] ICMP6, echo request, seq 2 1 packet captured 1 packet received by filter 0 packets dropped by kernel dropped privs to tcpdump tcpdump: listening on dummy10, link-type EN10MB (Ethernet), capture size 262144 bytes 16:32:19.000779 f2:9a:05:ff:cb:25 > 33:33:00:00:00:01, ethertype IPv6 (0x86dd), length 118: (flowlabel 0xfab36, hlim 1, next-header ICMPv6 (58) payload length: 64) fe80::f09 a:5ff:feff:cb25 > ff02::1: [icmp6 sum ok] ICMP6, echo request, seq 2 1 packet captured 1 packet received by filter 0 packets dropped by kernel ``` > > > > > It seems that the pointer is never advanced after the call to > > sockptr_advance() because it is passed by value and not by reference. > > Even if you were to pass it by reference I think you would later need to > > call sockptr_decrease() or something similar. Otherwise it is very > > error-prone. > > > > Maybe adding an offset to copy_to_sockptr() and copy_from_sockptr() is > > better? > > We could do that, although I wouldn't add it to the existing functions > to avoid the churns and instead add copy_to_sockptr_offset or something > like that. Sounds good Thanks