[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <31a08a1a-a6cb-d216-c954-e06abd230000@fb.com>
Date: Mon, 16 Dec 2019 18:52:02 +0000
From: Yonghong Song <yhs@...com>
To: Daniel Borkmann <daniel@...earbox.net>,
"alexei.starovoitov@...il.com" <alexei.starovoitov@...il.com>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"bpf@...r.kernel.org" <bpf@...r.kernel.org>
Subject: Re: [PATCH bpf] bpf: fix missing prog untrack in release_maps
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@...earbox.net>
Acked-by: Yonghong Song <yhs@...com>
Powered by blists - more mailing lists