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

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


I won't apply this version, please send v2 with the changes below.
The code of 1/3 and 2/3 is right; one comment, the messages and the
test change.

On Tue, 1 Dec 2026 12:43:28 +0100, Pavel Tikhomirov wrote:
> Patch 1 skips empty components in ve.sysfs_permissions, as a path
> lookup does, patch 2 does the same in ve.proc_permissions, patch 3 adds
> a selftest.

1. Patch 1 message: say what else changes. A leading slash ("/kernel
   rx") used to set the sysfs root and now sets kernel. "dir//missing"
   used to set dir and succeed; now it fails with -ENOENT, and the
   rest of that write is dropped.
2. Patch 2: the comment "empty or leading-slash path walks to
   nothing" is stale; only a path of slashes gets there now.
3. Patch 2 message: "sys//kernel" is not a working example: /proc/sys
   has no proc_dir_entry children, so it fails with -ENOENT with or
   without the patch. "the same way as kernfs_perms_set()" names the
   loop patch 1 removes. The -ENOENT change of item 1 applies here
   too.
4. Patch 3: the proc case "//interrupts" has only leading slashes, so
   a walk that still stops at an inner empty component passes it. Put
   an empty component inside the path. The test comment wants one
   line.

The rule table in patch 1 and here: an ASCII box table, please.

Separate patches, not needed for this series. I created a task:

1. kernfs_walk_ns() does not check that the node it reached is a
   directory. A path through a file ("kernel/vmcoreinfo/x") makes
   kernfs_find_ns() read the file's attr.open as dir.children. Mainline
   has the same code and reaches it from cgroup_get_from_path() (the
   xt_cgroup path match), so it is for mainline first.
   https://virtuozzo.atlassian.net/browse/VSTOR-158293

-- 
Konstantin Khorenko,
Virtuozzo Linux Kernel Team



More information about the Devel mailing list