netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bpf-next v2 0/2] Fix kcm + sockmap by checking psock type
@ 2018-10-18  5:20 John Fastabend
  2018-10-18  5:20 ` [bpf-next v2 1/2] bpf: skmsg, fix psock create on existing kcm/tls port John Fastabend
  2018-10-18  5:20 ` [bpf-next v2 2/2] bpf: test_maps add a test to catch kcm + sockmap John Fastabend
  0 siblings, 2 replies; 5+ messages in thread
From: John Fastabend @ 2018-10-18  5:20 UTC (permalink / raw)
  To: ast, daniel; +Cc: john.fastabend, netdev, eric.dumazet

We check if the sk_user_data (the psock in skmsg) is in fact a sockmap
type to late, after we read the refcnt which is an error. This
series moves the check up before reading refcnt and also adds a test
to test_maps to test trying to add a KCM socket into a sockmap.

While reviewig this code I also found an issue with KCM and kTLS
where each uses sk_data_ready hooks and associated stream parser
breaking expectations in kcm, ktls or both. But that fix will need
to go to net.

Thanks to Eric for reporting.

v2: Fix up file +/- my scripts lost track of them

John Fastabend (2):
  bpf: skmsg, fix psock create on existing kcm/tls port
  bpf: test_maps add a test to catch kcm + sockmap

 include/linux/skmsg.h                     | 25 +++++++++---
 net/core/sock_map.c                       | 11 +++---
 tools/testing/selftests/bpf/Makefile      |  2 +-
 tools/testing/selftests/bpf/sockmap_kcm.c | 14 +++++++
 tools/testing/selftests/bpf/test_maps.c   | 64 ++++++++++++++++++++++++++++++-
 5 files changed, 103 insertions(+), 13 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/sockmap_kcm.c

-- 
1.9.1

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

end of thread, other threads:[~2018-10-19  4:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-18  5:20 [bpf-next v2 0/2] Fix kcm + sockmap by checking psock type John Fastabend
2018-10-18  5:20 ` [bpf-next v2 1/2] bpf: skmsg, fix psock create on existing kcm/tls port John Fastabend
2018-10-18 17:34   ` Eric Dumazet
2018-10-18 20:24     ` John Fastabend
2018-10-18  5:20 ` [bpf-next v2 2/2] bpf: test_maps add a test to catch kcm + sockmap John Fastabend

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).