OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
From: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
To: khorenko@virtuozzo.com
Cc: devel@openvz.org
Subject: [Devel] [PATCH hci-8.1] selftests: ve: grant the root directory as well
Date: Mon,  2 Nov 2026 16:08:56 +0200	[thread overview]
Message-ID: <20261102140914.2315569-1-eva.kurchatova@virtuozzo.com> (raw)

allow_path() grants every directory above a file except the root, so a
fresh VE can reach the file only if the default permissions already let
it traverse the root, as vzctl sets them at boot. Without that,
ve_perms.sysfs.enforce_allows fails. Grant the root too, proc refuses an
entry for its root with EINVAL, as its root is always reachable.

Fixes: ce7800c78ae9 ("selftests: ve: grant the directories the files sit in")
Feature: fix selftests
Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
---
 tools/testing/selftests/ve/ve_perms_test.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/testing/selftests/ve/ve_perms_test.c b/tools/testing/selftests/ve/ve_perms_test.c
index 8096b1fa3b43..c57325d10901 100644
--- a/tools/testing/selftests/ve/ve_perms_test.c
+++ b/tools/testing/selftests/ve/ve_perms_test.c
@@ -351,6 +351,8 @@ static int allow_path(int cgv2_fd, const char *path, const char *file)
 	char dir[PATH_MAX];
 	const char *sep;
 
+	if (set_entry(cgv2_fd, path, "/", "x") < 0 && errno != EINVAL)
+		return -1;
 	for (sep = strchr(file, '/'); sep; sep = strchr(sep + 1, '/')) {
 		if (snprintf(dir, sizeof(dir), "%.*s", (int)(sep - file),
 			     file) >= (int)sizeof(dir))
-- 
2.56.0

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

             reply	other threads:[~2026-11-02 14:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-02 14:08 Eva Kurchatova [this message]
2026-11-02 14:12 ` no-reply
2026-11-02 17:23 ` 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=20261102140914.2315569-1-eva.kurchatova@virtuozzo.com \
    --to=eva.kurchatova@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