commit ec542ee008a05aea3825118326673808edd0d4a3
Author: Sérgio M. Basto <sergio(a)serjux.com>
Date: Sat Mar 16 00:21:42 2024 +0000
Fix build with Linux 6.8 (patch from openSUSE:Factory/virtualbox)
VirtualBox-kmod.spec | 7 ++++-
kernel-6.8.patch | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 82 insertions(+), 1 deletion(-)
---
diff --git a/VirtualBox-kmod.spec b/VirtualBox-kmod.spec
index e86d062..f7f4bff 100644
--- a/VirtualBox-kmod.spec
+++ b/VirtualBox-kmod.spec
@@ -40,7 +40,7 @@
Name: VirtualBox-kmod
Version: 7.0.14
-Release: 3%{?dist}
+Release: 4%{?dist}
#Release: 1%%{?prerel:.%%{prerel}}%%{?dist}
Summary: Kernel module for VirtualBox
@@ -49,6 +49,7 @@ URL:
http://www.virtualbox.org/wiki/VirtualBox
# This filters out the XEN kernel, since we don't run on XEN
Source1: excludekernel-filter.txt
Patch1: fix_7.0.6_locking_problems.patch
+Patch2: kernel-6.8.patch
%global AkmodsBuildRequires %{_bindir}/kmodtool VirtualBox-kmodsrc = %{version} xz time
elfutils-libelf-devel gcc
@@ -71,6 +72,7 @@ Kernel module for VirtualBox
tar --use-compress-program xz -xf
%{_datadir}/%{name}-%{version}/%{name}-%{version}.tar.xz
pushd %{name}-%{version}
%patch -P 1 -p1
+%patch -P 2 -p1
popd
# error out if there was something wrong with kmodtool
@@ -133,6 +135,9 @@ DIRS=$(ls %{name}-%{version} |wc -l)
[ $MODS = $DIRS ] || [ $MODS = 0 ]
%changelog
+* Sat Mar 16 2024 Sérgio Basto <sergio(a)serjux.com> - 7.0.14-4
+- Fix build with Linux 6.8 (patch from openSUSE:Factory/virtualbox)
+
* Sat Feb 03 2024 RPM Fusion Release Engineering <sergiomb(a)rpmfusion.org> -
7.0.14-3
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
diff --git a/kernel-6.8.patch b/kernel-6.8.patch
new file mode 100644
index 0000000..5008e9d
--- /dev/null
+++ b/kernel-6.8.patch
@@ -0,0 +1,76 @@
+From: Jiri Slaby <jslaby(a)suse.cz>
+Subject: fix build with Linux 6.8
+Patch-mainline: no
+References: kernel 6.8
+
+strlcpy() was removed in commit d26270061ae6 (string: Remove strlcpy()), use
+strscpy() instead.
+
+The patches fixes this (and similar):
+modules_build_dir/default/vboxsf/vfsmod.c:1411:9: error: implicit declaration of function
‘strlcpy’; did you mean ‘strscpy’?
+
+
+Signed-off-by: Jiri Slaby <jslaby(a)suse.cz>
+---
+ src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c | 6 +++---
+ src/VBox/Additions/linux/sharedfolders/vfsmod.c | 6 +++---
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+--- a/vboxguest/VBoxGuest-linux.c.orig
++++ b/vboxguest/VBoxGuest-linux.c
+@@ -1361,7 +1361,7 @@ static int vgdrvLinuxParamLogGrpSet(cons
+ RTLogGroupSettings(pLogger, pszValue);
+ }
+ else if (pParam->name[0] != 'd')
+- strlcpy(&g_szLogGrp[0], pszValue, sizeof(g_szLogGrp));
++ strscpy(&g_szLogGrp[0], pszValue, sizeof(g_szLogGrp));
+
+ return 0;
+ }
+@@ -1387,7 +1387,7 @@ static int vgdrvLinuxParamLogFlagsSet(co
+ RTLogFlags(pLogger, pszValue);
+ }
+ else if (pParam->name[0] != 'd')
+- strlcpy(&g_szLogFlags[0], pszValue, sizeof(g_szLogFlags));
++ strscpy(&g_szLogFlags[0], pszValue, sizeof(g_szLogFlags));
+ return 0;
+ }
+
+@@ -1412,7 +1412,7 @@ static int vgdrvLinuxParamLogDstSet(cons
+ RTLogDestinations(pLogger, pszValue);
+ }
+ else if (pParam->name[0] != 'd')
+- strlcpy(&g_szLogDst[0], pszValue, sizeof(g_szLogDst));
++ strscpy(&g_szLogDst[0], pszValue, sizeof(g_szLogDst));
+ return 0;
+ }
+
+--- a/vboxsf/vfsmod.c.orig
++++ b/vboxsf/vfsmod.c
+@@ -1408,7 +1408,7 @@ static int vbsf_parse_param(struct fs_co
+ switch (opt) {
+ case Opt_iocharset:
+ case Opt_nls:
+- strlcpy(info->nls_name, param->string, sizeof(info->nls_name));
++ strscpy(info->nls_name, param->string, sizeof(info->nls_name));
+ break;
+ case Opt_uid:
+ info->uid = result.uint_32;
+@@ -1469,7 +1469,7 @@ static int vbsf_parse_param(struct fs_co
+ 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));
++ strscpy(info->szTag, param->string, sizeof(info->szTag));
+ break;
+ default:
+ return invalf(fc, "Invalid mount option: '%s'",
param->key);
+@@ -1528,7 +1528,7 @@ static int vbsf_get_tree(struct fs_conte
+ }
+
+ /* fc->source (the shared folder name) is set after vbsf_init_fs_ctx() */
+- strlcpy(info->name, fc->source, sizeof(info->name));
++ strscpy(info->name, fc->source, sizeof(info->name));
+
+ # if RTLNX_VER_MAX(5,3,0)
+ return vfs_get_super(fc, vfs_get_independent_super, vbsf_read_super_aux);