get_exec_env() is dereferenced without check.

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

Feature: !CONFIG_VE build
Signed-off-by: Vladimir Riabchun <[email protected]>
---
 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

_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to