From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Borkmann Subject: Re: [bpf-net PATCH v2] bpf: sockmap missing NULL psock check Date: Sun, 7 Jan 2018 00:08:18 +0100 Message-ID: <860f27aa-38c2-8655-2dca-e6aca89c41f7@iogearbox.net> References: <20180105040209.11195.85577.stgit@john-Precision-Tower-5810> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org To: John Fastabend , borkmann@iogearbox.net, alexei.starovoitov@gmail.com Return-path: Received: from www62.your-server.de ([213.133.104.62]:46037 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752254AbeAFXIT (ORCPT ); Sat, 6 Jan 2018 18:08:19 -0500 In-Reply-To: <20180105040209.11195.85577.stgit@john-Precision-Tower-5810> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 01/05/2018 05:02 AM, John Fastabend wrote: > Add psock NULL check to handle a racing sock event that can get the > sk_callback_lock before this case but after xchg happens causing the > refcnt to hit zero and sock user data (psock) to be null and queued > for garbage collection. > > Also add a comment in the code because this is a bit subtle and > not obvious in my opinion. > > Signed-off-by: John Fastabend Applied to bpf, thanks John!