From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xin Long Subject: Re: [PATCH net] sctp: update dst pmtu with the correct daddr Date: Fri, 21 Sep 2018 15:55:34 +0800 Message-ID: References: <20180920.113113.1168948449098131783.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: network dev , linux-sctp@vger.kernel.org, Marcelo Ricardo Leitner , Neil Horman To: davem Return-path: Received: from mail-io1-f66.google.com ([209.85.166.66]:40449 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389309AbeIUNn1 (ORCPT ); Fri, 21 Sep 2018 09:43:27 -0400 In-Reply-To: <20180920.113113.1168948449098131783.davem@davemloft.net> Sender: netdev-owner@vger.kernel.org List-ID: On Fri, Sep 21, 2018 at 2:31 AM David Miller wrote: > > From: Xin Long > Date: Thu, 20 Sep 2018 17:27:28 +0800 > > > When processing pmtu update from an icmp packet, it calls .update_pmtu > > with sk instead of skb in sctp_transport_update_pmtu. > > > > However for sctp, the daddr in the transport might be different from > > inet_sock->inet_daddr or sk->sk_v6_daddr, which is used to update or > > create the route cache. The incorrect daddr will cause a different > > route cache created for the path. > > > > So before calling .update_pmtu, inet_sock->inet_daddr/sk->sk_v6_daddr > > should be updated with the daddr in the transport, and update it back > > after it's done. > > > > The issue has existed since route exceptions introduction. > > > > Fixes: 4895c771c7f0 ("ipv4: Add FIB nexthop exceptions.") > > Reported-by: ian.periam@dialogic.com > > Signed-off-by: Xin Long > > Applied and queued up for -stable. > > Although are you sure it's OK to temporarily change the sockets address > like this? What if an asynchronous context looks at the socket state > and sees the temporarily set address? It's under the protection of the sock lock, I think any other places that want to access the address also need to acquire this sock lock first.