From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Borkmann Subject: Re: [bpf-next v3 0/2] Fix kcm + sockmap by checking psock type Date: Sat, 20 Oct 2018 00:51:29 +0200 Message-ID: <76735602-6af6-bc03-ee66-294987e768e5@iogearbox.net> References: <1539896316-13403-1-git-send-email-john.fastabend@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org To: John Fastabend , ast@kernel.org, eric.dumazet@gmail.com Return-path: Received: from www62.your-server.de ([213.133.104.62]:49386 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726184AbeJTG7e (ORCPT ); Sat, 20 Oct 2018 02:59:34 -0400 In-Reply-To: <1539896316-13403-1-git-send-email-john.fastabend@gmail.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 10/18/2018 10:58 PM, John Fastabend wrote: > 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 > v3: return EBUSY if refcnt is zero > > 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 Applied, thanks!