summaryrefslogtreecommitdiffstats
path: root/src/VBox/HostDrivers/Support/linux
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-16 22:55:46 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-16 22:55:46 +0000
commit96647a898d62d699808316238dfb933d960413f2 (patch)
tree0138491ada40b7b3fcb80d4b219fa7922ae8f512 /src/VBox/HostDrivers/Support/linux
parentAdding debian version 7.0.14-dfsg-4. (diff)
downloadvirtualbox-96647a898d62d699808316238dfb933d960413f2.tar.xz
virtualbox-96647a898d62d699808316238dfb933d960413f2.zip
Merging upstream version 7.0.16-dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/VBox/HostDrivers/Support/linux')
-rw-r--r--src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c15
-rwxr-xr-xsrc/VBox/HostDrivers/Support/linux/files_vboxdrv1
2 files changed, 11 insertions, 5 deletions
diff --git a/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c b/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
index 2a77412c..6ce2a8d0 100644
--- a/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
+++ b/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
@@ -54,6 +54,7 @@
#include <VBox/err.h>
#include <iprt/mem.h>
#include <VBox/log.h>
+#include <VBox/VBoxLnxModInline.h>
#include <iprt/mp.h>
/** @todo figure out the exact version number */
@@ -307,12 +308,12 @@ DECLINLINE(RTGID) vboxdrvLinuxKernGid(void)
#ifdef VBOX_WITH_HARDENING
-/** Get the effective UID within the current user namespace. */
-DECLINLINE(RTUID) vboxdrvLinuxEuidInNs(void)
+/** Get the effective UID of the current process. */
+DECLINLINE(RTUID) vboxdrvLinuxEuid(void)
{
# if RTLNX_VER_MIN(2,6,29)
# if RTLNX_VER_MIN(3,5,0)
- return from_kuid(current_user_ns(), current->cred->euid);
+ return __kuid_val(current->cred->euid);
# else
return current->cred->euid;
# endif
@@ -332,6 +333,10 @@ static int __init VBoxDrvLinuxInit(void)
{
int rc;
+ /* Check if modue loading was disabled. */
+ if (!vbox_mod_should_load())
+ return -EINVAL;
+
#if RTLNX_VER_MIN(5,0,0)
spin_lock_init(&g_supdrvLinuxWrapperModuleSpinlock);
RTListInit(&g_supdrvLinuxWrapperModuleList);
@@ -487,9 +492,9 @@ static int vboxdrvLinuxCreateCommon(struct inode *pInode, struct file *pFilp, bo
* Only root is allowed to access the unrestricted device, enforce it!
*/
if ( fUnrestricted
- && vboxdrvLinuxEuidInNs() != 0 /* root */ )
+ && vboxdrvLinuxEuid() != 0 /* root */ )
{
- Log(("VBoxDrvLinuxCreate: euid=%d, expected 0 (root)\n", vboxdrvLinuxEuidInNs()));
+ Log(("VBoxDrvLinuxCreate: euid=%d, expected 0 (root)\n", vboxdrvLinuxEuid()));
return -EPERM;
}
#endif /* VBOX_WITH_HARDENING */
diff --git a/src/VBox/HostDrivers/Support/linux/files_vboxdrv b/src/VBox/HostDrivers/Support/linux/files_vboxdrv
index cd8b214a..5fbf92a5 100755
--- a/src/VBox/HostDrivers/Support/linux/files_vboxdrv
+++ b/src/VBox/HostDrivers/Support/linux/files_vboxdrv
@@ -93,6 +93,7 @@ FILES_VBOXDRV_NOBIN=" \
${PATH_ROOT}/include/VBox/types.h=>include/VBox/types.h \
${PATH_ROOT}/include/VBox/SUPDrvMangling.h=>include/VBox/SUPDrvMangling.h \
${PATH_ROOT}/include/VBox/VBoxTpG.h=>include/VBox/VBoxTpG.h \
+ ${PATH_ROOT}/include/VBox/VBoxLnxModInline.h=>include/VBox/VBoxLnxModInline.h \
${PATH_ROOT}/include/VBox/vmm/hm_vmx.h=>include/VBox/vmm/hm_vmx.h \
${PATH_ROOT}/include/VBox/vmm/hm_svm.h=>include/VBox/vmm/hm_svm.h \
${PATH_ROOT}/include/VBox/vmm/cpuidcall.h=>include/VBox/vmm/cpuidcall.h \