From 9c33c4219650acd46cd34688a7c3fcf6afcae92d Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Tue, 5 Jan 2021 10:21:49 -0500 Subject: vboxguestdrivers: fix build against kernel v5.10+ We need to adjust the vboxguest drivers to build against kernels 5.10+. These are backports from the virtual box SVN repository and can be dropped in future uprevs. Signed-off-by: Bruce Ashfield Signed-off-by: Khem Raj (cherry picked from commit 22eaac640f80df44108a5565127181c94645a032) Signed-off-by: Armin Kuster --- ...sf-Adjustment-for-linux-5.10-TASK_SIZE_MA.patch | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers/0001-linser-vboxsf-Adjustment-for-linux-5.10-TASK_SIZE_MA.patch (limited to 'meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers/0001-linser-vboxsf-Adjustment-for-linux-5.10-TASK_SIZE_MA.patch') diff --git a/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers/0001-linser-vboxsf-Adjustment-for-linux-5.10-TASK_SIZE_MA.patch b/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers/0001-linser-vboxsf-Adjustment-for-linux-5.10-TASK_SIZE_MA.patch new file mode 100644 index 0000000000..3cfe2e917c --- /dev/null +++ b/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers/0001-linser-vboxsf-Adjustment-for-linux-5.10-TASK_SIZE_MA.patch @@ -0,0 +1,46 @@ +From a276f8bc5e4515f7ea51e2c56e0e634a723ca104 Mon Sep 17 00:00:00 2001 +From: vboxsync +Date: Tue, 8 Dec 2020 13:52:53 +0000 +Subject: [PATCH] linser/vboxsf: Adjustment for linux 5.10 - TASK_SIZE_MAX + replaces USER_DS.seg. bugref:9879 + +Upstream-Status: Backport + +git-svn-id: http://www.virtualbox.org/svn/vbox@87053 cfe28804-0f27-0410-a406-dd0f0b0b656f + +Signed-off-by: Bruce Ashfield +--- + src/VBox/Additions/linux/sharedfolders/regops.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/src/VBox/Additions/linux/sharedfolders/regops.c b/src/VBox/Additions/linux/sharedfolders/regops.c +index e1fad3d820..401fd69930 100644 +--- a/src/VBox/Additions/linux/sharedfolders/regops.c ++++ b/src/VBox/Additions/linux/sharedfolders/regops.c +@@ -147,7 +147,11 @@ static int vbsf_iov_iter_detect_type(struct iovec const *paIov, size_t cSegs) + while (cSegs-- > 0) { + if (paIov->iov_len > 0) { + if (access_ok(VERIFY_READ, paIov->iov_base, paIov->iov_len)) ++#if RTLNX_VER_MIN(5,10,0) ++ return (uintptr_t)paIov->iov_base >= TASK_SIZE_MAX ? ITER_KVEC : 0; ++#else + return (uintptr_t)paIov->iov_base >= USER_DS.seg ? ITER_KVEC : 0; ++#endif + AssertMsgFailed(("%p LB %#zx\n", paIov->iov_base, paIov->iov_len)); + break; + } +@@ -1401,7 +1405,10 @@ static int vbsf_lock_user_pages_failed_check_kernel(uintptr_t uPtrFrom, size_t 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 +-- +2.19.1 + -- cgit 1.2.3-korg