From: Jiri Olsa <olsajiri@gmail.com>
To: bot+bpf-ci@kernel.org
Cc: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
bpf@vger.kernel.org, kafai@fb.com, eddyz87@gmail.com,
songliubraving@fb.com, yhs@fb.com, martin.lau@kernel.org,
yonghong.song@linux.dev, clm@meta.com, ihor.solodrai@linux.dev
Subject: Re: [PATCH bpf 2/2] libbpf: Prevent double close of btf objects
Date: Wed, 15 Apr 2026 10:23:34 +0200 [thread overview]
Message-ID: <ad9LBouzrr8vaUJa@krava> (raw)
In-Reply-To: <3980e25bb714eb481b5c90ff23d5ce1beb39f94267394f8459dab233b668ad54@mail.kernel.org>
On Tue, Apr 14, 2026 at 08:29:01PM +0000, bot+bpf-ci@kernel.org wrote:
> > diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
> > index b60ac8094a9e..33e7a09915dd 100644
> > --- a/tools/lib/bpf/libbpf.c
> > +++ b/tools/lib/bpf/libbpf.c
> > @@ -5825,7 +5825,7 @@ static int load_module_btfs(struct bpf_object *obj)
> > if (err)
> > goto err_out;
> >
> > - mod_btf = &obj->btf_modules[obj->btf_module_cnt++];
> > + mod_btf = &obj->btf_modules[obj->btf_module_cnt];
>
> [ ... ]
>
> > @@ -5835,6 +5835,7 @@ static int load_module_btfs(struct bpf_object *obj)
> > err = -ENOMEM;
> > goto err_out;
> > }
> > + obj->btf_module_cnt++;
> > continue;
>
> The fix looks correct. Would it make sense to add a Fixes: tag?
> The double close was introduced when fd tracking and the err_out
> error path with close(fd) were added to load_module_btfs():
>
> Fixes: 91abb4a6d79d ("libbpf: Support attachment of BPF tracing programs to kernel modules")
right, will add
jirka
next prev parent reply other threads:[~2026-04-15 8:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-14 19:48 [PATCH bpf 1/2] libbpf: Fix btf object leak in load_module_btfs Jiri Olsa
2026-04-14 19:48 ` [PATCH bpf 2/2] libbpf: Prevent double close of btf objects Jiri Olsa
2026-04-14 20:29 ` bot+bpf-ci
2026-04-15 8:23 ` Jiri Olsa [this message]
2026-04-14 20:28 ` [PATCH bpf 1/2] libbpf: Fix btf object leak in load_module_btfs bot+bpf-ci
2026-04-15 8:22 ` Jiri Olsa
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=ad9LBouzrr8vaUJa@krava \
--to=olsajiri@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bot+bpf-ci@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=clm@meta.com \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=ihor.solodrai@linux.dev \
--cc=kafai@fb.com \
--cc=martin.lau@kernel.org \
--cc=songliubraving@fb.com \
--cc=yhs@fb.com \
--cc=yonghong.song@linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.