Created
January 16, 2019 21:54
-
-
Save laurelmay/a888b5b17f5762e5c8af3603834e272c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: src/VBox/Runtime/r0drv/linux/memuserkernel-r0drv-linux.c | |
=================================================================== | |
--- src/VBox/Runtime/r0drv/linux/memuserkernel-r0drv-linux.c (revision 76826) | |
+++ src/VBox/Runtime/r0drv/linux/memuserkernel-r0drv-linux.c (working copy) | |
@@ -66,7 +66,11 @@ | |
RTR0DECL(bool) RTR0MemUserIsValidAddr(RTR3PTR R3Ptr) | |
{ | |
IPRT_LINUX_SAVE_EFL_AC(); | |
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0) | |
+ bool fRc = access_ok((void *)R3Ptr, 1); | |
+#else | |
bool fRc = access_ok(VERIFY_READ, (void *)R3Ptr, 1); | |
+#endif | |
IPRT_LINUX_RESTORE_EFL_AC(); | |
return fRc; | |
} | |
@@ -82,7 +86,11 @@ | |
return (uintptr_t)pv >= PAGE_OFFSET; | |
#else | |
# error "PORT ME" | |
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0) | |
+ return !access_ok(pv, 1); | |
+#else | |
return !access_ok(VERIFY_READ, pv, 1); | |
+#endif /* LINUX_VERSION_CODE */ | |
#endif | |
} | |
RT_EXPORT_SYMBOL(RTR0MemKernelIsValidAddr); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment