Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ObserverHerb/1df36cfce9aecfd102881b8c137ce99c to your computer and use it in GitHub Desktop.
Save ObserverHerb/1df36cfce9aecfd102881b8c137ce99c to your computer and use it in GitHub Desktop.
Kernel 4.9-rc5 vs. app-emulation/virtualbox-modules-5.1.8
--- work/vboxdrv/r0drv/linux/memobj-r0drv-linux.c 2016-08-17 04:35:26.000000000 -0400
+++ work/vboxdrv/r0drv/linux/memobj-r0drv-linux.cb 2016-11-19 03:45:05.024142802 -0500
@@ -1045,12 +1045,20 @@
/*
* Get user pages.
*/
+
+ unsigned int flags = 0;
+
+ if (fWrite)
+ {
+ flags |= FOLL_WRITE;
+ flags |= FOLL_FORCE;
+ }
+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
if (R0Process == RTR0ProcHandleSelf())
rc = get_user_pages(R3Ptr, /* Where from. */
cPages, /* How many pages. */
- fWrite, /* Write to memory. */
- fWrite, /* force write access. */
+ flags,
&pMemLnx->apPages[0], /* Page array. */
papVMAs); /* vmas */
/*
@@ -1063,8 +1071,7 @@
pTask->mm, /* Whose pages. */
R3Ptr, /* Where from. */
cPages, /* How many pages. */
- fWrite, /* Write to memory. */
- fWrite, /* force write access. */
+ flags,
&pMemLnx->apPages[0], /* Page array. */
papVMAs); /* vmas */
#else /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0) */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment