[vbox-dev] [PATCH] Fix compilation of host modules on Linux kernel 5.0
Sérgio Basto
sergio at serjux.com
Sat Jan 26 18:55:03 UTC 2019
Have we this applied on official sources ?
spaces on tabs are wrong ...
but can't compile against 5.0.0-0.rc3
vboxsf/super.c:153:14: error: 'MS_REMOUNT' undeclared (first use in
this function); did you mean 'DT_RELCOUNT'?
if (flags & MS_REMOUNT)
^~~~~~~~~~
DT_RELCOUNT
vboxsf/super.c:153:14: note: each undeclared identifier is reported
only once for each function it appears in
2019/01/26 18:50:23 akmodsbuild: make[1]: ***
[scripts/Makefile.build:276:
/tmp/akmodsbuild.vTZNmeze/BUILD/VirtualBox-kmod-6.0.2/_kmod
_build_5.0.0-0.rc3.git1.2.fc30.x86_64/vboxsf/super.o] Error 1
2019/01/26 18:50:23 akmodsbuild: make: *** [Makefile:1557:
_module_/tmp/akmodsbuild.vTZNmeze/BUILD/VirtualBox-kmod-
6.0.2/_kmod_build_5
.0.0-0.rc3.git1.2.fc30.x86_64/vboxsf] Error 2
On Wed, 2019-01-16 at 17:11 -0500, Kyle Laker wrote:
> The API for the access_ok() macro has changed in 5.0 to remove the
> first
> argument. Which means the host modules do not compile on the 5.0
> kernel.
> I was able to resolve it with the following patch. I did not find
> any
> other instances where access_ok() is used.
>
> I have not signed the CA; however, this code is contributed under
> the
> terms of the MIT License.
>
> - Kyle
>
>
> Index: src/VBox/Runtime/r0drv/linux/memuserkernel-r0drv-linux.c
> ===================================================================
> --- src/VBox/Runtime/r0drv/linux/memuserkernel-r0drv-linux.c (revisi
> on
> 76826)
> +++ src/VBox/Runtime/r0drv/linux/memuserkernel-r0drv-linux.c (workin
> g 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);
>
> _______________________________________________
> vbox-dev mailing list
> vbox-dev at virtualbox.org
> https://www.virtualbox.org/mailman/listinfo/vbox-dev
--
Sérgio M. B.
More information about the vbox-dev
mailing list