netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 net 0/4] ipv6: datagram: Update dst cache of a connected udp sk during pmtu update
@ 2016-04-11 22:29 Martin KaFai Lau
  2016-04-11 22:29 ` [PATCH v2 net 1/4] ipv6: datagram: Refactor flowi6 init codes to a new function Martin KaFai Lau
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Martin KaFai Lau @ 2016-04-11 22:29 UTC (permalink / raw)
  To: netdev; +Cc: Cong Wang, Eric Dumazet, Wei Wang, Kernel Team

v2:
~ Protect __sk_dst_get() operations with rcu_read_lock in
  release_cb() because another thread may do ip6_dst_store()
  for a udp sk without taking the sk lock (e.g. in sendmsg).
~ Do a ipv6_addr_v4mapped(&sk->sk_v6_daddr) check before
  calling ip6_datagram_dst_update() in patch 3 and 4.  It is
  similar to how __ip6_datagram_connect handles it.
~ One fix in ip6_datagram_dst_update() in patch 2.  It needs
  to check (np->flow_label & IPV6_FLOWLABEL_MASK) before
  doing fl6_sock_lookup.  I was confused with the naming
  of IPV6_FLOWLABEL_MASK and IPV6_FLOWINFO_MASK.
~ Check dst->obsolete just on the safe side, although I think it
  should at least have DST_OBSOLETE_FORCE_CHK by now.
~ Add Fixes tag to patch 3 and 4
~ Add some points from the previous discussion about holding
  sk lock to the commit message in patch 3.

v1:
There is a case in connected UDP socket such that
getsockopt(IPV6_MTU) will return a stale MTU value. The reproducible
sequence could be the following:
1. Create a connected UDP socket
2. Send some datagrams out
3. Receive a ICMPV6_PKT_TOOBIG
4. No new outgoing datagrams to trigger the sk_dst_check()
   logic to update the sk->sk_dst_cache.
5. getsockopt(IPV6_MTU) returns the mtu from the invalid
   sk->sk_dst_cache instead of the newly created RTF_CACHE clone.

Patch 1 and 2 are the prep work.
Patch 3 and 4 are the fixes.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-04-14 20:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-11 22:29 [PATCH v2 net 0/4] ipv6: datagram: Update dst cache of a connected udp sk during pmtu update Martin KaFai Lau
2016-04-11 22:29 ` [PATCH v2 net 1/4] ipv6: datagram: Refactor flowi6 init codes to a new function Martin KaFai Lau
2016-04-11 22:29 ` [PATCH v2 net 2/4] ipv6: datagram: Refactor dst lookup and update " Martin KaFai Lau
2016-04-11 22:29 ` [PATCH v2 net 3/4] ipv6: datagram: Update dst cache of a connected datagram sk during pmtu update Martin KaFai Lau
2016-04-11 22:29 ` [PATCH v2 net 4/4] ipv6: udp: Do a route lookup and update during release_cb Martin KaFai Lau
2016-04-14 20:45 ` [PATCH v2 net 0/4] ipv6: datagram: Update dst cache of a connected udp sk during pmtu update David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).