From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Fastabend Subject: [bpf PATCH v2 0/2] sockmap, syzbot fix error path and RCU fix Date: Thu, 05 Jul 2018 08:05:51 -0700 Message-ID: <20180705150506.9055.81845.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, john.fastabend@gmail.com To: ast@kernel.org, daniel@iogearbox.net Return-path: Received: from [184.63.162.180] ([184.63.162.180]:40654 "EHLO john-Precision-Tower-5810" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1753770AbeGEPFz (ORCPT ); Thu, 5 Jul 2018 11:05:55 -0400 Sender: netdev-owner@vger.kernel.org List-ID: I missed fixing the error path in the sockhash code to align with supporting socks in multiple maps. Simply checking if the psock is present does not mean we can decrement the reference count because it could be part of another map. Fix this by cleaning up the error path so this situation does not happen. --- John Fastabend (2): bpf: sockmap, error path can not release psock in multi-map case bpf: sockmap, hash table is RCU so readers do not need locks kernel/bpf/sockmap.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-)