From: John Fastabend <john.fastabend@gmail.com>
To: ast@kernel.org, daniel@iogearbox.net
Cc: netdev@vger.kernel.org, eric.dumazet@gmail.com
Subject: [bpf-next PATCH 0/2] Fix kcm + sockmap by checking psock type
Date: Wed, 17 Oct 2018 20:37:33 -0700 [thread overview]
Message-ID: <20181018032125.22427.85747.stgit@john-Precision-Tower-5810> (raw)
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
next reply other threads:[~2018-10-18 11:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-18 3:37 John Fastabend [this message]
2018-10-18 3:37 ` [bpf-next PATCH 1/2] bpf: skmsg, fix psock create on existing kcm/tls port John Fastabend
2018-10-18 4:20 ` Alexei Starovoitov
2018-10-18 3:37 ` [bpf-next PATCH 2/2] bpf: test_maps add a test to catch kcm + sockmap John Fastabend
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181018032125.22427.85747.stgit@john-Precision-Tower-5810 \
--to=john.fastabend@gmail.com \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox