[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEf4Bzb55Ho7dJ8VTSp9gATqgfTV-rsF5b5Mqrg5VNOLMQDykQ@mail.gmail.com>
Date: Mon, 5 Oct 2020 14:21:36 -0700
From: Andrii Nakryiko <andrii.nakryiko@...il.com>
To: Hangbin Liu <liuhangbin@...il.com>
Cc: bpf <bpf@...r.kernel.org>, Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
Andrii Nakryiko <andriin@...com>,
Networking <netdev@...r.kernel.org>,
Toke Høiland-Jørgensen <toke@...hat.com>
Subject: Re: [PATCHv2 bpf 1/3] libbpf: close map fd if init map slots failed
On Sat, Oct 3, 2020 at 1:55 AM Hangbin Liu <liuhangbin@...il.com> wrote:
>
> Previously we forgot to close the map fd if bpf_map_update_elem()
> failed during map slot init, which will leak map fd.
>
> Let's move map slot initialization to new function init_map_slots() to
> simplify the code. And close the map fd if init slot failed.
>
> Reported-by: Andrii Nakryiko <andrii.nakryiko@...il.com>
> Signed-off-by: Hangbin Liu <liuhangbin@...il.com>
> ---
LGTM, thanks for the fix!
Acked-by: Andrii Nakryiko <andrii@...nel.org>
> tools/lib/bpf/libbpf.c | 55 ++++++++++++++++++++++++++----------------
> 1 file changed, 34 insertions(+), 21 deletions(-)
>
[...]
Powered by blists - more mailing lists