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.

---

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


 tools/testing/selftests/bpf/Makefile      |    2 -
 tools/testing/selftests/bpf/sockmap_kcm.c |   14 ++++++
 tools/testing/selftests/bpf/test_maps.c   |   64 ++++++++++++++++++++++++++++-
 3 files changed, 77 insertions(+), 3 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/sockmap_kcm.c

--
Signature

Reply via email to