virtualbox/vbox_fix_4.10_api_changes.patch
Larry Finger 798ba7e584 - The version bump to 5.1.14 also addresses boo#1020856 CVE-2017-3316 CVE-2017-3332 CVE-2017-3290 CVE-2016-5545
- Version bump to 5.1.14 (released 2017-01-17 by Oracle)
This is a maintenance release. The following items were fixed and/or added:
    VMM: fixed emulation of certain instructions for 64-bit guests on 32-bit hosts
    VMM: properly handle certain MSRs for 64-bit guests on ancient CPUs without VT-x support for MSR bitmaps (bug #13886)
    GUI: fixed a crash with multimonitor setups under certain conditions
    GUI: allow cloning of snapshots when the VM is running
    NVMe: fixed compatibility with the Storage Performance Development Kit (SPDK, bug #16368)
    VBoxSVC: fixed a crash under rare circumstances
    VBoxManage: added a sanity check to modifymedium --resize to prevent users from resizing their hard disk from 1GB to 1PB (bug #16311)
    Windows hosts: another fix for recent Windows 10 hosts
    Linux hosts: Linux 4.10 fixes
    Linux Additions: fixed protocol error during certain operations on shared folders (bug #8463)

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=304
2017-01-25 02:54:58 +00:00

68 lines
3.0 KiB
Diff

Index: VirtualBox-5.1.12/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
===================================================================
--- VirtualBox-5.1.12.orig/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
+++ VirtualBox-5.1.12/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
@@ -1078,7 +1078,12 @@ DECLHIDDEN(int) rtR0MemObjNativeLockUser
fWrite, /* force write access. */
# endif
&pMemLnx->apPages[0], /* Page array. */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
+ papVMAs, /* vmas */
+ NULL);
+#else
papVMAs); /* vmas */
+#endif
#else /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0) */
rc = get_user_pages(pTask, /* Task for fault accounting. */
pTask->mm, /* Whose pages. */
@@ -1093,7 +1098,12 @@ DECLHIDDEN(int) rtR0MemObjNativeLockUser
fWrite, /* force write access. */
# endif
&pMemLnx->apPages[0], /* Page array. */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
+ papVMAs, /* vmas */
+ NULL);
+#else
papVMAs); /* vmas */
+#endif
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0) */
if (rc == cPages)
{
Index: VirtualBox-5.1.12/src/VBox/Runtime/r0drv/linux/mpnotification-r0drv-linux.c
===================================================================
--- VirtualBox-5.1.12.orig/src/VBox/Runtime/r0drv/linux/mpnotification-r0drv-linux.c
+++ VirtualBox-5.1.12/src/VBox/Runtime/r0drv/linux/mpnotification-r0drv-linux.c
@@ -39,8 +39,32 @@
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 71) && defined(CONFIG_SMP)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
+/* This hack allows VB to build under kernel 4.10 and later, but it
+ * should be replaced with a version that uses the hotplug state machine
+ */
+static DEFINE_MUTEX(cpu_add_remove_lock);
+static RAW_NOTIFIER_HEAD(cpu_chain);
+/* Need to know about CPUs going up/down? */
+static int register_cpu_notifier(struct notifier_block *nb)
+{
+ int ret;
+ mutex_lock(&cpu_add_remove_lock);
+ ret = raw_notifier_chain_register(&cpu_chain, nb);
+ mutex_unlock(&cpu_add_remove_lock);
+ return ret;
+}
+
+/* Need to know about CPUs going up/down? */
+static void unregister_cpu_notifier(struct notifier_block *nb)
+{
+ mutex_lock(&cpu_add_remove_lock);
+ raw_notifier_chain_unregister(&cpu_chain, nb);
+ mutex_unlock(&cpu_add_remove_lock);
+}
+#endif
/*********************************************************************************************************************************
* Internal Functions *
*********************************************************************************************************************************/