linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] arm64: defconfig: enable BPF related configs
Date: Mon, 12 Nov 2018 18:36:23 +0000	[thread overview]
Message-ID: <20181112183623.GA2265@brain-police> (raw)
In-Reply-To: <20181111181048.10933-2-pbrobinson@gmail.com>

Hi Peter, [+Jann and Ard]

On Sun, Nov 11, 2018 at 06:10:48PM +0000, Peter Robinson wrote:
> The BPF components are getting more widely used by various components
> so we should enable them in the ARMv7 multi config to ensure they
> get wider testing and don't regress.

^^^ Looks like it needs updating for arm64?

> diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
> index c9a57d11330b..8748f6cf9fcd 100644
> --- a/arch/arm64/configs/defconfig
> +++ b/arch/arm64/configs/defconfig
> @@ -19,6 +19,7 @@ CONFIG_BLK_CGROUP=y
>  CONFIG_CGROUP_PIDS=y
>  CONFIG_CGROUP_HUGETLB=y
>  CONFIG_CPUSETS=y
> +CONFIG_CGROUP_BPF=y
>  CONFIG_CGROUP_DEVICE=y
>  CONFIG_CGROUP_CPUACCT=y
>  CONFIG_CGROUP_PERF=y
> @@ -157,7 +158,10 @@ CONFIG_VLAN_8021Q_MVRP=y
>  CONFIG_QRTR=m
>  CONFIG_QRTR_SMD=m
>  CONFIG_QRTR_TUN=m
> +CONFIG_BPF_SYSCALL=y
>  CONFIG_BPF_JIT=y
> +CONFIG_BPF_JIT_ALWAYS_ON=y

Have you considered the security impact of these two options at all? Whilst
there appears to be a sysctl to disable unprivileged BPF usage, it's a
one-way switch so it defaults to "allow unprivileged access" so we're
opening up a pretty big attack surface by default with this change. My
concerns are broadly:

  1. BPF has a track record of serious security problems. This isn't
     intended as a criticism of the developers, it's more that the nature of
     the beast means it's a bit of a sitting duck. It's also constantly growing
     new functionality which would then likely be enabled by default under
     these options, so I fully expect things to continue as they are until
     the feature set has started to stabilise.

  2. Whilst forcing the JIT to be "always on" removes the interpreter from the
     equation (and it's the interpreter which was heavily targetted by
     spectre-v2), it also has the nasty consequent of effectively allowing the
     modules area to be sprayed with executable code.

Now, this is only defconfig we're talking about here, but the impression I
get from your patch is that your motivation is purely (ARMv7?) regression
testing and I would prefer us at least to consider whether there are other
implications from enabling this stuff by default on arm64.

Have other architectures already made this leap?

Thanks,

Will

> +CONFIG_BPF_STREAM_PARSER=y
>  CONFIG_BT=m
>  CONFIG_BT_HIDP=m
>  # CONFIG_BT_HS is not set
> -- 
> 2.19.1
> 

  reply	other threads:[~2018-11-12 18:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-11 18:10 [PATCH 1/2] ARM: multi_v7_defconfig: enable BPF related configs Peter Robinson
2018-11-11 18:10 ` [PATCH 2/2] arm64: defconfig: " Peter Robinson
2018-11-12 18:36   ` Will Deacon [this message]
2018-11-17 23:18     ` Ard Biesheuvel
2018-11-26 15:38       ` Will Deacon
2018-11-26 15:52         ` Russell King - ARM Linux
2018-11-27 19:31           ` Will Deacon
2018-11-27 23:18             ` Russell King - ARM Linux
2018-11-28 20:01               ` Will Deacon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181112183623.GA2265@brain-police \
    --to=will.deacon@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).