[Devel] [PATCH RHEL10 COMMIT] fixup! ia32: add 32-bit vdso virtualization.

Konstantin Khorenko khorenko at virtuozzo.com
Fri Jun 5 21:31:58 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 bddb4a8c0ad18184efd8cf8da4c6f0b4f90a35e4
Author: Vladimir Riabchun <vladimir.riabchun at virtuozzo.com>
Date:   Tue Jun 2 21:10:22 2026 +0000

    fixup! ia32: add 32-bit vdso virtualization.
    
    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_32 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    |  4 ++--
 arch/x86/kernel/process_64.c |  2 +-
 include/linux/ve.h           | 10 ++++++++++
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/arch/x86/entry/vdso/vma.c b/arch/x86/entry/vdso/vma.c
index 63adef63f89b4..04b5134362ebf 100644
--- a/arch/x86/entry/vdso/vma.c
+++ b/arch/x86/entry/vdso/vma.c
@@ -80,7 +80,7 @@ static void vdso_fix_landing(const struct vdso_image *image,
 		struct vm_area_struct *new_vma)
 {
 #if defined CONFIG_X86_32 || defined CONFIG_IA32_EMULATION
-	if (in_ia32_syscall() && image == get_exec_env()->vdso_32) {
+	if (in_ia32_syscall() && image == ve_get_vdso_32(get_exec_env())) {
 		struct pt_regs *regs = current_pt_regs();
 		unsigned long vdso_land = image->sym_int80_landing_pad;
 		unsigned long old_land_addr = vdso_land +
@@ -310,7 +310,7 @@ static int load_vdso32(void)
 	if (vdso32_enabled != 1)  /* Other values all mean "disabled" */
 		return 0;
 
-	return map_vdso(get_exec_env()->vdso_32, 0);
+	return map_vdso(ve_get_vdso_32(get_exec_env()), 0);
 }
 #endif
 
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 826bc3ba236f9..3761380d68dab 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -945,7 +945,7 @@ long do_arch_prctl_64(struct task_struct *task, int option, unsigned long arg2)
 # endif
 # if defined CONFIG_X86_32 || defined CONFIG_IA32_EMULATION
 	case ARCH_MAP_VDSO_32:
-		return prctl_map_vdso(get_exec_env()->vdso_32, arg2);
+		return prctl_map_vdso(ve_get_vdso_32(get_exec_env()), arg2);
 # endif
 	case ARCH_MAP_VDSO_64:
 		return prctl_map_vdso(ve_get_vdso_64(get_exec_env()), arg2);
diff --git a/include/linux/ve.h b/include/linux/ve.h
index a7abca2849dc1..c64860664b627 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_32(struct ve_struct *ve)
+{
+	return ve->vdso_32;
+}
+
 static inline struct vdso_image *ve_get_vdso_64(struct ve_struct *ve)
 {
 	return ve->vdso_64;
@@ -341,6 +346,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_32(struct ve_struct *ve)
+{
+	return (struct vdso_image *)&vdso_image_32;
+}
+
 static inline struct vdso_image *ve_get_vdso_64(struct ve_struct *ve)
 {
 	return (struct vdso_image *)&vdso_image_64;


More information about the Devel mailing list