Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2934942pxb; Mon, 1 Nov 2021 04:58:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyR/cLDkzOO9NiEKKzuH37ZHhdRGjjtnqT59pDUdw+VqFKPxd3fclm6T48wVo1IykGihG8 X-Received: by 2002:a05:6e02:20e2:: with SMTP id q2mr14049142ilv.33.1635767934879; Mon, 01 Nov 2021 04:58:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635767934; cv=none; d=google.com; s=arc-20160816; b=zdeYLyYOSz9QGMoVC274hwZ9Snp1Cev7VeuBtUA8SvtigfoaJZboF2BZiZvucfiIIN nnTD+YrKkGunjjIm8urOZqhh71L8ZUNodRMFQuaC7QFa02D1NxLtEHYuM3ixOmbN6aMW kssKAKvLIPfiYvWxMO7uOa+jKQnpDY6As5S6eioJ/3cyHanBypZm/TBU1yMB7IJ8hTbS tbwTVb8vgJfnFax8dxf/M9hfaJObEm1Tx5hru1cYzUHQM5zJ8fey+Bp1oH9MRjO+lpC/ l5E+fagJe3uR2fjV0lADvMeepPIBcSm/dmlX+N+I3Sifll3845o8eGGrr/7i+S0G5NOF Pccw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=X0TIkRcB9b1gOi+jMQ3Hi8yNRRH/8J0Hqu8JBq5brTM=; b=Q9TIZCfS73E3By3NZIq0EohnzuS9yLk4u7AJwk5Cf3JcsmEufgHjNbkpH5RTprA6c0 YO/YArDa67MEqfm7hREEYcPUolQwZJEkeCgRKiG5cY/n5+16LPxM8jtWhk9Ma28bVRx1 eV+q9VV7taUsdBYnxSdjHLG4VX5bn6UT3ZQ4Ta5ZJAawvf13Qq5h6iDb603hiQb64sgD PhFp9T36+AC54suZEmBTB4JipmGcaOaBGkIkRhXobjxVDZICm42iNVHYd1yuAb79zNHA mpWlo9NLznr6A9uAtcWGyeydrjdhlRR2wtVo9eY2ata2U2nLXlszp6AiwxuhZvFiz+5u J0pA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h7si2007637ild.28.2021.11.01.04.58.41; Mon, 01 Nov 2021 04:58:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232350AbhKAMAR (ORCPT + 99 others); Mon, 1 Nov 2021 08:00:17 -0400 Received: from foss.arm.com ([217.140.110.172]:39158 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231693AbhKAMAQ (ORCPT ); Mon, 1 Nov 2021 08:00:16 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 54F23D6E; Mon, 1 Nov 2021 04:57:43 -0700 (PDT) Received: from FVFF77S0Q05N (unknown [10.57.81.163]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 153A13F5A1; Mon, 1 Nov 2021 04:57:39 -0700 (PDT) Date: Mon, 1 Nov 2021 11:57:29 +0000 From: Mark Rutland To: Pawan Gupta Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, antonio.gomez.iglesias@intel.com, tony.luck@intel.com, dave.hansen@linux.intel.com, gregkh@linuxfoundation.org, linux@armlinux.org.uk Subject: Re: [PATCH ebpf v3] bpf: Disallow unprivileged bpf by default Message-ID: References: <0ace9ce3f97656d5f62d11093ad7ee81190c3c25.1635535215.git.pawan.kumar.gupta@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0ace9ce3f97656d5f62d11093ad7ee81190c3c25.1635535215.git.pawan.kumar.gupta@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 29, 2021 at 12:43:54PM -0700, Pawan Gupta wrote: > Disabling unprivileged BPF would help prevent unprivileged users from > creating the conditions required for potential speculative execution > side-channel attacks on affected hardware. A deep dive on such attacks > and mitigation is available here [1]. > > Sync with what many distros are currently applying, disable unprivileged > BPF by default. An admin can enable this at runtime, if necessary. > > [1] https://ebpf.io/summit-2021-slides/eBPF_Summit_2021-Keynote-Daniel_Borkmann-BPF_and_Spectre.pdf > > Signed-off-by: Pawan Gupta FWIW: Acked-by: Mark Rutland Mark. > --- > v3: > - Drop the conditional default for CONFIG_BPF_UNPRIV_DEFAULT_OFF until > we have an arch generic way to determine arch-common spectre type bugs. > [Mark Rutland, Daniel Borkmann]. > - Also drop the patch to Generalize ARM's CONFIG_CPU_SPECTRE. > - Minor changes to commit message. > > v2: https://lore.kernel.org/lkml/cover.1635383031.git.pawan.kumar.gupta@linux.intel.com/ > - Generalize ARM's CONFIG_CPU_SPECTRE to be available for all architectures. > - Make CONFIG_BPF_UNPRIV_DEFAULT_OFF depend on CONFIG_CPU_SPECTRE. > - Updated commit message to reflect the dependency on CONFIG_CPU_SPECTRE. > - Add reference to BPF spectre presentation in commit message. > > v1: https://lore.kernel.org/all/d37b01e70e65dced2659561ed5bc4b2ed1a50711.1635367330.git.pawan.kumar.gupta@linux.intel.com/ > > kernel/bpf/Kconfig | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/kernel/bpf/Kconfig b/kernel/bpf/Kconfig > index a82d6de86522..73d446294455 100644 > --- a/kernel/bpf/Kconfig > +++ b/kernel/bpf/Kconfig > @@ -64,6 +64,7 @@ config BPF_JIT_DEFAULT_ON > > config BPF_UNPRIV_DEFAULT_OFF > bool "Disable unprivileged BPF by default" > + default y > depends on BPF_SYSCALL > help > Disables unprivileged BPF by default by setting the corresponding > @@ -72,6 +73,10 @@ config BPF_UNPRIV_DEFAULT_OFF > disable it by setting it to 1 (from which no other transition to > 0 is possible anymore). > > + Unprivileged BPF can be used to exploit potential speculative > + execution side-channel vulnerabilities on affected hardware. If you > + are concerned about it, answer Y. > + > source "kernel/bpf/preload/Kconfig" > > config BPF_LSM > -- > 2.31.1 >