Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752609AbcCGKIF (ORCPT ); Mon, 7 Mar 2016 05:08:05 -0500 Received: from www62.your-server.de ([213.133.104.62]:60668 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752140AbcCGKHz (ORCPT ); Mon, 7 Mar 2016 05:07:55 -0500 Message-ID: <56DD52F0.1060604@iogearbox.net> Date: Mon, 07 Mar 2016 11:07:44 +0100 From: Daniel Borkmann User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Alexei Starovoitov , "David S . Miller" CC: Daniel Wagner , Tom Zanussi , Wang Nan , He Kuang , Martin KaFai Lau , Brendan Gregg , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH net-next 1/9] bpf: prevent kprobe+bpf deadlocks References: <1457315917-1970307-1-git-send-email-ast@fb.com> <1457315917-1970307-2-git-send-email-ast@fb.com> In-Reply-To: <1457315917-1970307-2-git-send-email-ast@fb.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 631 Lines: 16 On 03/07/2016 02:58 AM, Alexei Starovoitov wrote: > if kprobe is placed within update or delete hash map helpers > that hold bucket spin lock and triggered bpf program is trying to > grab the spinlock for the same bucket on the same cpu, it will > deadlock. > Fix it by extending existing recursion prevention mechanism. > > Note, map_lookup and other tracing helpers don't have this problem, > since they don't hold any locks and don't modify global data. > bpf_trace_printk has its own recursive check and ok as well. > > Signed-off-by: Alexei Starovoitov LGTM Acked-by: Daniel Borkmann