Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3473952pxb; Mon, 4 Apr 2022 18:06:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpBaKSwHwj3S/4NA2ADWFye9uuVL1yhXw4IyvYBXhO3apw0zPFVv7HQ+K7L2euBBTU6B3S X-Received: by 2002:a17:90a:f311:b0:1ca:a4ac:bc2a with SMTP id ca17-20020a17090af31100b001caa4acbc2amr1100005pjb.25.1649120800341; Mon, 04 Apr 2022 18:06:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649120800; cv=none; d=google.com; s=arc-20160816; b=R8wiEdB9bKtFm9aW6sA+PiNmQD2tCvt3VaWb1IRbYMm2CDlRurbLqz3PQWhxUWz9lp RZf5arIDDyVvxkdrl+NQPYDOZ0cSAT+UcmbhvrnHkMAtU+qkSW/k7yBLe8soBIllpFpQ lxMUCbeED5qSuHMaV+kc/Li7CBW3q7+DtWgLY1DJ69fX+m5GKDxramVlsmsY1Ge8CG0v IjorFvdz3Pvll1nRLHxPrzf5e31ZRVNGHrdvLPKcJHdHIZPxLroO3o6Q39iLEo/uEGLN IlkNylrHVT0jii6fVN/IZOX2ZV3iueNCT1YkVneSVv94z1RlzrbpKzKhLuiQG0eSXRSp FhAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=9XkilyyUYNIu4Q3RHDNyf31taWeKWC5BkvBL21mWPSU=; b=LQ239ayQnF9V/ER6nwzUxvUNSiBuHsTKgHUgxk7j/o9NraRz5xFNTaadbsDjDA3ijp fa+T8Wgr4OJoqF6q/VSZQ1s+bOnvJjEpbwP6HvDePB36xpRnoH72InrlBV+C+AMX2kKK HWLAjzhEnAUebJGDgwa5OwC9oOsJWjxugW6lrqLlOxOJl/SnEXuzNKy6uWFMJ35UIrTl NGr/DuBv+jGpKy+Fq69AMBHTYPlHOZERKwot5aZl7zZKF7lxdUpz24t8Ilbh2hr91r+6 MsSy5gHfJ48rsLKopZdDz8GTdIvRpNmEvVjVcz2emlkzLMQRe1jozB7bScxb6NtvBz9m oEYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eSZSA29O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id pg8-20020a17090b1e0800b001c66f2284b7si807784pjb.49.2022.04.04.18.06.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 18:06:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eSZSA29O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 02EB2140771; Mon, 4 Apr 2022 17:05:34 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233262AbiDDXKL (ORCPT + 99 others); Mon, 4 Apr 2022 19:10:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242761AbiDDXJ5 (ORCPT ); Mon, 4 Apr 2022 19:09:57 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 877C1DF48; Mon, 4 Apr 2022 15:45:43 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id m18so9353056plx.3; Mon, 04 Apr 2022 15:45:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9XkilyyUYNIu4Q3RHDNyf31taWeKWC5BkvBL21mWPSU=; b=eSZSA29OSTSEp0kOl2zS4g6nxJQr1PmTHuIJuKFN0sFB3K3wZHIznyN+FdNPLcOxkS A0Zr2FjxOGOUIOx9eX91ldEQ0Xd5EoghPmsoqtF80tfVPBTL4roiZKFWffzrk28CpynL OfXuBzS73RLhxuu4gb2w+U+HC1TruFekGweBautH0MOYw99qC20jRZ+Z0OZXPYmc57pY NZ31uZpw4xk3IYZgJ+VINlpf/f2hy+FbSzPZMJ8pf+moIsN32xOzam3c8xK4y6vH3Ltg CxGWwV/NO2MJn1aCC73shwF7jRpDbinNmPBUtMbQNNja7hlKz9d9n+qdrOhz4M+YrKyJ MfhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9XkilyyUYNIu4Q3RHDNyf31taWeKWC5BkvBL21mWPSU=; b=BQOP9x9vg0DNVouHYVgFjVWNrVrXIDVWr5/YCGh5HWDPE+q8SjsFRQQKCGITDFAiiX ptOqnrodtUzCwhiefgt5kgm2FIJIUEhsX1RJcBBegvqsjbeAi/VW8EZmPvdnu7RmVqVe CQdLkVDJz95abFJClPQp5Snz7PZWPlpIMGQ1pIcE10HZ31GlDEPjxjDMoVKU6Dy7ZHc5 10/i+FVUZ+zsFr2UBBfy8IsoImaBPNhHCByqHTlDONgggnS863RaDW6FOq3pKLN4uwbz mcQXEGrATTnu8oSP3jCv8s2v73hVPY9hC8MADlBCp3FoS0DLEp8CuCtgZxGWe6c7If6b 6Edg== X-Gm-Message-State: AOAM533bZehBUEvg9Dvj2wC9kbHL4kGd2ZUiK1rd+6R2QicxJ+65LHIQ Telnoo13wJPE1nNFjxs+fHBbFISp50nOba9uwmU= X-Received: by 2002:a17:902:ba83:b0:154:727e:5fc5 with SMTP id k3-20020a170902ba8300b00154727e5fc5mr463137pls.55.1649112342937; Mon, 04 Apr 2022 15:45:42 -0700 (PDT) MIME-Version: 1.0 References: <20220404220314.112912-1-mcroce@linux.microsoft.com> In-Reply-To: <20220404220314.112912-1-mcroce@linux.microsoft.com> From: Alexei Starovoitov Date: Mon, 4 Apr 2022 15:45:31 -0700 Message-ID: Subject: Re: [PATCH] bpf: make unprivileged BPF a compile time choice To: Matteo Croce Cc: bpf , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , LKML Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 4, 2022 at 3:03 PM Matteo Croce wrote: > > From: Matteo Croce > > Add a compile time option to permanently disable unprivileged BPF and > the corresponding sysctl handler so that there's absolutely no > concern about unprivileged BPF being enabled from userspace during > runtime. Special purpose kernels can benefit from the build-time > assurance that unprivileged eBPF is disabled in all of their kernel > builds rather than having to rely on userspace to permanently disable > it at boot time. > The default behaviour is left unchanged, which is: unprivileged BPF > compiled in but disabled at boot. That is an insane level of "security" paranoia. If you're so concerned about bpf do CONFIG_BPF_SYSCALL=n