[Devel] [PATCH hci-8.2 2/3] fs/proc, ve: count repeated slashes in a permission path as one
no-reply at sashiko.virtuozzo.com
no-reply at sashiko.virtuozzo.com
Tue Dec 1 14:49:39 MSK 2026
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] fs/proc, ve: stale comment in proc_perms_set() on leading-slash
rejection
--
commit 40f4dae0564b0723083b940916132ada5d90897a
Author: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
fs/proc, ve: count repeated slashes in a permission path as one
proc_perms_set() now skips empty path components instead of stopping at the first one. A rule such as "sys//kernel" therefore reaches sys/kernel, and a leading slash no longer ends the walk at the proc root.
> diff --git a/fs/proc/ve.c b/fs/proc/ve.c
> index d957510c353a8..e24cc8b5d3192 100644
> --- a/fs/proc/ve.c
> +++ b/fs/proc/ve.c
> @@ -143,8 +143,9 @@ static int proc_perms_set(char *path, struct ve_struct *ve, int mask)
> if (sep)
> *sep++ = 0;
>
> + /* Repeated slashes count as one, as in a path lookup */
> if (!*dname)
> - break;
> + continue;
>
> nde = pde_subdir_find(de, dname, strlen(dname));
> if (!nde) {
[ ... ]
/* empty or leading-slash path walks to nothing, reject it */
if (de == &proc_root) {
[Severity: Low]
This isn't a bug, but is this comment now stale? With continue, a leading slash is skipped, so "/sys" resolves to sys. Only an empty or all-slash path leaves de at proc_root and reaches this -EINVAL. The comment also contradicts the new one added above. Could it say "empty or all-slash path walks to nothing, reject it"?
Carry the trailer below into the next revision and Sashiko will not review this patch again.
Reviewed-by: Sashiko <no-reply at sashiko.virtuozzo.com>
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261201-ve-perms-skip-slashes-v1-0-a444e8767c3e@virtuozzo.com?part=2
More information about the Devel
mailing list