[Devel] [PATCH VZ10 v4 08/44] fixup! fs: allow init Container user_ns to mount filesystems with FS_VE_MOUNT
Vladimir Riabchun
vladimir.riabchun at virtuozzo.com
Wed Jun 3 00:10:26 MSK 2026
get_exec_env() is dereferenced without check.
https://virtuozzo.atlassian.net/browse/VSTOR-130116
Feature: !CONFIG_VE build
Signed-off-by: Vladimir Riabchun <vladimir.riabchun at virtuozzo.com>
---
fs/super.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/super.c b/fs/super.c
index 2c266c869312..1adebbf35803 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -770,7 +770,11 @@ struct super_block *sget_fc(struct fs_context *fc,
struct super_block *s = NULL;
struct super_block *old;
struct user_namespace *user_ns = fc->global ? &init_user_ns : fc->user_ns;
+#ifdef CONFIG_VE
struct cred *cred = get_exec_env()->init_cred;
+#else
+ struct cred *cred = &init_cred;
+#endif
int err;
/*
--
2.47.1
More information about the Devel
mailing list