mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Olsa <olsajiri@gmail.com>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Mateusz Bieganski <bieganski.gm@gmail.com>,
	Andrii Nakryiko <andrii@kernel.org>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Song Liu <song@kernel.org>,
	Yonghong Song <yonghong.song@linux.dev>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@kernel.org>,
	Stanislav Fomichev <sdf@fomichev.me>, Hao Luo <haoluo@google.com>,
	"open list:BPF [LIBRARY] (libbpf)" <bpf@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] libbpf: fix multi-uprobe attach not working with dynamic symbols
Date: Thu, 3 Apr 2025 11:45:15 +0200	[thread overview]
Message-ID: <Z-5Yq5q8ddkJUO0k@krava> (raw)
In-Reply-To: <CAEf4BzbGbfhdanY0yZtRoRTZaiMG4ML1PYUz1m4QbG-Kw2tNtA@mail.gmail.com>

On Fri, Mar 28, 2025 at 11:14:54AM -0700, Andrii Nakryiko wrote:
> On Thu, Mar 27, 2025 at 3:08 AM Mateusz Bieganski
> <bieganski.gm@gmail.com> wrote:
> >
> > ENOENT is incorrectly propagated to caller, if requested symbol is
> > present in dynamic linker symbol table and not present in symbol table.
> >
> > Signed-off-by: Mateusz Bieganski <bieganski.gm@gmail.com>
> > ---
> >  tools/lib/bpf/elf.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/tools/lib/bpf/elf.c b/tools/lib/bpf/elf.c
> > index 823f83ad819c..41839ef5bc97 100644
> > --- a/tools/lib/bpf/elf.c
> > +++ b/tools/lib/bpf/elf.c
> > @@ -439,8 +439,10 @@ int elf_resolve_syms_offsets(const char *binary_path, int cnt,
> >                 struct elf_sym *sym;
> >
> >                 err = elf_sym_iter_new(&iter, elf_fd.elf, binary_path, sh_types[i], st_type);
> > -               if (err == -ENOENT)
> > +               if (err == -ENOENT) {
> > +                       err = 0;
> >                         continue;
> > +               }
> 
> Don't we have the same problem in elf_resolve_pattern_offsets() as
> well? Can you please fix both issues in one go?
> 
> It seems it's only elf_find_func_offset() that do want to preserve
> that -ENOENT, all others are just error-prone implementations.

+1, thanks for the fix

jirka

> 
> pw-bot: cr
> 
> >                 if (err)
> >                         goto out;
> >
> > --
> > 2.39.5
> >

      reply	other threads:[~2025-04-03  9:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-27 10:07 Mateusz Bieganski
2025-03-28 18:14 ` Andrii Nakryiko
2025-04-03  9:45   ` Jiri Olsa [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=Z-5Yq5q8ddkJUO0k@krava \
    --to=olsajiri@gmail.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bieganski.gm@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=sdf@fomichev.me \
    --cc=song@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®