[Devel] [PATCH hci-8.1] selftests: ve: grant the root directory as well

Eva Kurchatova eva.kurchatova at virtuozzo.com
Mon Nov 2 17:08:56 MSK 2026


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 at 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



More information about the Devel mailing list