From: sashiko-bot@kernel.org
Cc: linux-security-module@vger.kernel.org
Subject: Re: [PATCH] selftests/landlock: fix the regex_escape() error check
Date: Tue, 03 Nov 2026 16:43:20 +0000 [thread overview]
Message-ID: <sashiko-outbox-195742@kernel.org> (raw)
In-Reply-To: <20261103163917.641130-1-sashal@kernel.org>
> regex_escape() returns (char *)-ENOMEM when the buffer is too small, but
> matches_log_fs_extra() checks the returned pointer with "< 0", which is
> never true, and goes on with a bogus cursor. On 32-bit architectures gcc
> also warns about the cast of the pointer in the error return:
>
> fs_test.c:7474:24: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
>
> Compare against (char *)-ENOMEM instead.
>
> The size left after the escaped path also subtracts the prefix a second
> time, which can make a long path fail with -E2BIG. Compute it from the
> cursor instead.
>
> Fixes: 316d06b01130 ("selftests/landlock: Add audit tests for filesystem")
> Signed-off-by: Sasha Levin <sashal@kernel.org>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261103163917.641130-1-sashal@kernel.org?part=1
next prev parent reply other threads:[~2026-11-03 16:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 16:39 [PATCH] selftests/landlock: fix the regex_escape() error check Sasha Levin
2026-11-03 16:43 ` sashiko-bot [this message]
2026-11-03 20:31 ` Günther Noack
2026-11-03 21:49 ` Sasha Levin
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=sashiko-outbox-195742@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-security-module@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