From b6a5965d5274ad3e435b0301cee17a8863993f5531ce173405abe48c730d85d9 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Tue, 12 Mar 2024 15:56:31 +0000 Subject: [PATCH] Accepting request 1157131 from home:jirislaby:branches:Virtualization - add kernel-6.8.patch to fix kernel 6.8 build failures OBS-URL: https://build.opensuse.org/request/show/1157131 OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=728 --- kernel-6.8.patch | 76 ++++++++++++++++++++++++++++++++++++++++++++++ virtualbox.changes | 5 +++ virtualbox.spec | 2 ++ 3 files changed, 83 insertions(+) create mode 100644 kernel-6.8.patch diff --git a/kernel-6.8.patch b/kernel-6.8.patch new file mode 100644 index 0000000..8ca1a22 --- /dev/null +++ b/kernel-6.8.patch @@ -0,0 +1,76 @@ +From: Jiri Slaby +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 +--- + 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/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c ++++ b/src/VBox/Additions/common/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/src/VBox/Additions/linux/sharedfolders/vfsmod.c ++++ b/src/VBox/Additions/linux/sharedfolders/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); diff --git a/virtualbox.changes b/virtualbox.changes index 3802898..c2e1ac5 100644 --- a/virtualbox.changes +++ b/virtualbox.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Mar 12 09:06:54 UTC 2024 - Jiri Slaby + +- add kernel-6.8.patch to fix kernel 6.8 build failures + ------------------------------------------------------------------- Tue Feb 20 13:24:14 UTC 2024 - Dominique Leuenberger diff --git a/virtualbox.spec b/virtualbox.spec index 5f9c18a..e6114d0 100644 --- a/virtualbox.spec +++ b/virtualbox.spec @@ -161,6 +161,7 @@ Patch39: fix_sdl_build.patch Patch40: fixes_for_leap.patch # Fix for set_pte() warning #Patch41: fix_pte_warning.patch +Patch42: kernel-6.8.patch # # Common BuildRequires for both virtualbox and virtualbox-kmp BuildRequires: %{kernel_module_package_buildreqs} @@ -474,6 +475,7 @@ This package contains the kernel-modules that VirtualBox uses to create or run v %patch -P 39 -p1 %patch -P 40 -p1 #%patch -P 41 -p1 +%patch -P 42 -p1 ### Documents for virtualbox main package ### %if %{main_package}