1
0
forked from pool/virtualbox
virtualbox/linux-5.10-address-space-fixes.patch

17 lines
731 B
Diff

Index: b/src/VBox/Additions/linux/sharedfolders/regops.c
===================================================================
--- a/src/VBox/Additions/linux/sharedfolders/regops.c
+++ b/src/VBox/Additions/linux/sharedfolders/regops.c
@@ -1401,7 +1401,10 @@ static int vbsf_lock_user_pages_failed_c
/*
* Check that this is valid user memory that is actually in the kernel range.
*/
-#if RTLNX_VER_MIN(5,0,0) || RTLNX_RHEL_MIN(8,1)
+#if RTLNX_VER_MIN(5,10,0)
+ if ( access_ok((void *)uPtrFrom, cPages << PAGE_SHIFT)
+ && uPtrFrom >= TASK_SIZE_MAX)
+#elif RTLNX_VER_MIN(5,0,0) || RTLNX_RHEL_MIN(8,1)
if ( access_ok((void *)uPtrFrom, cPages << PAGE_SHIFT)
&& uPtrFrom >= USER_DS.seg)
#else