[Devel] [PATCH RHEL10 COMMIT] fixup! ve, x86_64: add per-ve vdso mapping.

Konstantin Khorenko khorenko at virtuozzo.com
Fri Jun 5 21:31:57 MSK 2026


The commit is pushed to "branch-rh10-6.12.0-55.52.1.5.x.vz10-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git
after rh10-6.12.0-55.52.1.5.29.vz10
------>
commit a68f9d0b9805871a421920c513b76429868662db
Author: Vladimir Riabchun <vladimir.riabchun at virtuozzo.com>
Date:   Tue Jun 2 21:10:21 2026 +0000

    fixup! ve, x86_64: add per-ve vdso mapping.
    
    With !CONFIG_VE get_exec_env() returns NULL, all accesses to
    vdso fields are done without config check.
    Add helper that return pointer to vdso_image_64 object
    when !CONFIG_VE.
    
    https://virtuozzo.atlassian.net/browse/VSTOR-130116
    
    Feature: !CONFIG_VE build
    Signed-off-by: Vladimir Riabchun <vladimir.riabchun at virtuozzo.com>
    Reviewed-by: Vasileios Almpanis <vasileios.almpanis at virtuozzo.com>
---
 arch/x86/entry/vdso/vma.c    |  2 +-
 arch/x86/kernel/process_64.c |  2 +-
 include/linux/ve.h           | 10 ++++++++++
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/arch/x86/entry/vdso/vma.c b/arch/x86/entry/vdso/vma.c
index 6427a3a10d15c..63adef63f89b4 100644
--- a/arch/x86/entry/vdso/vma.c
+++ b/arch/x86/entry/vdso/vma.c
@@ -320,7 +320,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
 	if (!vdso64_enabled)
 		return 0;
 
-	return map_vdso(get_exec_env()->vdso_64, 0);
+	return map_vdso(ve_get_vdso_64(get_exec_env()), 0);
 }
 
 #ifdef CONFIG_COMPAT
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 18a02b62cc370..826bc3ba236f9 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -948,7 +948,7 @@ long do_arch_prctl_64(struct task_struct *task, int option, unsigned long arg2)
 		return prctl_map_vdso(get_exec_env()->vdso_32, arg2);
 # endif
 	case ARCH_MAP_VDSO_64:
-		return prctl_map_vdso(get_exec_env()->vdso_64, arg2);
+		return prctl_map_vdso(ve_get_vdso_64(get_exec_env()), arg2);
 #endif
 #ifdef CONFIG_ADDRESS_MASKING
 	case ARCH_GET_UNTAG_MASK:
diff --git a/include/linux/ve.h b/include/linux/ve.h
index 224acf012821f..a7abca2849dc1 100644
--- a/include/linux/ve.h
+++ b/include/linux/ve.h
@@ -279,6 +279,11 @@ extern bool is_ve_init_net(const struct net *net);
 
 void ve_setup_task(struct task_struct *p, struct ve_struct *ve);
 
+static inline struct vdso_image *ve_get_vdso_64(struct ve_struct *ve)
+{
+	return ve->vdso_64;
+}
+
 #else	/* CONFIG_VE */
 #include <linux/init_task.h>
 #define get_ve(ve)	((void)(ve), NULL)
@@ -336,6 +341,11 @@ static inline int vz_security_protocol_check(struct net *net, int protocol) { re
 
 static inline void ve_setup_task(struct task_struct *p, struct ve_struct *ve) { }
 
+static inline struct vdso_image *ve_get_vdso_64(struct ve_struct *ve)
+{
+	return (struct vdso_image *)&vdso_image_64;
+}
+
 #endif	/* CONFIG_VE */
 
 struct seq_file;


More information about the Devel mailing list