From: sashiko-bot@kernel.org
To: "Martin Kaiser" <martin@kaiser.cx>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 2/3] perf test: fix sys_enter_openat event test for musl
Date: Mon, 27 Apr 2026 09:49:37 +0000 [thread overview]
Message-ID: <20260427094939.4FB8EC19425@smtp.kernel.org> (raw)
In-Reply-To: <20260427090225.794482-3-martin@kaiser.cx>
Sashiko AI review found 1 potential issue(s):
- [Medium] The updated bitwise check `(tp_flags & flags) != flags` fails to verify the `O_RDONLY` access mode and permits arbitrary unrelated flags, severely weakening the test.
--
commit 0700122c98ba7f263a329cd8f9fbeef95b67603e
Author: Martin Kaiser <martin@kaiser.cx>
perf test: fix sys_enter_openat event test for musl
This commit updates the sys_enter_openat test to allow additional flags in the
captured event. It replaces the strict equality check with a bitwise mask check
to accommodate the O_LARGEFILE flag implicitly added by musl libc.
> diff --git a/tools/perf/tests/openat-syscall-tp-fields.c b/tools/perf/tests/openat-syscall-tp-fields.c
> --- a/tools/perf/tests/openat-syscall-tp-fields.c
> +++ b/tools/perf/tests/openat-syscall-tp-fields.c
[ ... ]
> @@ -120,7 +120,8 @@ static int test__syscall_openat_tp_fields(struct test_suite *test __maybe_unused
>
> tp_flags = evsel__intval(evsel, &sample, "flags");
> perf_sample__exit(&sample);
> - if (flags != tp_flags) {
> + /* C library wrapper may set additional flags */
> + if ((tp_flags & flags) != flags) {
Does this check still verify the O_RDONLY access mode?
Since O_RDONLY is defined as 0, the flags variable evaluates to exactly
O_DIRECTORY. This means the condition functionally becomes
(tp_flags & O_DIRECTORY) != O_DIRECTORY.
Does this unintentionally permit other access modes like O_WRONLY or O_RDWR,
and ignore other unrelated flags as long as O_DIRECTORY is set?
> pr_debug("%s: Expected flags=%#x, got %#x\n",
> __func__, flags, tp_flags);
> goto out_delete_evlist;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260427090225.794482-1-martin@kaiser.cx?part=2
next prev parent reply other threads:[~2026-04-27 9:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-27 9:01 [PATCH 0/3] perf: fix some tests for musl Martin Kaiser
2026-04-27 9:01 ` [PATCH 1/3] perf test: fix nanosleep check in the ftrace test Martin Kaiser
2026-04-27 9:01 ` [PATCH 2/3] perf test: fix sys_enter_openat event test for musl Martin Kaiser
2026-04-27 9:49 ` sashiko-bot [this message]
2026-04-27 9:01 ` [PATCH 3/3] perf test: fix "trace summary" test for musl-based systems Martin Kaiser
2026-04-27 9:57 ` sashiko-bot
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=20260427094939.4FB8EC19425@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=martin@kaiser.cx \
--cc=sashiko@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