From: sashiko-bot@kernel.org
To: "Arnaldo Carvalho de Melo" <acme@kernel.org>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 1/5] perf dso: Guard against errno==0 when dso__get_filename() returns NULL
Date: Thu, 13 Aug 2026 15:24:17 +0000 [thread overview]
Message-ID: <20260813152418.77D7C1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260813151148.23169-2-acme@kernel.org>
> From: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> __open_dso() computes fd = -errno when dso__get_filename() returns NULL.
> Some failure paths in dso__get_filename() (e.g. binary type mismatch)
> return NULL without making a syscall, leaving errno at 0 from a prior
> successful call. fd = -0 = 0, which is stdin — subsequent code treats
> it as a valid file descriptor.
>
> Fall back to ENOENT when errno is 0, ensuring fd is always negative on
> failure.
>
> The forced ENOENT stays in errno for the callers that check it after a
> negative fd. It must not misdirect the try_to_open_dso() fallback
> loop, though: dso__get_filename()'s chroot fallback used to accept a
> stale ENOENT even when stat() succeeded on a non-regular file (e.g. a
> directory). Re-stat() there and only take the chroot path when
> stat() actually failed with ENOENT [sashiko-bot review of PATCH 1/5].
>
> Fixes: eba5102d2f0b ("perf tools: Add global list of opened dso objects")
> Reported-by: sashiko-bot <sashiko-bot@kernel.org>
> Cc: Jiri Olsa <jolsa@kernel.org>
> Reviewed-by: Ian Rogers <irogers@google.com>
> Assisted-by: Claude:claude-opus-4.6
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260813151148.23169-1-acme@kernel.org?part=1
next prev parent reply other threads:[~2026-08-13 15:24 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-13 15:11 [PATCHES v5 0/5] perf DSO hardening series Arnaldo Carvalho de Melo
2026-08-13 15:11 ` [PATCH 1/5] perf dso: Guard against errno==0 when dso__get_filename() returns NULL Arnaldo Carvalho de Melo
2026-08-13 15:24 ` sashiko-bot [this message]
2026-08-13 15:11 ` [PATCH 2/5] perf dso: Guard close() against invalid fd in dso__decompress_kmodule_path() Arnaldo Carvalho de Melo
2026-08-13 15:16 ` sashiko-bot
2026-08-13 15:11 ` [PATCH 3/5] perf dso: Use stored fd error instead of stale errno in file_read() and file_size() Arnaldo Carvalho de Melo
2026-08-13 15:17 ` sashiko-bot
2026-08-13 15:11 ` [PATCH 4/5] perf dso: Guard against cache underflow on short reads in dso_cache__memcpy() Arnaldo Carvalho de Melo
2026-08-13 15:29 ` sashiko-bot
2026-08-13 15:11 ` [PATCH 5/5] perf dso: Replace assert with runtime check in dso__read_symbol() Arnaldo Carvalho de Melo
2026-08-13 15:26 ` sashiko-bot
-- strict thread matches above, loose matches on Subject: below --
2026-08-13 0:49 [PATCHES v4 0/5] perf DSO hardening series Arnaldo Carvalho de Melo
2026-08-13 0:49 ` [PATCH 1/5] perf dso: Guard against errno==0 when dso__get_filename() returns NULL Arnaldo Carvalho de Melo
2026-08-13 1:04 ` sashiko-bot
2026-08-11 17:51 [PATCHES v3 0/5] perf DSO hardening series Arnaldo Carvalho de Melo
2026-08-11 17:51 ` [PATCH 1/5] perf dso: Guard against errno==0 when dso__get_filename() returns NULL Arnaldo Carvalho de Melo
2026-08-11 17:11 [PATCHES v2 0/5] perf DSO hardening series Arnaldo Carvalho de Melo
2026-08-11 17:11 ` [PATCH 1/5] perf dso: Guard against errno==0 when dso__get_filename() returns NULL Arnaldo Carvalho de Melo
2026-08-02 14:20 [PATCHES 0/5] perf DSO hardening series Arnaldo Carvalho de Melo
2026-08-02 14:20 ` [PATCH 1/5] perf dso: Guard against errno==0 when dso__get_filename() returns NULL Arnaldo Carvalho de Melo
2026-08-02 14:58 ` sashiko-bot
2026-08-02 21:38 ` Arnaldo Carvalho de Melo
2026-08-02 21:08 ` David Laight
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=20260813152418.77D7C1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=acme@kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=sashiko-reviews@lists.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