stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: gregkh@linuxfoundation.org
Cc: andriin@fb.com, ast@kernel.org, jannh@google.com, stable@vger.kernel.org
Subject: Re: FAILED: patch "[PATCH] bpf: Prevent mmap()'ing read-only maps as writable" failed to apply to 5.6-stable tree
Date: Mon, 25 May 2020 16:55:31 -0400	[thread overview]
Message-ID: <20200525205531.GD33628@sasha-vm> (raw)
In-Reply-To: <15904175802874@kroah.com>

On Mon, May 25, 2020 at 04:39:40PM +0200, gregkh@linuxfoundation.org wrote:
>
>The patch below does not apply to the 5.6-stable tree.
>If someone wants it applied there, or to any other stable or longterm
>tree, then please email the backport, including the original git commit
>id to <stable@vger.kernel.org>.
>
>thanks,
>
>greg k-h
>
>------------------ original commit in Linus's tree ------------------
>
>From dfeb376dd4cb2c5004aeb625e2475f58a5ff2ea7 Mon Sep 17 00:00:00 2001
>From: Andrii Nakryiko <andriin@fb.com>
>Date: Mon, 18 May 2020 22:38:24 -0700
>Subject: [PATCH] bpf: Prevent mmap()'ing read-only maps as writable
>
>As discussed in [0], it's dangerous to allow mapping BPF map, that's meant to
>be frozen and is read-only on BPF program side, because that allows user-space
>to actually store a writable view to the page even after it is frozen. This is
>exacerbated by BPF verifier making a strong assumption that contents of such
>frozen map will remain unchanged. To prevent this, disallow mapping
>BPF_F_RDONLY_PROG mmap()'able BPF maps as writable, ever.
>
>  [0] https://lore.kernel.org/bpf/CAEf4BzYGWYhXdp6BJ7_=9OQPJxQpgug080MMjdSB72i9R+5c6g@mail.gmail.com/
>
>Fixes: fc9702273e2e ("bpf: Add mmap() support for BPF_MAP_TYPE_ARRAY")
>Suggested-by: Jann Horn <jannh@google.com>
>Signed-off-by: Andrii Nakryiko <andriin@fb.com>
>Signed-off-by: Alexei Starovoitov <ast@kernel.org>
>Reviewed-by: Jann Horn <jannh@google.com>
>Link: https://lore.kernel.org/bpf/20200519053824.1089415-1-andriin@fb.com

I've adjusted context in the selftest update and queued it up.

-- 
Thanks,
Sasha

      reply	other threads:[~2020-05-25 20:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-25 14:39 FAILED: patch "[PATCH] bpf: Prevent mmap()'ing read-only maps as writable" failed to apply to 5.6-stable tree gregkh
2020-05-25 20:55 ` Sasha Levin [this message]

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=20200525205531.GD33628@sasha-vm \
    --to=sashal@kernel.org \
    --cc=andriin@fb.com \
    --cc=ast@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jannh@google.com \
    --cc=stable@vger.kernel.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).