summaryrefslogtreecommitdiffstats
path: root/src/VBox/Additions
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-16 22:55:45 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-16 22:55:45 +0000
commit04aecf1372d30eb709d8de65152535ab66dcb74a (patch)
treed1e4d8c453a76465e8b63119314a28d39b474479 /src/VBox/Additions
parentAdding upstream version 7.0.14-dfsg. (diff)
downloadvirtualbox-04aecf1372d30eb709d8de65152535ab66dcb74a.tar.xz
virtualbox-04aecf1372d30eb709d8de65152535ab66dcb74a.zip
Adding upstream version 7.0.16-dfsg.upstream/7.0.16-dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/VBox/Additions')
-rw-r--r--src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c12
-rw-r--r--src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibRuntimeXF86.cpp3
-rwxr-xr-xsrc/VBox/Additions/common/VBoxGuest/linux/files_vboxguest1
-rwxr-xr-xsrc/VBox/Additions/linux/drm/files_vboxvideo_drv1
-rw-r--r--src/VBox/Additions/linux/drm/vbox_drv.c6
-rw-r--r--src/VBox/Additions/linux/drm/vbox_drv.h2
-rw-r--r--src/VBox/Additions/linux/drm/vbox_ttm.c20
-rwxr-xr-xsrc/VBox/Additions/linux/sharedfolders/files_vboxsf1
-rw-r--r--src/VBox/Additions/linux/sharedfolders/regops.c17
-rw-r--r--src/VBox/Additions/linux/sharedfolders/utils.c5
-rw-r--r--src/VBox/Additions/linux/sharedfolders/vfsmod.c11
11 files changed, 60 insertions, 19 deletions
diff --git a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c
index 538a0bc4..499ad791 100644
--- a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c
+++ b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c
@@ -79,6 +79,7 @@
#include <iprt/string.h>
#include <VBox/err.h>
#include <VBox/log.h>
+#include <VBox/VBoxLnxModInline.h>
/*********************************************************************************************************************************
@@ -661,6 +662,10 @@ static int __init vgdrvLinuxModInit(void)
PRTLOGGER pRelLogger;
int rc;
+ /* Check if modue loading was disabled. */
+ if (!vbox_mod_should_load())
+ return -EINVAL;
+
/*
* Initialize IPRT first.
*/
@@ -1361,8 +1366,7 @@ static int vgdrvLinuxParamLogGrpSet(const char *pszValue, CONST_4_15 struct kern
RTLogGroupSettings(pLogger, pszValue);
}
else if (pParam->name[0] != 'd')
- strlcpy(&g_szLogGrp[0], pszValue, sizeof(g_szLogGrp));
-
+ RTStrCopy(&g_szLogGrp[0], sizeof(g_szLogGrp), pszValue);
return 0;
}
@@ -1387,7 +1391,7 @@ static int vgdrvLinuxParamLogFlagsSet(const char *pszValue, CONST_4_15 struct ke
RTLogFlags(pLogger, pszValue);
}
else if (pParam->name[0] != 'd')
- strlcpy(&g_szLogFlags[0], pszValue, sizeof(g_szLogFlags));
+ RTStrCopy(&g_szLogFlags[0], sizeof(g_szLogFlags), pszValue);
return 0;
}
@@ -1412,7 +1416,7 @@ static int vgdrvLinuxParamLogDstSet(const char *pszValue, CONST_4_15 struct kern
RTLogDestinations(pLogger, pszValue);
}
else if (pParam->name[0] != 'd')
- strlcpy(&g_szLogDst[0], pszValue, sizeof(g_szLogDst));
+ RTStrCopy(&g_szLogDst[0], sizeof(g_szLogDst), pszValue);
return 0;
}
diff --git a/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibRuntimeXF86.cpp b/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibRuntimeXF86.cpp
index 8a9d15c0..899cb903 100644
--- a/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibRuntimeXF86.cpp
+++ b/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibRuntimeXF86.cpp
@@ -46,6 +46,9 @@
#if defined(VBOX_VBGLR3_XFREE86)
extern "C" {
# define XFree86LOADER
+# if RT_GNUC_PREREQ(13,0) /* cmath gets dragged in and the c++/13/cmath header is allergic to -ffreestanding. */
+# define _GLIBCXX_INCLUDE_NEXT_C_HEADERS
+# endif
# include <xf86_ansic.h>
# undef size_t
}
diff --git a/src/VBox/Additions/common/VBoxGuest/linux/files_vboxguest b/src/VBox/Additions/common/VBoxGuest/linux/files_vboxguest
index 5df520b6..4e7e5f59 100755
--- a/src/VBox/Additions/common/VBoxGuest/linux/files_vboxguest
+++ b/src/VBox/Additions/common/VBoxGuest/linux/files_vboxguest
@@ -95,6 +95,7 @@ FILES_VBOXGUEST_NOBIN=" \
${PATH_ROOT}/include/VBox/VBoxGuestLib.h=>include/VBox/VBoxGuestLib.h \
${PATH_ROOT}/include/VBox/VBoxGuestMangling.h=>include/VBox/VBoxGuestMangling.h \
${PATH_ROOT}/include/VBox/version.h=>include/VBox/version.h \
+ ${PATH_ROOT}/include/VBox/VBoxLnxModInline.h=>VBox/VBoxLnxModInline.h \
${PATH_ROOT}/include/VBox/HostServices/GuestPropertySvc.h=>include/VBox/HostServices/GuestPropertySvc.h \
${PATH_ROOT}/include/VBox/vmm/cpuidcall.h=>include/VBox/vmm/cpuidcall.h \
${PATH_ROOT}/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp=>VBoxGuest-common.c \
diff --git a/src/VBox/Additions/linux/drm/files_vboxvideo_drv b/src/VBox/Additions/linux/drm/files_vboxvideo_drv
index 04092484..46fdf366 100755
--- a/src/VBox/Additions/linux/drm/files_vboxvideo_drv
+++ b/src/VBox/Additions/linux/drm/files_vboxvideo_drv
@@ -38,6 +38,7 @@ FILES_VBOXVIDEO_DRM_NOBIN=" \
${PATH_ROOT}/include/VBox/Graphics/HGSMIDefs.h=>hgsmi_defs.h \
${PATH_ROOT}/include/VBox/Graphics/VBoxVideoErr.h=>vbox_err.h \
${PATH_ROOT}/include/VBox/Graphics/VBoxVideoVBE.h=>vboxvideo_vbe.h \
+ ${PATH_ROOT}/include/VBox/VBoxLnxModInline.h=>VBox/VBoxLnxModInline.h \
${PATH_ROOT}/src/VBox/Additions/common/VBoxVideo/HGSMIBase.cpp=>hgsmi_base.c \
${PATH_ROOT}/src/VBox/Additions/common/VBoxVideo/Modesetting.cpp=>modesetting.c \
${PATH_ROOT}/src/VBox/Additions/common/VBoxVideo/VBVABase.cpp=>vbva_base.c \
diff --git a/src/VBox/Additions/linux/drm/vbox_drv.c b/src/VBox/Additions/linux/drm/vbox_drv.c
index 3e4cbc60..7d2561dd 100644
--- a/src/VBox/Additions/linux/drm/vbox_drv.c
+++ b/src/VBox/Additions/linux/drm/vbox_drv.c
@@ -63,6 +63,8 @@
# define VBOX_VIDEO_NOMODESET() 0
#endif /* !CONFIG_VGA_CONSOLE */
+#include <VBox/VBoxLnxModInline.h>
+
static int vbox_modeset = -1;
MODULE_PARM_DESC(modeset, "Disable/Enable modesetting");
@@ -413,6 +415,10 @@ static struct drm_driver driver = {
static int __init vbox_init(void)
{
+ /* Check if modue loading was disabled. */
+ if (!vbox_mod_should_load())
+ return -EINVAL;
+
printk("vboxvideo: loading version " VBOX_VERSION_STRING " r" __stringify(VBOX_SVN_REV) "\n");
if (VBOX_VIDEO_NOMODESET())
{
diff --git a/src/VBox/Additions/linux/drm/vbox_drv.h b/src/VBox/Additions/linux/drm/vbox_drv.h
index 8eb9f83e..aaaef937 100644
--- a/src/VBox/Additions/linux/drm/vbox_drv.h
+++ b/src/VBox/Additions/linux/drm/vbox_drv.h
@@ -538,9 +538,7 @@ int vbox_gem_prime_mmap(struct drm_gem_object *obj,
int vbox_irq_init(struct vbox_private *vbox);
void vbox_irq_fini(struct vbox_private *vbox);
void vbox_report_hotplug(struct vbox_private *vbox);
-#if RTLNX_VER_MAX(5,15,0) && !RTLNX_RHEL_MAJ_PREREQ(9,1) && !RTLNX_SUSE_MAJ_PREREQ(15,5)
irqreturn_t vbox_irq_handler(int irq, void *arg);
-#endif
/* vbox_hgsmi.c */
void *hgsmi_buffer_alloc(struct gen_pool *guest_pool, size_t size,
diff --git a/src/VBox/Additions/linux/drm/vbox_ttm.c b/src/VBox/Additions/linux/drm/vbox_ttm.c
index d020aa3f..d5c64ceb 100644
--- a/src/VBox/Additions/linux/drm/vbox_ttm.c
+++ b/src/VBox/Additions/linux/drm/vbox_ttm.c
@@ -532,10 +532,15 @@ void vbox_ttm_placement(struct vbox_bo *bo, u32 mem_type)
#endif
bo->placement.placement = bo->placements;
+#if RTLNX_VER_MAX(6,9,0)
bo->placement.busy_placement = bo->placements;
+#endif
if (mem_type & VBOX_MEM_TYPE_VRAM) {
-#if RTLNX_VER_MIN(5,11,0) || RTLNX_RHEL_RANGE(8,5, 8,99)
+#if RTLNX_VER_MIN(6,9,0)
+ bo->placements[c].mem_type = TTM_PL_VRAM;
+ PLACEMENT_FLAGS(bo->placements[c++]) = TTM_PL_FLAG_DESIRED;
+#elif RTLNX_VER_MIN(5,11,0) || RTLNX_RHEL_RANGE(8,5, 8,99)
bo->placements[c].mem_type = TTM_PL_VRAM;
PLACEMENT_FLAGS(bo->placements[c++]) = 0;
#elif RTLNX_VER_MIN(5,10,0)
@@ -548,7 +553,11 @@ void vbox_ttm_placement(struct vbox_bo *bo, u32 mem_type)
#endif
}
if (mem_type & VBOX_MEM_TYPE_SYSTEM) {
-#if RTLNX_VER_MIN(5,11,0) || RTLNX_RHEL_RANGE(8,5, 8,99)
+
+#if RTLNX_VER_MIN(6,9,0)
+ bo->placements[c].mem_type = TTM_PL_SYSTEM;
+ PLACEMENT_FLAGS(bo->placements[c++]) = TTM_PL_FLAG_DESIRED;
+#elif RTLNX_VER_MIN(5,11,0) || RTLNX_RHEL_RANGE(8,5, 8,99)
bo->placements[c].mem_type = TTM_PL_SYSTEM;
PLACEMENT_FLAGS(bo->placements[c++]) = 0;
#elif RTLNX_VER_MIN(5,10,0)
@@ -561,7 +570,10 @@ void vbox_ttm_placement(struct vbox_bo *bo, u32 mem_type)
#endif
}
if (!c) {
-#if RTLNX_VER_MIN(5,11,0) || RTLNX_RHEL_RANGE(8,5, 8,99)
+#if RTLNX_VER_MIN(6,9,0)
+ bo->placements[c].mem_type = TTM_PL_SYSTEM;
+ PLACEMENT_FLAGS(bo->placements[c++]) = TTM_PL_FLAG_DESIRED;
+#elif RTLNX_VER_MIN(5,11,0) || RTLNX_RHEL_RANGE(8,5, 8,99)
bo->placements[c].mem_type = TTM_PL_SYSTEM;
PLACEMENT_FLAGS(bo->placements[c++]) = 0;
#elif RTLNX_VER_MIN(5,10,0)
@@ -575,7 +587,9 @@ void vbox_ttm_placement(struct vbox_bo *bo, u32 mem_type)
}
bo->placement.num_placement = c;
+#if RTLNX_VER_MAX(6,9,0)
bo->placement.num_busy_placement = c;
+#endif
#if RTLNX_VER_MIN(3,18,0) || RTLNX_RHEL_MAJ_PREREQ(7,2)
for (i = 0; i < c; ++i) {
diff --git a/src/VBox/Additions/linux/sharedfolders/files_vboxsf b/src/VBox/Additions/linux/sharedfolders/files_vboxsf
index 8187ad33..4de23b09 100755
--- a/src/VBox/Additions/linux/sharedfolders/files_vboxsf
+++ b/src/VBox/Additions/linux/sharedfolders/files_vboxsf
@@ -72,6 +72,7 @@ FILES_VBOXSF_NOBIN=" \
${PATH_ROOT}/include/VBox/VBoxGuestMangling.h=>include/VBox/VBoxGuestMangling.h \
${PATH_ROOT}/include/VBox/VMMDev.h=>include/VBox/VMMDev.h \
${PATH_ROOT}/include/VBox/VMMDevCoreTypes.h=>include/VBox/VMMDevCoreTypes.h \
+ ${PATH_ROOT}/include/VBox/VBoxLnxModInline.h=>VBox/VBoxLnxModInline.h \
${PATH_ROOT}/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR0LibInternal.h=>VBoxGuestR0LibInternal.h \
${PATH_ROOT}/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR0LibGenericRequest.cpp=>VBoxGuestR0LibGenericRequest.c \
${PATH_ROOT}/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR0LibHGCM.cpp=>VBoxGuestR0LibHGCM.c \
diff --git a/src/VBox/Additions/linux/sharedfolders/regops.c b/src/VBox/Additions/linux/sharedfolders/regops.c
index ca604090..d98add74 100644
--- a/src/VBox/Additions/linux/sharedfolders/regops.c
+++ b/src/VBox/Additions/linux/sharedfolders/regops.c
@@ -2535,7 +2535,11 @@ static ssize_t vbsf_reg_read_iter_locking(struct kiocb *kio, struct iov_iter *it
if (rc == 0) {
size_t iPage = cPages;
while (iPage-- > 0)
- pReq->PgLst.aPages[iPage] = page_to_phys(papPages[iPage]);
+ {
+ RTGCPHYS64 * paDstPages = pReq->PgLst.aPages;
+ paDstPages[iPage] = page_to_phys(papPages[iPage]);
+ }
+
pReq->PgLst.offFirstPage = (uint16_t)offPage0;
AssertStmt(cbChunk <= cbToRead, cbChunk = cbToRead);
} else {
@@ -2749,7 +2753,10 @@ static ssize_t vbsf_reg_write_iter_locking(struct kiocb *kio, struct iov_iter *i
if (rc == 0) {
size_t iPage = cPages;
while (iPage-- > 0)
- pReq->PgLst.aPages[iPage] = page_to_phys(papPages[iPage]);
+ {
+ RTGCPHYS64 * paDstPages = pReq->PgLst.aPages;
+ paDstPages[iPage] = page_to_phys(papPages[iPage]);
+ }
pReq->PgLst.offFirstPage = (uint16_t)offPage0;
AssertStmt(cbChunk <= cbToWrite, cbChunk = cbToWrite);
} else {
@@ -3505,7 +3512,7 @@ static struct vm_operations_struct const g_LoggingVmOpsTemplate = {
};
/** file_operations::mmap wrapper for logging purposes. */
-extern int vbsf_reg_mmap(struct file *file, struct vm_area_struct *vma)
+static int vbsf_reg_mmap(struct file *file, struct vm_area_struct *vma)
{
int rc;
SFLOGFLOW(("vbsf_reg_mmap: file=%p vma=%p\n", file, vma));
@@ -3786,14 +3793,14 @@ static inline void vbsf_write_begin_warn(loff_t pos, unsigned len, unsigned flag
}
# if RTLNX_VER_MIN(5,19,0) || RTLNX_RHEL_RANGE(9,3, 9,99)
-int vbsf_write_begin(struct file *file, struct address_space *mapping, loff_t pos,
+static int vbsf_write_begin(struct file *file, struct address_space *mapping, loff_t pos,
unsigned len, struct page **pagep, void **fsdata)
{
vbsf_write_begin_warn(pos, len, 0);
return simple_write_begin(file, mapping, pos, len, pagep, fsdata);
}
# else
-int vbsf_write_begin(struct file *file, struct address_space *mapping, loff_t pos,
+static int vbsf_write_begin(struct file *file, struct address_space *mapping, loff_t pos,
unsigned len, unsigned flags, struct page **pagep, void **fsdata)
{
vbsf_write_begin_warn(pos, len, flags);
diff --git a/src/VBox/Additions/linux/sharedfolders/utils.c b/src/VBox/Additions/linux/sharedfolders/utils.c
index b75997a8..7c1fba95 100644
--- a/src/VBox/Additions/linux/sharedfolders/utils.c
+++ b/src/VBox/Additions/linux/sharedfolders/utils.c
@@ -190,10 +190,11 @@ int vbsf_nls_to_shflstring(struct vbsf_super_info *pSuperInfo, const char *pszNl
if (cchNls + 1 < _64K) {
pString = (PSHFLSTRING)kmalloc(SHFLSTRING_HEADER_SIZE + cchNls + 1, GFP_KERNEL);
if (pString) {
+ char *pchDst = pString->String.ach;
pString->u16Length = (uint16_t)cchNls;
pString->u16Size = (uint16_t)(cchNls + 1);
- RT_BCOPY_UNFORTIFIED(pString->String.ach, pszNls, cchNls);
- pString->String.ach[cchNls] = '\0';
+ RT_BCOPY_UNFORTIFIED(pchDst, pszNls, cchNls);
+ pchDst[cchNls] = '\0';
rc = 0;
} else {
Log(("vbsf_nls_to_shflstring: failed to allocate %u bytes\n", SHFLSTRING_HEADER_SIZE + cchNls + 1));
diff --git a/src/VBox/Additions/linux/sharedfolders/vfsmod.c b/src/VBox/Additions/linux/sharedfolders/vfsmod.c
index 18324fe1..0c5c77af 100644
--- a/src/VBox/Additions/linux/sharedfolders/vfsmod.c
+++ b/src/VBox/Additions/linux/sharedfolders/vfsmod.c
@@ -63,6 +63,7 @@
#elif RTLNX_VER_MIN(2,6,0)
# include <linux/parser.h>
#endif
+#include <VBox/VBoxLnxModInline.h>
/*********************************************************************************************************************************
@@ -1408,7 +1409,7 @@ static int vbsf_parse_param(struct fs_context *fc, struct fs_parameter *param)
switch (opt) {
case Opt_iocharset:
case Opt_nls:
- strlcpy(info->nls_name, param->string, sizeof(info->nls_name));
+ RTStrCopy(info->nls_name, sizeof(info->nls_name), param->string);
break;
case Opt_uid:
info->uid = result.uint_32;
@@ -1469,7 +1470,7 @@ static int vbsf_parse_param(struct fs_context *fc, struct fs_parameter *param)
printk(KERN_WARNING "vboxsf: cache mode (%u) is out of range, using default instead.\n", result.uint_32);
break;
case Opt_tag:
- strlcpy(info->szTag, param->string, sizeof(info->szTag));
+ RTStrCopy(info->szTag, sizeof(info->szTag), param->string);
break;
default:
return invalf(fc, "Invalid mount option: '%s'", param->key);
@@ -1528,7 +1529,7 @@ static int vbsf_get_tree(struct fs_context *fc)
}
/* fc->source (the shared folder name) is set after vbsf_init_fs_ctx() */
- strlcpy(info->name, fc->source, sizeof(info->name));
+ RTStrCopy(info->name, sizeof(info->name), fc->source);
# if RTLNX_VER_MAX(5,3,0)
return vfs_get_super(fc, vfs_get_independent_super, vbsf_read_super_aux);
@@ -1621,6 +1622,10 @@ static int __init init(void)
int rc;
SFLOGFLOW(("vboxsf: init\n"));
+ /* Check if modue loading was disabled. */
+ if (!vbox_mod_should_load())
+ return -EINVAL;
+
/*
* Must be paranoid about the vbsf_mount_info_new size.
*/