public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [bpf PATCH v2 0/2] bpf, sockmap IPv6/TCP state fixes
@ 2018-06-08 15:06 John Fastabend
  2018-06-08 15:06 ` [bpf PATCH v2 1/2] bpf: sockmap, fix crash when ipv6 sock is added John Fastabend
  2018-06-08 15:06 ` [bpf PATCH v2 2/2] bpf: sockmap only allow ESTABLISHED sock state John Fastabend
  0 siblings, 2 replies; 7+ messages in thread
From: John Fastabend @ 2018-06-08 15:06 UTC (permalink / raw)
  To: edumazet, weiwan, daniel, ast; +Cc: netdev

ULP are only valid with TCP in ESTABLISHED states. Sockmap was not
following this rule so add a fix to only allow ESTABLISHED states to
be added from the userspace side. On the BPF side we continue to allow
adding sockets to maps from sock_ops events, but only events that are
triggered when entering the ESTABLISHED state. This blocks users from
adding sockets to maps that will not be in the correct TCP state.

Also we stomped on the tcpv6_prot pointer overwriting with the
tcp_prot. This was discovered by syzbot (thanks!) and not found by
selftests because we only have local tests in selftest so even with
ipv6 selftests we did not trigger the splat.

Will follow up with IPv6 tests for selftest regardless it seems like
a miss to not have any IPv6 selftests.

Also these need to go to stable. There will be a small conflict on
the second patch where we add check to the sockhash update function
which did not exist until recently.

---

John Fastabend (2):
      bpf: sockmap, fix crash when ipv6 sock is added
      bpf: sockmap only allow ESTABLISHED sock state


 kernel/bpf/sockmap.c |   56 ++++++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 52 insertions(+), 4 deletions(-)

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

end of thread, other threads:[~2018-06-12 13:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-08 15:06 [bpf PATCH v2 0/2] bpf, sockmap IPv6/TCP state fixes John Fastabend
2018-06-08 15:06 ` [bpf PATCH v2 1/2] bpf: sockmap, fix crash when ipv6 sock is added John Fastabend
2018-06-11 23:14   ` Daniel Borkmann
2018-06-12 13:57     ` John Fastabend
2018-06-08 15:06 ` [bpf PATCH v2 2/2] bpf: sockmap only allow ESTABLISHED sock state John Fastabend
2018-06-09 20:51   ` Daniel Borkmann
2018-06-09 21:53   ` John Fastabend

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox