From 4122f0cd242391a0fcf1ba9bc3882fd333ee9fe518788ec09ddf513efbe93407 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Thu, 15 Jul 2021 01:13:33 +0000 Subject: [PATCH] Accepting request 906360 from home:lwfinger:branches:Virtualization - Add file "fix_random_stack_failure.patch" to fix CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT problem with kernel 5.13 as shown in boo#118105. OBS-URL: https://build.opensuse.org/request/show/906360 OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=610 --- fix_random_stack_failure.patch | 23 +++++++++++++++++++++++ virtualbox.changes | 6 ++++++ virtualbox.spec | 30 +++++++++++++++++++++--------- 3 files changed, 50 insertions(+), 9 deletions(-) create mode 100644 fix_random_stack_failure.patch diff --git a/fix_random_stack_failure.patch b/fix_random_stack_failure.patch new file mode 100644 index 0000000..1a03071 --- /dev/null +++ b/fix_random_stack_failure.patch @@ -0,0 +1,23 @@ +Index: VirtualBox-6.1.22/src/VBox/VMM/VMMR0/VMMR0JmpA-amd64.asm +=================================================================== +--- VirtualBox-6.1.22.orig/src/VBox/VMM/VMMR0/VMMR0JmpA-amd64.asm ++++ VirtualBox-6.1.22/src/VBox/VMM/VMMR0/VMMR0JmpA-amd64.asm +@@ -32,10 +32,17 @@ + %define STACK_PADDING 0eeeeeeeeeeeeeeeeh + + ;; Workaround for linux 4.6 fast/slow syscall stack depth difference. ++;; Update: This got worse with linux 5.13 and CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT. ++;; The x86 arch_exit_to_user_mode_prepare code limits the offset to 255, ++;; while the generic limit is 1023. See bugref:10064 for details. + %ifdef VMM_R0_SWITCH_STACK + %define STACK_FUZZ_SIZE 0 + %else +- %define STACK_FUZZ_SIZE 128 ++ %ifdef RT_OS_LINUX ++ %define STACK_FUZZ_SIZE 384 ++ %else ++ %define STACK_FUZZ_SIZE 128 ++ %endif + %endif + + diff --git a/virtualbox.changes b/virtualbox.changes index e9f07bd..d8586ab 100644 --- a/virtualbox.changes +++ b/virtualbox.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Jul 15 00:31:08 UTC 2021 - Larry Finger + +- Add file "fix_random_stack_failure.patch" to fix CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT + problem with kernel 5.13 as shown in boo#118105. + ------------------------------------------------------------------- Wed Jul 14 04:03:16 UTC 2021 - Larry Finger diff --git a/virtualbox.spec b/virtualbox.spec index 24d55e8..a7d4f00 100644 --- a/virtualbox.spec +++ b/virtualbox.spec @@ -188,6 +188,8 @@ Patch139: fixes_for_leap15.3.patch Patch141: vb-6.1.16-modal-dialog-parent.patch # Fixes for kernel 5.14 Patch142: fixes_for_5.14.patch +# Fix for CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT +Patch143: fix_random_stack_failure.patch Patch999: virtualbox-fix-ui-background-color.patch # @@ -343,8 +345,9 @@ the terms of the GNU Public License (GPL). -########################################## + +########################################## %package qt Summary: Qt GUI part for %{name} Group: System/Emulators/PC @@ -392,8 +395,9 @@ This package contains the code for the GUI used to control VMs. -######################################### + +######################################### %package websrv Summary: WebService GUI part for %{name} Group: System/Emulators/PC @@ -435,8 +439,9 @@ The VirtualBox web server is used to control headless VMs using a browser. -######################################### + +######################################### %package guest-x11 Summary: VirtualBox X11 drivers for mouse and video Group: System/X11/Servers/XF86_4 @@ -480,8 +485,9 @@ This package contains X11 guest utilities and X11 guest mouse and video drivers -########################################### + +########################################### %package guest-tools Summary: VirtualBox guest tools Group: System/Emulators/PC @@ -530,8 +536,9 @@ VirtualBox guest addition tools. -########################################### + +########################################### %package -n python3-%{name} Summary: Python bindings for %{name} Group: Development/Libraries/Python @@ -580,8 +587,9 @@ Python XPCOM bindings to %{name}. Used e.g. by vboxgtk package. -########################################### + +########################################### %package devel Summary: Devel files for %{name} Group: Development/Libraries/Other @@ -625,8 +633,9 @@ Development file for %{name} -########################################### + +########################################### %package host-source Summary: Source files for %{name} host kernel modules Group: Development/Sources @@ -672,8 +681,9 @@ sudo /sbin/vboxguestconfig -########################################### + +########################################### %package guest-desktop-icons Summary: Icons for guest desktop files Group: System/Emulators/PC @@ -715,8 +725,9 @@ This package contains icons for guest desktop files that were created on the des -########################################### + +########################################### %package vnc Summary: VNC desktop sharing Group: System/Emulators/PC @@ -789,6 +800,7 @@ This package contains the kernel-modules that VirtualBox uses to create or run v %endif %patch141 -p1 %patch142 -p1 +%patch143 -p1 # make VB UI background colors look sane again %patch999 -p1