Guest User

Untitled

a guest
Jan 17th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. Index: src/VBox/Runtime/r0drv/linux/memuserkernel-r0drv-linux.c
  2. ===================================================================
  3. --- src/VBox/Runtime/r0drv/linux/memuserkernel-r0drv-linux.c (revision 76826)
  4. +++ src/VBox/Runtime/r0drv/linux/memuserkernel-r0drv-linux.c (working copy)
  5. @@ -66,7 +66,11 @@
  6. RTR0DECL(bool) RTR0MemUserIsValidAddr(RTR3PTR R3Ptr)
  7. {
  8. IPRT_LINUX_SAVE_EFL_AC();
  9. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)
  10. + bool fRc = access_ok((void *)R3Ptr, 1);
  11. +#else
  12. bool fRc = access_ok(VERIFY_READ, (void *)R3Ptr, 1);
  13. +#endif
  14. IPRT_LINUX_RESTORE_EFL_AC();
  15. return fRc;
  16. }
  17. @@ -82,7 +86,11 @@
  18. return (uintptr_t)pv >= PAGE_OFFSET;
  19. #else
  20. # error "PORT ME"
  21. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)
  22. + return !access_ok(pv, 1);
  23. +#else
  24. return !access_ok(VERIFY_READ, pv, 1);
  25. +#endif /* LINUX_VERSION_CODE */
  26. #endif
  27. }
  28. RT_EXPORT_SYMBOL(RTR0MemKernelIsValidAddr);
Add Comment
Please, Sign In to add comment