From: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
To: Konstantin Khorenko <khorenko@virtuozzo.com>
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.2 v3 3/3] selftests/ve: check repeated slashes in a permission path
Date: Tue, 1 Dec 2026 14:26:08 +0100 [thread overview]
Message-ID: <712ef7e7-fdd9-404f-9ca6-8d015d5fcbea@virtuozzo.com> (raw)
In-Reply-To: <010701a231b6955c-d5f0c533-0e7a-45c5-8be5-7ad9f87cfb31-000000@eu-central-1.amazonses.com>
On 12/1/26 14:06, no-reply@sashiko.virtuozzo.com wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential
> issue to consider:
> - [Low] selftests/ve: default_granted() uses substring match, can
> falsely skip
> --
>
> commit 3756d348a3f9b28f1c4ff13f32050647e7b022f1
> Author: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
>
> selftests/ve: check repeated slashes in a permission path
>
> The commit adds a repeated_slashes test to ve_perms_test.c. It writes a rule using a path with repeated slashes, such as "kernel//vmcoreinfo", and checks that the rule applies to the single-slash path and that a VE can read the file.
>
>> diff --git a/tools/testing/selftests/ve/ve_perms_test.c b/tools/testing/selftests/ve/ve_perms_test.c
>> --- a/tools/testing/selftests/ve/ve_perms_test.c
>> +++ b/tools/testing/selftests/ve/ve_perms_test.c
>
> [ ... ]
>
>> + if (!entry_present(variant->dir_prefix, file))
>> + SKIP(return, "%s absent under %s", file, variant->dir_prefix);
>> + if (default_granted(self->cgv2_fd, variant->fs, file))
>> + SKIP(return, "%s granted by default", file);
>
> [Severity: Low]
> Can this skip wrongly? default_granted() tests each line of ve.default_<fs>_permissions with strstr(line, entry), which matches anywhere in the line. A default entry that only contains "kernel/vmcoreinfo" or "bus/pci/devices" as a substring, for example a longer path, makes the helper return 1. The test then skips with "granted by default" even though the file isn't granted by default, and the repeated-slash coverage is silently lost.
>
> default_granted() predates this patch, but this new caller adds another dependence on it. Would comparing the path field of each line exactly avoid the false skip?
>
> Carry the trailer below into the next revision and Sashiko will not review this patch again.
>
> Reviewed-by: Sashiko <no-reply@sashiko.virtuozzo.com>
default_granted() predates this series and enforce_denies uses it the same way. For these two entries a false match is highly unlikely: both are files, so nothing sits below them, and no sysfs/proc path ends in them today. A skip would also be reported by kselftest, not silent. I'll keep the helper as is here; an exact path-field compare can go as a separate cleanup if we want it.
>
--
Best regards, Pavel Tikhomirov
Senior Software Developer, Virtuozzo.
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next prev parent reply other threads:[~2026-12-01 13:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 13:02 [Devel] [PATCH hci-8.2 v3 0/3] ve: count repeated slashes in a permission path as one Pavel Tikhomirov
2026-12-01 13:02 ` [Devel] [PATCH hci-8.2 v3 1/3] ve/kernfs: " Pavel Tikhomirov
2026-12-01 13:02 ` [Devel] [PATCH hci-8.2 v3 2/3] fs/proc, ve: " Pavel Tikhomirov
2026-12-01 13:02 ` [Devel] [PATCH hci-8.2 v3 3/3] selftests/ve: check repeated slashes in a permission path Pavel Tikhomirov
2026-12-01 13:06 ` no-reply
2026-12-01 13:26 ` Pavel Tikhomirov [this message]
2026-12-01 13:49 ` Vasileios Almpanis
2026-12-01 15:37 ` [Devel] [PATCH hci-8.2 v3 0/3] ve: count repeated slashes in a permission path as one Konstantin Khorenko
2026-12-01 15:38 ` Konstantin Khorenko
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=712ef7e7-fdd9-404f-9ca6-8d015d5fcbea@virtuozzo.com \
--to=ptikhomirov@virtuozzo.com \
--cc=devel@openvz.org \
--cc=khorenko@virtuozzo.com \
/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