From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57C3EC169C4 for ; Thu, 31 Jan 2019 22:24:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 311C020869 for ; Thu, 31 Jan 2019 22:24:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728404AbfAaWYb (ORCPT ); Thu, 31 Jan 2019 17:24:31 -0500 Received: from www62.your-server.de ([213.133.104.62]:43186 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726994AbfAaWYb (ORCPT ); Thu, 31 Jan 2019 17:24:31 -0500 Received: from [78.46.172.3] (helo=sslproxy06.your-server.de) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1gpKku-0005aF-6H; Thu, 31 Jan 2019 23:24:20 +0100 Received: from [178.197.249.18] (helo=linux.home) by sslproxy06.your-server.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1gpKkt-0008pI-Uy; Thu, 31 Jan 2019 23:24:20 +0100 Subject: Re: [PATCH bpf] bpf: run bpf programs with preemption disabled To: Alexei Starovoitov , davem@davemloft.net Cc: peterz@infradead.org, jannh@google.com, paulmck@linux.ibm.com, will.deacon@arm.com, mingo@redhat.com, netdev@vger.kernel.org, kernel-team@fb.com References: <20190129024334.1100196-1-ast@kernel.org> From: Daniel Borkmann Message-ID: Date: Thu, 31 Jan 2019 23:24:19 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20190129024334.1100196-1-ast@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.100.2/25346/Thu Jan 31 20:27:33 2019) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 01/29/2019 03:43 AM, Alexei Starovoitov wrote: > Disabled preemption is necessary for proper access to per-cpu maps > from BPF programs. > > But the sender side of socket filters didn't have preemption disabled: > unix_dgram_sendmsg->sk_filter->sk_filter_trim_cap->bpf_prog_run_save_cb->BPF_PROG_RUN > > and a combination of af_packet with tun device didn't disable either: > tpacket_snd->packet_direct_xmit->packet_pick_tx_queue->ndo_select_queue-> > tun_select_queue->tun_ebpf_select_queue->bpf_prog_run_clear_cb->BPF_PROG_RUN > > Disable preemption before executing BPF programs (both classic and extended). > > Reported-by: Jann Horn > Signed-off-by: Alexei Starovoitov Applied, thanks!