OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
* [Devel] [PATCH hci-8.2 0/3] ve: count repeated slashes in a permission path as one
@ 2026-12-01 11:43 Pavel Tikhomirov
  2026-12-01 11:43 ` [Devel] [PATCH hci-8.2 1/3] ve/kernfs: " Pavel Tikhomirov
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Pavel Tikhomirov @ 2026-12-01 11:43 UTC (permalink / raw)
  To: Konstantin Khorenko; +Cc: devel

A ve.sysfs_permissions rule with an empty path component is applied to
the node before it, not to the one the path names:

  rule                     applied to
  cpuN/cache/uevent rw     cpuN/cache/uevent
  cpuN/cache//uevent rw    cpuN/cache

vzctl writes such rules for cpuN/cache, so in every Container this
directory is "rw" without "x" and nothing below it can be looked up.
A recent mongod 8.0 reads cpuN/cache/indexM/shared_cpu_list on start,
gets EACCES and aborts (vzt-criu-docker, react-express-mongodb).

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.

https://virtuozzo.atlassian.net/browse/VSTOR-158149

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
---
Pavel Tikhomirov (3):
      ve/kernfs: count repeated slashes in a permission path as one
      fs/proc, ve: count repeated slashes in a permission path as one
      selftests/ve: check repeated slashes in a permission path

 fs/kernfs/ve.c                             | 29 +++++------------------------
 fs/proc/ve.c                               |  3 ++-
 tools/testing/selftests/ve/ve_perms_test.c | 28 ++++++++++++++++++++++++++++
 3 files changed, 35 insertions(+), 25 deletions(-)
---
base-commit: beda1840d22b7707e3f8e18f413afbfffef93d25
change-id: 20261201-ve-perms-skip-slashes-3b989857978a

Best regards,
--  
Pavel Tikhomirov <ptikhomirov@virtuozzo.com>

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Devel] [PATCH hci-8.2 1/3] ve/kernfs: count repeated slashes in a permission path as one
  2026-12-01 11:43 [Devel] [PATCH hci-8.2 0/3] ve: count repeated slashes in a permission path as one Pavel Tikhomirov
@ 2026-12-01 11:43 ` Pavel Tikhomirov
  2026-12-01 11:50   ` no-reply
  2026-12-01 12:19   ` Konstantin Khorenko
  2026-12-01 11:43 ` [Devel] [PATCH hci-8.2 2/3] fs/proc, ve: " Pavel Tikhomirov
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 12+ messages in thread
From: Pavel Tikhomirov @ 2026-12-01 11:43 UTC (permalink / raw)
  To: Konstantin Khorenko; +Cc: devel

kernfs_perms_set() stops at the first empty component of the path and
applies the mode to the node it reached so far:

  rule                     applied to
  cpuN/cache/uevent rw     cpuN/cache/uevent
  cpuN/cache//uevent rw    cpuN/cache

vzctl writes such rules: it passes the cpuN/cache directory with a
trailing slash and appends "/<child>" for each child, so in every
Container cpuN/cache ends up "rw" without "x". A recent mongod 8.0
(tcmalloc) reads cpuN/cache/indexM/shared_cpu_list on start, gets EACCES
and aborts.

Walk the path with kernfs_walk_and_get(), which skips empty components
as a path lookup does.

https://virtuozzo.atlassian.net/browse/VSTOR-158149

Fixes: 57739dce06d0 ("ve/kernfs: add new interface to control per-VE nodes visibility")
Feature: sysfs: per-CT entries visibility and permissions configuration
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
---
 fs/kernfs/ve.c | 29 +++++------------------------
 1 file changed, 5 insertions(+), 24 deletions(-)

diff --git a/fs/kernfs/ve.c b/fs/kernfs/ve.c
index 1097fd30598e3..963760b3ac73d 100644
--- a/fs/kernfs/ve.c
+++ b/fs/kernfs/ve.c
@@ -252,33 +252,14 @@ int kernfs_perms_show(struct seq_file *m, void *v, struct kmapset_key *key)
 int kernfs_perms_set(char *path, struct ve_struct *ve, int mask,
 		     struct kernfs_node *root, struct kmapset_key *key)
 {
-	struct kernfs_node *kn = root, *nkn;
-	char *sep = path, *dname;
-	int ret = 0;
+	struct kernfs_node *kn;
+	int ret;
 
-	kernfs_get(kn);
-	do {
-		dname = sep;
-
-		sep = strchr(sep, '/');
-		if (sep)
-			*sep++ = 0;
-
-		if (!*dname)
-			break;
-
-		nkn = kernfs_find_and_get(kn, dname);
-		if (!nkn) {
-			ret = -ENOENT;
-			goto out;
-		}
-
-		kernfs_put(kn);
-		kn = nkn;
-	} while (sep);
+	kn = kernfs_walk_and_get(root, path);
+	if (!kn)
+		return -ENOENT;
 
 	ret = ve_perms_apply(&kn->ve_perms_map, key, ve_is_super(ve), mask);
-out:
 	kernfs_put(kn);
 	return ret;
 }

-- 
2.56.0

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Devel] [PATCH hci-8.2 2/3] fs/proc, ve: count repeated slashes in a permission path as one
  2026-12-01 11:43 [Devel] [PATCH hci-8.2 0/3] ve: count repeated slashes in a permission path as one Pavel Tikhomirov
  2026-12-01 11:43 ` [Devel] [PATCH hci-8.2 1/3] ve/kernfs: " Pavel Tikhomirov
@ 2026-12-01 11:43 ` Pavel Tikhomirov
  2026-12-01 11:49   ` no-reply
  2026-12-01 12:19   ` Konstantin Khorenko
  2026-12-01 11:43 ` [Devel] [PATCH hci-8.2 3/3] selftests/ve: check repeated slashes in a permission path Pavel Tikhomirov
  2026-12-01 12:19 ` [Devel] [PATCH hci-8.2 0/3] ve: count repeated slashes in a permission path as one Konstantin Khorenko
  3 siblings, 2 replies; 12+ messages in thread
From: Pavel Tikhomirov @ 2026-12-01 11:43 UTC (permalink / raw)
  To: Konstantin Khorenko; +Cc: devel

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,
and one with a leading slash ends at the proc root and is rejected with
EINVAL.

Skip empty components as a path lookup does. procfs has no helper that
walks a path this way.

https://virtuozzo.atlassian.net/browse/VSTOR-158149

Fixes: 39c029dcf7fa ("fs/proc, ve: add per-VE ve.proc_permissions")
Feature: kernfs: per-CT entries visibility and permissions configuration
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
---
 fs/proc/ve.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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) {

-- 
2.56.0

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Devel] [PATCH hci-8.2 3/3] selftests/ve: check repeated slashes in a permission path
  2026-12-01 11:43 [Devel] [PATCH hci-8.2 0/3] ve: count repeated slashes in a permission path as one Pavel Tikhomirov
  2026-12-01 11:43 ` [Devel] [PATCH hci-8.2 1/3] ve/kernfs: " Pavel Tikhomirov
  2026-12-01 11:43 ` [Devel] [PATCH hci-8.2 2/3] fs/proc, ve: " Pavel Tikhomirov
@ 2026-12-01 11:43 ` Pavel Tikhomirov
  2026-12-01 11:51   ` no-reply
  2026-12-01 12:19   ` Konstantin Khorenko
  2026-12-01 12:19 ` [Devel] [PATCH hci-8.2 0/3] ve: count repeated slashes in a permission path as one Konstantin Khorenko
  3 siblings, 2 replies; 12+ messages in thread
From: Pavel Tikhomirov @ 2026-12-01 11:43 UTC (permalink / raw)
  To: Konstantin Khorenko; +Cc: devel

Each variant names its first file with repeated slashes as well,
"/kernel//vmcoreinfo" in sysfs and "//interrupts" in proc. With the
directories above the file traversable, write a rule for it and check
that the file gets the mode and a VE can read it.

https://virtuozzo.atlassian.net/browse/VSTOR-158149

Feature: kernfs: per-CT entries visibility and permissions configuration
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
---
 tools/testing/selftests/ve/ve_perms_test.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/tools/testing/selftests/ve/ve_perms_test.c b/tools/testing/selftests/ve/ve_perms_test.c
index 375f98c36f87e..d93e58e6c17b6 100644
--- a/tools/testing/selftests/ve/ve_perms_test.c
+++ b/tools/testing/selftests/ve/ve_perms_test.c
@@ -15,6 +15,7 @@
  *   - cover the write parser (masks, comments, several entries, replace,
  *     duplicate op, remove of an absent entry, missing mask) and check each
  *     entry renders at its true depth, a directory with a trailing slash
+ *   - confirm repeated slashes in a path count as one
  *   - enforce the r and x mask bits end to end from inside a VE
  */
 #define _GNU_SOURCE
@@ -46,6 +47,7 @@ FIXTURE_VARIANT(ve_perms)
 	const char *dir_prefix;		/* host mount point: "/proc" or "/sys" */
 	const char *files[NR_FILES];	/* host-only readable leaves */
 	const char *dir;		/* host-only directory */
+	const char *slashed;		/* files[0] with repeated slashes */
 };
 
 FIXTURE_VARIANT_ADD(ve_perms, proc)
@@ -54,6 +56,7 @@ FIXTURE_VARIANT_ADD(ve_perms, proc)
 	.dir_prefix	= "/proc",
 	.files		= { "interrupts", "slabinfo" },
 	.dir		= "bus",
+	.slashed	= "//interrupts",
 };
 
 FIXTURE_VARIANT_ADD(ve_perms, sysfs)
@@ -62,6 +65,7 @@ FIXTURE_VARIANT_ADD(ve_perms, sysfs)
 	.dir_prefix	= "/sys",
 	.files		= { "kernel/vmcoreinfo", "kernel/notes" },
 	.dir		= "power",
+	.slashed	= "/kernel//vmcoreinfo",
 };
 
 /* The per-VE cgroup file for this ctid and filesystem. */
@@ -373,6 +377,30 @@ static int allow_paths(int cgv2_fd, const char *path, const char *const files[])
 	return 0;
 }
 
+/*
+ * Repeated slashes count as one, as in a path lookup: "/kernel//vmcoreinfo r"
+ * sets kernel/vmcoreinfo, not the directory before the empty component, and
+ * the VE can read the file.
+ */
+TEST_F(ve_perms, repeated_slashes)
+{
+	const char *file = variant->files[0];
+	char path[PATH_MAX], line[PATH_MAX], buf[8192];
+
+	if (!entry_present(variant->dir_prefix, file))
+		SKIP(return, "%s absent under %s", file, variant->dir_prefix);
+
+	ve_file(path, sizeof(path), self->ctid_a, variant->fs);
+
+	ASSERT_EQ(allow_path(self->cgv2_fd, path, file), 0);
+	ASSERT_EQ(set_entry(self->cgv2_fd, path, variant->slashed, "r"), 0);
+	ASSERT_GT(read_file_at(self->cgv2_fd, path, buf, sizeof(buf)), 0);
+	snprintf(line, sizeof(line), "%s r\n", file);
+	EXPECT_NE(strstr(buf, line), NULL);
+	EXPECT_EQ(ve_open_rel(self->cgv2_fd, self->ctid_a, variant->dir_prefix,
+			      file, O_RDONLY), 0);
+}
+
 /*
  * Enforcement, allowed side: from inside a VE, granting r lets each file be
  * read, and granting x on the directory lets it be traversed (the lookup then

-- 
2.56.0

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Devel] [PATCH hci-8.2 2/3] fs/proc, ve: count repeated slashes in a permission path as one
  2026-12-01 11:43 ` [Devel] [PATCH hci-8.2 2/3] fs/proc, ve: " Pavel Tikhomirov
@ 2026-12-01 11:49   ` no-reply
  2026-12-01 12:19   ` Konstantin Khorenko
  1 sibling, 0 replies; 12+ messages in thread
From: no-reply @ 2026-12-01 11:49 UTC (permalink / raw)
  To: Pavel Tikhomirov, Konstantin Khorenko; +Cc: devel

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@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@sashiko.virtuozzo.com>

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261201-ve-perms-skip-slashes-v1-0-a444e8767c3e@virtuozzo.com?part=2

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Devel] [PATCH hci-8.2 1/3] ve/kernfs: count repeated slashes in a permission path as one
  2026-12-01 11:43 ` [Devel] [PATCH hci-8.2 1/3] ve/kernfs: " Pavel Tikhomirov
@ 2026-12-01 11:50   ` no-reply
  2026-12-01 12:19   ` Konstantin Khorenko
  1 sibling, 0 replies; 12+ messages in thread
From: no-reply @ 2026-12-01 11:50 UTC (permalink / raw)
  To: Pavel Tikhomirov, Konstantin Khorenko; +Cc: devel

> kernfs_perms_set() stops at the first empty component of the path and
> applies the mode to the node it reached so far:
> 
>   rule                     applied to
>   cpuN/cache/uevent rw     cpuN/cache/uevent
>   cpuN/cache//uevent rw    cpuN/cache
> 
> vzctl writes such rules: it passes the cpuN/cache directory with a
> trailing slash and appends "/<child>" for each child, so in every
> Container cpuN/cache ends up "rw" without "x". A recent mongod 8.0
> (tcmalloc) reads cpuN/cache/indexM/shared_cpu_list on start, gets EACCES
> and aborts.
> 
> Walk the path with kernfs_walk_and_get(), which skips empty components
> as a path lookup does.
> 
> https://virtuozzo.atlassian.net/browse/VSTOR-158149
> 
> Fixes: 57739dce06d0 ("ve/kernfs: add new interface to control per-VE nodes visibility")
> Feature: sysfs: per-CT entries visibility and permissions configuration
> Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>

Sashiko has reviewed this patch and found no issues.

Carry the trailer below into the next revision and Sashiko will not review this patch again.

Reviewed-by: Sashiko <no-reply@sashiko.virtuozzo.com>

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261201-ve-perms-skip-slashes-v1-0-a444e8767c3e@virtuozzo.com?part=1


_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Devel] [PATCH hci-8.2 3/3] selftests/ve: check repeated slashes in a permission path
  2026-12-01 11:43 ` [Devel] [PATCH hci-8.2 3/3] selftests/ve: check repeated slashes in a permission path Pavel Tikhomirov
@ 2026-12-01 11:51   ` no-reply
  2026-12-01 12:19   ` Konstantin Khorenko
  1 sibling, 0 replies; 12+ messages in thread
From: no-reply @ 2026-12-01 11:51 UTC (permalink / raw)
  To: Pavel Tikhomirov, Konstantin Khorenko; +Cc: devel

> Each variant names its first file with repeated slashes as well,
> "/kernel//vmcoreinfo" in sysfs and "//interrupts" in proc. With the
> directories above the file traversable, write a rule for it and check
> that the file gets the mode and a VE can read it.
> 
> https://virtuozzo.atlassian.net/browse/VSTOR-158149
> 
> Feature: kernfs: per-CT entries visibility and permissions configuration
> Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>

Sashiko has reviewed this patch and found no issues.

Carry the trailer below into the next revision and Sashiko will not review this patch again.

Reviewed-by: Sashiko <no-reply@sashiko.virtuozzo.com>

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261201-ve-perms-skip-slashes-v1-0-a444e8767c3e@virtuozzo.com?part=3


_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Devel] [PATCH hci-8.2 1/3] ve/kernfs: count repeated slashes in a permission path as one
  2026-12-01 11:43 ` [Devel] [PATCH hci-8.2 1/3] ve/kernfs: " Pavel Tikhomirov
  2026-12-01 11:50   ` no-reply
@ 2026-12-01 12:19   ` Konstantin Khorenko
  2026-12-01 12:28     ` Pavel Tikhomirov
  1 sibling, 1 reply; 12+ messages in thread
From: Konstantin Khorenko @ 2026-12-01 12:19 UTC (permalink / raw)
  To: Pavel Tikhomirov; +Cc: devel

Item 1 of the cover letter reply.

On Tue, 1 Dec 2026 12:43:29 +0100, Pavel Tikhomirov wrote:
> Walk the path with kernfs_walk_and_get(), which skips empty components
> as a path lookup does.

Say what else changes with it: "/kernel rx" used to set the sysfs
root and now sets kernel; "dir//missing" used to set dir and now
fails with -ENOENT, which drops the rest of the write.

-- 
Konstantin Khorenko,
Virtuozzo Linux Kernel Team

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Devel] [PATCH hci-8.2 2/3] fs/proc, ve: count repeated slashes in a permission path as one
  2026-12-01 11:43 ` [Devel] [PATCH hci-8.2 2/3] fs/proc, ve: " Pavel Tikhomirov
  2026-12-01 11:49   ` no-reply
@ 2026-12-01 12:19   ` Konstantin Khorenko
  1 sibling, 0 replies; 12+ messages in thread
From: Konstantin Khorenko @ 2026-12-01 12:19 UTC (permalink / raw)
  To: Pavel Tikhomirov; +Cc: devel

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

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Devel] [PATCH hci-8.2 0/3] ve: count repeated slashes in a permission path as one
  2026-12-01 11:43 [Devel] [PATCH hci-8.2 0/3] ve: count repeated slashes in a permission path as one Pavel Tikhomirov
                   ` (2 preceding siblings ...)
  2026-12-01 11:43 ` [Devel] [PATCH hci-8.2 3/3] selftests/ve: check repeated slashes in a permission path Pavel Tikhomirov
@ 2026-12-01 12:19 ` Konstantin Khorenko
  3 siblings, 0 replies; 12+ messages in thread
From: Konstantin Khorenko @ 2026-12-01 12:19 UTC (permalink / raw)
  To: Pavel Tikhomirov; +Cc: devel

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

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Devel] [PATCH hci-8.2 3/3] selftests/ve: check repeated slashes in a permission path
  2026-12-01 11:43 ` [Devel] [PATCH hci-8.2 3/3] selftests/ve: check repeated slashes in a permission path Pavel Tikhomirov
  2026-12-01 11:51   ` no-reply
@ 2026-12-01 12:19   ` Konstantin Khorenko
  1 sibling, 0 replies; 12+ messages in thread
From: Konstantin Khorenko @ 2026-12-01 12:19 UTC (permalink / raw)
  To: Pavel Tikhomirov; +Cc: devel

Item 4 of the cover letter reply.

On Tue, 1 Dec 2026 12:43:31 +0100, Pavel Tikhomirov wrote:
> +	.slashed	= "//interrupts",

Only leading slashes: a walk that skips them but still stops at an
inner empty component passes this case. Put an empty component
inside the path, as the sysfs case does.

> +/*
> + * Repeated slashes count as one, as in a path lookup: "/kernel//vmcoreinfo r"
> + * sets kernel/vmcoreinfo, not the directory before the empty component, and
> + * the VE can read the file.
> + */

One line is enough for a test comment.

-- 
Konstantin Khorenko,
Virtuozzo Linux Kernel Team

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Devel] [PATCH hci-8.2 1/3] ve/kernfs: count repeated slashes in a permission path as one
  2026-12-01 12:19   ` Konstantin Khorenko
@ 2026-12-01 12:28     ` Pavel Tikhomirov
  0 siblings, 0 replies; 12+ messages in thread
From: Pavel Tikhomirov @ 2026-12-01 12:28 UTC (permalink / raw)
  To: Konstantin Khorenko; +Cc: devel



On 12/1/26 13:19, Konstantin Khorenko wrote:
> Item 1 of the cover letter reply.
> 
> On Tue, 1 Dec 2026 12:43:29 +0100, Pavel Tikhomirov wrote:
>> Walk the path with kernfs_walk_and_get(), which skips empty components
>> as a path lookup does.
> 
> Say what else changes with it: "/kernel rx" used to set the sysfs
> root and now sets kernel;
> "dir//missing" used to set dir and now
> fails with -ENOENT

No we should not say anything here, it's an excess information. We fix the path
handling to work on actual path all related behavior changes and implications are
obvious.
>, which drops the rest of the write.
> 

-- 
Best regards, Pavel Tikhomirov
Senior Software Developer, Virtuozzo.

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2026-12-01 12:30 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-01 11:43 [Devel] [PATCH hci-8.2 0/3] ve: count repeated slashes in a permission path as one Pavel Tikhomirov
2026-12-01 11:43 ` [Devel] [PATCH hci-8.2 1/3] ve/kernfs: " Pavel Tikhomirov
2026-12-01 11:50   ` no-reply
2026-12-01 12:19   ` Konstantin Khorenko
2026-12-01 12:28     ` Pavel Tikhomirov
2026-12-01 11:43 ` [Devel] [PATCH hci-8.2 2/3] fs/proc, ve: " Pavel Tikhomirov
2026-12-01 11:49   ` no-reply
2026-12-01 12:19   ` Konstantin Khorenko
2026-12-01 11:43 ` [Devel] [PATCH hci-8.2 3/3] selftests/ve: check repeated slashes in a permission path Pavel Tikhomirov
2026-12-01 11:51   ` no-reply
2026-12-01 12:19   ` Konstantin Khorenko
2026-12-01 12:19 ` [Devel] [PATCH hci-8.2 0/3] ve: count repeated slashes in a permission path as one Konstantin Khorenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox