[Devel] [PATCH hci-8.2 2/3] fs/proc, ve: count repeated slashes in a permission path as one

Konstantin Khorenko khorenko at virtuozzo.com
Tue Dec 1 15:19:46 MSK 2026


Items 2 and 3 of the cover letter reply.

On Tue, 1 Dec 2026 12:43:30 +0100, Pavel Tikhomirov wrote:
> proc_perms_set() walks the path the same way as kernfs_perms_set() and
> stops at the first empty component: a rule for "sys//kernel" sets sys,

/proc/sys has no proc_dir_entry children: "sys//kernel" fails with
-ENOENT with or without this patch. Take an entry that exists, such
as "bus//pci". After patch 1 kernfs_perms_set() no longer walks this
way; name the old loop instead. Say that "dir//missing" now fails
with -ENOENT instead of setting dir.

> +		/* Repeated slashes count as one, as in a path lookup */
>  		if (!*dname)
> -			break;
> +			continue;

The comment further down, "empty or leading-slash path walks to
nothing, reject it", is stale now: a leading slash is skipped, only a
path of slashes gets to that check. Sashiko said the same.

-- 
Konstantin Khorenko,
Virtuozzo Linux Kernel Team



More information about the Devel mailing list