bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Jann Horn <jannh@google.com>
Cc: Andrii Nakryiko <andriin@fb.com>, bpf <bpf@vger.kernel.org>,
	Network Development <netdev@vger.kernel.org>,
	Alexei Starovoitov <ast@fb.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii.nakryiko@gmail.com>,
	Kernel Team <kernel-team@fb.com>
Subject: Re: [PATCH bpf] bpf: prevent mmap()'ing read-only maps as writable
Date: Wed, 20 May 2020 20:29:31 -0700	[thread overview]
Message-ID: <20200521032931.rs5vbob2gei6ccic@ast-mbp.dhcp.thefacebook.com> (raw)
In-Reply-To: <CAG48ez2HZfjCKG+coVq2k9eE_Hm0rsdQE=O=5nVyKL80QncVZA@mail.gmail.com>

On Thu, May 21, 2020 at 04:50:32AM +0200, Jann Horn wrote:
> On Tue, May 19, 2020 at 7:38 AM Andrii Nakryiko <andriin@fb.com> wrote:
> > 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/
> >
> > Suggested-by: Jann Horn <jannh@google.com>
> > Fixes: fc9702273e2e ("bpf: Add mmap() support for BPF_MAP_TYPE_ARRAY")
> > Signed-off-by: Andrii Nakryiko <andriin@fb.com>
> 
> Reviewed-by: Jann Horn <jannh@google.com>

I fixed trailing white space after 'writable page'
and applied to bpf tree.
Thanks

      reply	other threads:[~2020-05-21  3:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-19  5:38 [PATCH bpf] bpf: prevent mmap()'ing read-only maps as writable Andrii Nakryiko
2020-05-21  2:50 ` Jann Horn
2020-05-21  3:29   ` Alexei Starovoitov [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=20200521032931.rs5vbob2gei6ccic@ast-mbp.dhcp.thefacebook.com \
    --to=alexei.starovoitov@gmail.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andriin@fb.com \
    --cc=ast@fb.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=jannh@google.com \
    --cc=kernel-team@fb.com \
    --cc=netdev@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).