From: Dave Hansen <dave.hansen@linux.intel.com>
To: speck@linutronix.de
Subject: [MODERATED] Re: Generic eBPF hardening
Date: Thu, 17 May 2018 16:13:32 -0700 [thread overview]
Message-ID: <96c4efff-c9ef-ee4d-e2cc-f813ef21449b@linux.intel.com> (raw)
In-Reply-To: <20180517222233.xk3favfebt4wiiid@ast-mbp>
On 05/17/2018 03:22 PM, speck for Alexei Starovoitov wrote:
> On Thu, May 17, 2018 at 01:55:38PM -0700, speck for Dave Hansen wrote:
>> I'm hoping Alexei is on the list now.
>>
>> Andi Kleen and I were talking about ways to generally harden eBPF. We
>> were a bit concerned that eBPF could leave around attacker-controlled
>> values on the stack that might allow later, speculatively-executed
>> kernel code to be exploited.
>>
>> One thing I wanted to clarify: The eBPF stack (BPF_REG_FP) *is* the
>> kernel stack, correct?
> yes. bpf program stack is kernel stack,
> but I don't see how this is useful.
> There are plenty of ways to populate kernel stack with user controlled
> bytes. Ex: set_task_comm.
In most places in the kernel, it's hard to both get data on the stack
that you control *and* execute code that you (mostly) control. For the
vast majority of the kernel, you are entirely at the mercy of the
compiler to give you the code and the stack layout.
BPF currently gives you pretty good control of both, though.
Zeroing the stack would at least take away one source of gadgets: kernel
code that speculatively consumes uninitialized data from the stack.
next prev parent reply other threads:[~2018-05-17 23:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-17 20:55 [MODERATED] Generic eBPF hardening Dave Hansen
2018-05-17 22:22 ` [MODERATED] " Alexei Starovoitov
2018-05-17 22:54 ` Andi Kleen
2018-05-17 23:21 ` Alexei Starovoitov
2018-05-17 23:39 ` Andi Kleen
2018-05-18 18:18 ` Dave Hansen
2018-05-18 22:26 ` Alexei Starovoitov
2018-05-17 23:13 ` Dave Hansen [this message]
2018-05-17 23:24 ` Alexei Starovoitov
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=96c4efff-c9ef-ee4d-e2cc-f813ef21449b@linux.intel.com \
--to=dave.hansen@linux.intel.com \
--cc=speck@linutronix.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.