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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 3657EECE58D for ; Thu, 17 Oct 2019 22:11:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 12BA421D7A for ; Thu, 17 Oct 2019 22:11:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438094AbfJQWL4 (ORCPT ); Thu, 17 Oct 2019 18:11:56 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:54603 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727050AbfJQWL4 (ORCPT ); Thu, 17 Oct 2019 18:11:56 -0400 Received: from p5b06da22.dip0.t-ipconnect.de ([91.6.218.34] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iLDzf-0007mT-So; Fri, 18 Oct 2019 00:11:40 +0200 Date: Fri, 18 Oct 2019 00:11:38 +0200 (CEST) From: Thomas Gleixner To: David Miller cc: Sebastian Sewior , daniel@iogearbox.net, bpf@vger.kernel.org, ast@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, Peter Zijlstra , Clark Williams Subject: Re: [PATCH] BPF: Disable on PREEMPT_RT In-Reply-To: <20191017.132548.2120028117307856274.davem@davemloft.net> Message-ID: References: <20191017090500.ienqyium2phkxpdo@linutronix.de> <20191017145358.GA26267@pc-63.home> <20191017154021.ndza4la3hntk4d4o@linutronix.de> <20191017.132548.2120028117307856274.davem@davemloft.net> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-2141773991-1571350299=:1869" X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-2141773991-1571350299=:1869 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Thu, 17 Oct 2019, David Miller wrote: > From: Sebastian Andrzej Siewior > Date: Thu, 17 Oct 2019 17:40:21 +0200 > > > On 2019-10-17 16:53:58 [+0200], Daniel Borkmann wrote: > >> On Thu, Oct 17, 2019 at 11:05:01AM +0200, Sebastian Andrzej Siewior wrote: > >> > Disable BPF on PREEMPT_RT because > >> > - it allocates and frees memory in atomic context > >> > - it uses up_read_non_owner() > >> > - BPF_PROG_RUN() expects to be invoked in non-preemptible context > >> > >> For the latter you'd also need to disable seccomp-BPF and everything > >> cBPF related as they are /all/ invoked via BPF_PROG_RUN() ... > > > > I looked at tracing and it depended on BPF_SYSCALL so I assumed they all > > do… Now looking for BPF_PROG_RUN() there is PPP_FILTER, > > NET_TEAM_MODE_LOADBALANCE and probably more. I didn't find a symbol for > > seccomp-BPF. > > Would it make sense to override BPF_PROG_RUN() and make each caller fail > > instead? Other recommendations? > > I hope you understand that basically you are disabling any packet sniffing > on the system with this patch you are proposing. > > This means no tcpdump, not wireshark, etc. They will all become > non-functional. Just for the record. tcpdump and wireshark work perfectly fine on a BPF disabled kernel at least in the limited way I am using them. They might become non functional in a decade from now but I assume that we find a solution for those problems until then. Thanks, tglx --8323329-2141773991-1571350299=:1869--