From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net] ipv6/ndisc: Preserve IPv6 control buffer if protocol error handlers are called Date: Fri, 26 Oct 2018 15:58:21 -0700 (PDT) Message-ID: <20181026.155821.1494940486796676776.davem@davemloft.net> References: <7acb12cb7a35c7a5f9670fc5b1373610b4d5ed67.1540384081.git.sbrivio@redhat.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: yoshfuji@linux-ipv6.org, netdev@vger.kernel.org To: sbrivio@redhat.com Return-path: Received: from shards.monkeyblade.net ([23.128.96.9]:52040 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728133AbeJ0HhQ (ORCPT ); Sat, 27 Oct 2018 03:37:16 -0400 In-Reply-To: <7acb12cb7a35c7a5f9670fc5b1373610b4d5ed67.1540384081.git.sbrivio@redhat.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Stefano Brivio Date: Wed, 24 Oct 2018 14:37:21 +0200 > Commit a61bbcf28a8c ("[NET]: Store skb->timestamp as offset to a base > timestamp") introduces a neighbour control buffer and zeroes it out in > ndisc_rcv(), as ndisc_recv_ns() uses it. > > Commit f2776ff04722 ("[IPV6]: Fix address/interface handling in UDP and > DCCP, according to the scoping architecture.") introduces the usage of the > IPv6 control buffer in protocol error handlers (e.g. inet6_iif() in > present-day __udp6_lib_err()). > > Now, with commit b94f1c0904da ("ipv6: Use icmpv6_notify() to propagate > redirect, instead of rt6_redirect()."), we call protocol error handlers > from ndisc_redirect_rcv(), after the control buffer is already stolen and > some parts are already zeroed out. This implies that inet6_iif() on this > path will always return zero. > > This gives unexpected results on UDP socket lookup in __udp6_lib_err(), as > we might actually need to match sockets for a given interface. > > Instead of always claiming the control buffer in ndisc_rcv(), do that only > when needed. > > Fixes: b94f1c0904da ("ipv6: Use icmpv6_notify() to propagate redirect, instead of rt6_redirect().") > Signed-off-by: Stefano Brivio Applied and queued up for -stable, thank you.