BPF List
 help / color / mirror / Atom feed
From: Yonghong Song <yhs@fb.com>
To: Daniel Borkmann <daniel@iogearbox.net>,
	"alexei.starovoitov@gmail.com" <alexei.starovoitov@gmail.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"bpf@vger.kernel.org" <bpf@vger.kernel.org>
Subject: Re: [PATCH bpf] bpf: fix missing prog untrack in release_maps
Date: Mon, 16 Dec 2019 18:52:02 +0000	[thread overview]
Message-ID: <31a08a1a-a6cb-d216-c954-e06abd230000@fb.com> (raw)
In-Reply-To: <1c2909484ca524ae9f55109b06f22b6213e76376.1576514756.git.daniel@iogearbox.net>



On 12/16/19 8:49 AM, Daniel Borkmann wrote:
> Commit da765a2f5993 ("bpf: Add poke dependency tracking for prog array
> maps") wrongly assumed that in case of prog load errors, we're cleaning
> up all program tracking via bpf_free_used_maps().
> 
> However, it can happen that we're still at the point where we didn't copy
> map pointers into the prog's aux section such that env->prog->aux->used_maps
> is still zero, running into a UAF. In such case, the verifier has similar
> release_maps() helper that drops references to used maps from its env.
> 
> Consolidate the release code into __bpf_free_used_maps() and call it from
> all sides to fix it.
> 
> Fixes: da765a2f5993 ("bpf: Add poke dependency tracking for prog array maps")
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>

Acked-by: Yonghong Song <yhs@fb.com>

  reply	other threads:[~2019-12-16 18:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-16 16:49 [PATCH bpf] bpf: fix missing prog untrack in release_maps Daniel Borkmann
2019-12-16 18:52 ` Yonghong Song [this message]
2019-12-16 20:33   ` 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=31a08a1a-a6cb-d216-c954-e06abd230000@fb.com \
    --to=yhs@fb.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --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