Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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);
Add Comment
Please, Sign In to add comment