netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Jason Yan <yanaijie@huawei.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>,
	Jann Horn <jannh@google.com>,
	ast@kernel.org, "zhangyi (F)" <yi.zhang@huawei.com>,
	Zhaohongjiang <zhaohongjiang@huawei.com>,
	netdev@vger.kernel.org, stable@vger.kernel.org,
	bpf@vger.kernel.org
Subject: Re: 979d63d50c0c0f7bc537bf821e056cc9fe5abd38 bpf: prevent out of bounds speculation on pointer arithmetic
Date: Mon, 11 Mar 2019 11:54:58 -0700	[thread overview]
Message-ID: <20190311185458.GA4986@kroah.com> (raw)
In-Reply-To: <c9a89285-23bd-0e4d-3bdc-ea5d5c61e7ff@huawei.com>

On Mon, Mar 11, 2019 at 07:13:14PM +0800, Jason Yan wrote:
> 
> 
> On 2019/3/11 17:41, Daniel Borkmann wrote:
> > Hi Jason,
> > 
> > On 03/11/2019 10:18 AM, Jason Yan wrote:
> > > Hi, Daniel & Greg
> > > 
> > > This patch (979d63d50c0c bpf: prevent out of bounds speculation on pointer arithmetic) was assigned a CVE (CVE-2019-7308) with a high score:
> > > 
> > > CVSS v3.0 Severity and Metrics:
> > > Base Score: 9.8 CRITICAL
> > > 
> > > And this patch is not in stable-4.4, would you please backport this patch to 4.4?
> > 
> > We don't handle kernels as old as 4.4, so someone else would need to
> > do the backporting e.g. from your side. The series has been backported
> > to the last two most-recent stable kernels at that time (we usually
> > follow netdev practice here), and there have been asks about 4.14 as
> > well; I've been looking into backporting for the latter last two weeks
> > on and off, but there are conflicts all over the place in fragile core
> > areas where I didn't have enough free cycles to complete it yet. For
> > old kernels, you're probably better off doing something like this in
> > your tree instead of the huge complexity with a backport:
> > 
> 
> Thanks for you kindly reply.
> 
> > diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
> > index bc34cf9..2cea2de 100644
> > --- a/kernel/bpf/syscall.c
> > +++ b/kernel/bpf/syscall.c
> > @@ -47,7 +47,7 @@ static DEFINE_SPINLOCK(prog_idr_lock);
> >   static DEFINE_IDR(map_idr);
> >   static DEFINE_SPINLOCK(map_idr_lock);
> > 
> > -int sysctl_unprivileged_bpf_disabled __read_mostly;
> > +int sysctl_unprivileged_bpf_disabled __read_mostly = 1;
> > 
> 
> Greg, is it possible to get this kind of mitigation into 4.4?

Why are you using a 4.4 kernel with untrusted userspace?  The only
reason to use 4.4.y at this point in time is if you have a huge SoC tree
patchset that is not upstream.  If you are using x86, you should be
using 4.14.y or newer right now.

That being said, no, I am not going to change the default here, that
could break people's working setups.  I would recommend you just setting
this value in your initrd/setup scripts if you want it, that's why it is
a sysctl :)

thanks,

greg k-h

  reply	other threads:[~2019-03-11 18:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-11  9:18 979d63d50c0c0f7bc537bf821e056cc9fe5abd38 bpf: prevent out of bounds speculation on pointer arithmetic Jason Yan
2019-03-11  9:41 ` Daniel Borkmann
2019-03-11 11:13   ` Jason Yan
2019-03-11 18:54     ` Greg KH [this message]
2019-03-12  2:01       ` Jason Yan
2019-03-12 11:52 ` Greg KH
2019-03-12 14:58   ` Jason Yan
2019-03-12 16:22     ` Greg KH
2019-03-14 14:41       ` Jason Yan
2019-03-14 14:57         ` Greg KH
2019-03-14 15:36           ` Jason Yan

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=20190311185458.GA4986@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=jannh@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=yanaijie@huawei.com \
    --cc=yi.zhang@huawei.com \
    --cc=zhaohongjiang@huawei.com \
    /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).