app-emulation/virtualbox-modules: patch for kernel 6.6

Apply upstream patch for module crash under kenrel 6.6.x.

Closes: https://bugs.gentoo.org/923277
Signed-off-by: Viorel Munteanu <ceamac@gentoo.org>
This commit is contained in:
Viorel Munteanu
2024-02-24 10:59:33 +02:00
parent aa03425465
commit b8d6d2d875
5 changed files with 111 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
https://www.virtualbox.org/changeset/103168/vbox
https://bugs.gentoo.org/923277
--- a/vboxdrv/r0drv/linux/memobj-r0drv-linux.c
+++ b/vboxdrv/r0drv/linux/memobj-r0drv-linux.c
@@ -244,9 +244,21 @@
#if defined(RT_ARCH_X86) || defined(RT_ARCH_AMD64)
if (fKernel)
{
+# if RTLNX_VER_MIN(6,6,0)
+ /* In kernel 6.6 mk_pte() macro was fortified with additional
+ * check which does not allow to use our custom mask anymore
+ * (see kernel commit ae1f05a617dcbc0a732fbeba0893786cd009536c).
+ * For this particular mapping case, an existing mask PAGE_KERNEL_ROX
+ * can be used instead. PAGE_KERNEL_ROX was introduced in
+ * kernel 5.8, however, lets apply it for kernels 6.6 and newer
+ * to be on a safe side.
+ */
+ return PAGE_KERNEL_ROX;
+# else
pgprot_t fPg = MY_PAGE_KERNEL_EXEC;
pgprot_val(fPg) &= ~_PAGE_RW;
return fPg;
+# endif
}
return PAGE_READONLY_EXEC;
#else

View File

@@ -21,6 +21,10 @@ KEYWORDS="~amd64"
CONFIG_CHECK="~!SPINLOCK JUMP_LABEL"
PATCHES=(
"${FILESDIR}"/${PN}-7.0.14-kernel-6.6-warning.patch
)
src_compile() {
local modlist=( {vboxdrv,vboxnetflt,vboxnetadp}=misc )
local modargs=( KERN_DIR="${KV_OUT_DIR}" KERN_VER="${KV_FULL}" )

View File

@@ -0,0 +1,38 @@
# Copyright 2022-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# XXX: the tarball here is just the kernel modules split out of the binary
# package that comes from VirtualBox-*.run
# XXX: update: now it is split from virtualbox-*-Debian~bullseye_amd64.deb
EAPI=8
inherit linux-mod-r1
MY_P="vbox-kernel-module-src-${PV}"
DESCRIPTION="Kernel Modules for Virtualbox"
HOMEPAGE="https://www.virtualbox.org/"
SRC_URI="https://dev.gentoo.org/~ceamac/${CATEGORY}/${PN}/${MY_P}.tar.xz"
S="${WORKDIR}"
LICENSE="GPL-2"
SLOT="0/$(ver_cut 1-2)"
KEYWORDS="~amd64"
CONFIG_CHECK="~!SPINLOCK JUMP_LABEL"
PATCHES=(
"${FILESDIR}"/${PN}-7.0.14-kernel-6.6-warning.patch
)
src_compile() {
local modlist=( {vboxdrv,vboxnetflt,vboxnetadp}=misc )
local modargs=( KERN_DIR="${KV_OUT_DIR}" KERN_VER="${KV_FULL}" )
linux-mod-r1_src_compile
}
src_install() {
linux-mod-r1_src_install
insinto /usr/lib/modules-load.d/
newins "${FILESDIR}"/virtualbox.conf-r1 virtualbox.conf
}

View File

@@ -0,0 +1,38 @@
# Copyright 2022-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# XXX: the tarball here is just the kernel modules split out of the binary
# package that comes from VirtualBox-*.run
# XXX: update: now it is split from virtualbox-*-Debian~bullseye_amd64.deb
EAPI=8
inherit linux-mod-r1
MY_P="vbox-kernel-module-src-${PV}"
DESCRIPTION="Kernel Modules for Virtualbox"
HOMEPAGE="https://www.virtualbox.org/"
SRC_URI="https://dev.gentoo.org/~ceamac/${CATEGORY}/${PN}/${MY_P}.tar.xz"
S="${WORKDIR}"
LICENSE="GPL-3"
SLOT="0/$(ver_cut 1-2)"
KEYWORDS="~amd64"
CONFIG_CHECK="~!SPINLOCK JUMP_LABEL"
PATCHES=(
"${FILESDIR}"/${PN}-7.0.14-kernel-6.6-warning.patch
)
src_compile() {
local modlist=( {vboxdrv,vboxnetflt,vboxnetadp}=misc )
local modargs=( KERN_DIR="${KV_OUT_DIR}" KERN_VER="${KV_FULL}" )
linux-mod-r1_src_compile
}
src_install() {
linux-mod-r1_src_install
insinto /usr/lib/modules-load.d/
newins "${FILESDIR}"/virtualbox.conf-r1 virtualbox.conf
}

View File

@@ -21,6 +21,10 @@ KEYWORDS="~amd64"
CONFIG_CHECK="~!SPINLOCK JUMP_LABEL"
PATCHES=(
"${FILESDIR}"/${P}-kernel-6.6-warning.patch
)
src_compile() {
local modlist=( {vboxdrv,vboxnetflt,vboxnetadp}=misc )
local modargs=( KERN_DIR="${KV_OUT_DIR}" KERN_VER="${KV_FULL}" )