forked from pool/virtualbox
Accepting request 1104707 from home:lwfinger:branches:Virtualization
- An additional fix was needed to handle flexible arrays in kernel 6.5+. A fix was made for breakage of kernels 6.4.10+ boo#1212761 and boo#1214391. Note that the change in 6.4 missed an internal include that is present in kernel 6.5. OBS-URL: https://build.opensuse.org/request/show/1104707 OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=707
This commit is contained in:
parent
390649b14a
commit
124dddfd6b
@ -16,3 +16,103 @@ Index: VirtualBox-7.0.10/src/VBox/Additions/linux/drm/vbox_fb.c
|
|||||||
.fb_pan_display = drm_fb_helper_pan_display,
|
.fb_pan_display = drm_fb_helper_pan_display,
|
||||||
.fb_blank = drm_fb_helper_blank,
|
.fb_blank = drm_fb_helper_blank,
|
||||||
.fb_setcmap = drm_fb_helper_setcmap,
|
.fb_setcmap = drm_fb_helper_setcmap,
|
||||||
|
Index: VirtualBox-7.0.10/include/iprt/cdefs.h
|
||||||
|
===================================================================
|
||||||
|
--- VirtualBox-7.0.10.orig/include/iprt/cdefs.h
|
||||||
|
+++ VirtualBox-7.0.10/include/iprt/cdefs.h
|
||||||
|
@@ -38,8 +38,9 @@
|
||||||
|
#ifndef RT_WITHOUT_PRAGMA_ONCE
|
||||||
|
# pragma once
|
||||||
|
#endif
|
||||||
|
-
|
||||||
|
-
|
||||||
|
+#if defined(DECLARE_FLEX_ARRAY)
|
||||||
|
+# include <linux/version.h>
|
||||||
|
+#endif
|
||||||
|
/** @defgroup grp_rt_cdefs IPRT Common Definitions and Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
@@ -2961,6 +2962,12 @@
|
||||||
|
* @note GCC does not permit using this in nested structures, where as MSC
|
||||||
|
* does. So, use RT_FLEXIBLE_ARRAY_NESTED for that.
|
||||||
|
*
|
||||||
|
+ * @note Linux kernels 6.5+ enforce field-spanning write operations
|
||||||
|
+ * and require flexible arrays to end with 'array[]' rather than array[1].
|
||||||
|
+ * This construct fails with unions, but VB does not have any such unions.
|
||||||
|
+ * This header is used with both kernel- and user-mode code. In user-mode,
|
||||||
|
+ * the old method works. If DECLARE_FLEX_ARRAY is defined, we are
|
||||||
|
+ * building kernel-mode code and RT_FLEXIBLE_ARRAY is set to blank.
|
||||||
|
* @sa RT_FLEXIBLE_ARRAY_NESTED, RT_FLEXIBLE_ARRAY_IN_UNION
|
||||||
|
*/
|
||||||
|
#if RT_MSC_PREREQ(RT_MSC_VER_VS2005) /** @todo Probably much much earlier. */ \
|
||||||
|
@@ -2976,10 +2983,18 @@
|
||||||
|
# if __STDC_VERSION__ >= 1999901L
|
||||||
|
# define RT_FLEXIBLE_ARRAY
|
||||||
|
# else
|
||||||
|
-# define RT_FLEXIBLE_ARRAY 1
|
||||||
|
+# if defined(DECLARE_FLEX_ARRAY)
|
||||||
|
+# define RT_FLEXIBLE_ARRAY
|
||||||
|
+# else
|
||||||
|
+# define RT_FLEXIBLE_ARRAY 1
|
||||||
|
+# endif
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
+# if defined(DECLARE_FLEX_ARRAY)
|
||||||
|
+# define RT_FLEXIBLE_ARRAY
|
||||||
|
+# else
|
||||||
|
# define RT_FLEXIBLE_ARRAY 1
|
||||||
|
+# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/** @def RT_FLEXIBLE_ARRAY_EXTENSION
|
||||||
|
@@ -3008,7 +3023,9 @@
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
# define RT_FLEXIBLE_ARRAY_NESTED RT_FLEXIBLE_ARRAY
|
||||||
|
#else
|
||||||
|
+# if !defined(DECLARE_FLEX_ARRAY)
|
||||||
|
# define RT_FLEXIBLE_ARRAY_NESTED 1
|
||||||
|
+# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/** @def RT_FLEXIBLE_ARRAY_IN_UNION
|
||||||
|
@@ -3024,7 +3041,9 @@
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
# define RT_FLEXIBLE_ARRAY_IN_UNION RT_FLEXIBLE_ARRAY
|
||||||
|
#else
|
||||||
|
-# define RT_FLEXIBLE_ARRAY_IN_UNION 1
|
||||||
|
+# if !defined(DECLARE_FLEX_ARRAY)
|
||||||
|
+# define RT_FLEXIBLE_ARRAY_IN_UNION 1
|
||||||
|
+# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/** @def RT_FLEXIBLE_ARRAY_IN_NESTED_UNION
|
||||||
|
@@ -3037,7 +3056,9 @@
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
# define RT_FLEXIBLE_ARRAY_IN_NESTED_UNION RT_FLEXIBLE_ARRAY_NESTED
|
||||||
|
#else
|
||||||
|
-# define RT_FLEXIBLE_ARRAY_IN_NESTED_UNION 1
|
||||||
|
+# if !defined(DECLARE_FLEX_ARRAY)
|
||||||
|
+# define RT_FLEXIBLE_ARRAY_IN_NESTED_UNION 1
|
||||||
|
+# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/** @def RT_UNION_NM
|
||||||
|
Index: VirtualBox-7.0.10/include/VBox/VBoxGuest.h
|
||||||
|
===================================================================
|
||||||
|
--- VirtualBox-7.0.10.orig/include/VBox/VBoxGuest.h
|
||||||
|
+++ VirtualBox-7.0.10/include/VBox/VBoxGuest.h
|
||||||
|
@@ -458,8 +458,12 @@ typedef struct VBGLIOCLOG
|
||||||
|
{
|
||||||
|
/** The log message.
|
||||||
|
* The length is determined from the input size and zero termination. */
|
||||||
|
- char szMsg[RT_FLEXIBLE_ARRAY_IN_NESTED_UNION];
|
||||||
|
- } In;
|
||||||
|
+#if defined(DECLARE_FLEX_ARRAY)
|
||||||
|
+ DECLARE_FLEX_ARRAY(char, szMsg);
|
||||||
|
+#else
|
||||||
|
+ char szMsg[RT_FLEXIBLE_ARRAY_IN_NESTED_UNION];
|
||||||
|
+#endif
|
||||||
|
+ } In;
|
||||||
|
} u;
|
||||||
|
} VBGLIOCLOG, RT_FAR *PVBGLIOCLOG;
|
||||||
|
/** @} */
|
||||||
|
@ -2,7 +2,7 @@ Index: VirtualBox-7.0.10/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- VirtualBox-7.0.10.orig/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
|
--- VirtualBox-7.0.10.orig/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
|
||||||
+++ VirtualBox-7.0.10/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
|
+++ VirtualBox-7.0.10/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
|
||||||
@@ -89,6 +89,13 @@
|
@@ -89,6 +89,17 @@
|
||||||
#define VBOXNETFLT_OS_SPECFIC 1
|
#define VBOXNETFLT_OS_SPECFIC 1
|
||||||
#include "../VBoxNetFltInternal.h"
|
#include "../VBoxNetFltInternal.h"
|
||||||
|
|
||||||
@ -12,6 +12,10 @@ Index: VirtualBox-7.0.10/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.
|
|||||||
+# if defined(CONFIG_SUSE_VERSION) && CONFIG_SUSE_VERSION == 15 && CONFIG_SUSE_PATCHLEVEL == 5
|
+# if defined(CONFIG_SUSE_VERSION) && CONFIG_SUSE_VERSION == 15 && CONFIG_SUSE_PATCHLEVEL == 5
|
||||||
+# define OPENSUSE_155
|
+# define OPENSUSE_155
|
||||||
+# endif
|
+# endif
|
||||||
|
+
|
||||||
|
+#if !defined(skb_gso_segment)
|
||||||
|
+#include <net/gso.h>
|
||||||
|
+#endif
|
||||||
+
|
+
|
||||||
typedef struct VBOXNETFLTNOTIFIER {
|
typedef struct VBOXNETFLTNOTIFIER {
|
||||||
struct notifier_block Notifier;
|
struct notifier_block Notifier;
|
||||||
@ -122,7 +126,7 @@ Index: VirtualBox-7.0.10/configure
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- VirtualBox-7.0.10.orig/configure
|
--- VirtualBox-7.0.10.orig/configure
|
||||||
+++ VirtualBox-7.0.10/configure
|
+++ VirtualBox-7.0.10/configure
|
||||||
@@ -2041,7 +2041,7 @@ check_kbuild()
|
@@ -2039,7 +2039,7 @@ check_kbuild()
|
||||||
fi
|
fi
|
||||||
echo "export KBUILD_PATH KBUILD_DEVTOOLS PATH" >> $ENV
|
echo "export KBUILD_PATH KBUILD_DEVTOOLS PATH" >> $ENV
|
||||||
echo "unset path_kbuild_bin path_tools_bin" >> $ENV
|
echo "unset path_kbuild_bin path_tools_bin" >> $ENV
|
||||||
@ -131,7 +135,7 @@ Index: VirtualBox-7.0.10/configure
|
|||||||
|
|
||||||
echo '' >> $ENV
|
echo '' >> $ENV
|
||||||
echo "# Legacy - do not use:" >> $ENV
|
echo "# Legacy - do not use:" >> $ENV
|
||||||
@@ -2051,7 +2051,7 @@ check_kbuild()
|
@@ -2049,7 +2049,7 @@ check_kbuild()
|
||||||
echo '' >> $ENV
|
echo '' >> $ENV
|
||||||
elif check_avail "kmk" KBUILDDIR really; then
|
elif check_avail "kmk" KBUILDDIR really; then
|
||||||
# check for installed kBuild
|
# check for installed kBuild
|
||||||
@ -396,7 +400,7 @@ Index: VirtualBox-7.0.10/src/VBox/Additions/linux/drm/vbox_drv.h
|
|||||||
#include <linux/version.h>
|
#include <linux/version.h>
|
||||||
|
|
||||||
/* iprt/linux/version.h copy - start */
|
/* iprt/linux/version.h copy - start */
|
||||||
@@ -160,9 +161,9 @@
|
@@ -166,9 +167,9 @@
|
||||||
# include <drm/drm_device.h>
|
# include <drm/drm_device.h>
|
||||||
# include <drm/drm_ioctl.h>
|
# include <drm/drm_ioctl.h>
|
||||||
# include <drm/drm_fourcc.h>
|
# include <drm/drm_fourcc.h>
|
||||||
@ -409,7 +413,7 @@ Index: VirtualBox-7.0.10/src/VBox/Additions/linux/drm/vbox_drv.h
|
|||||||
# include <drm/drm_vblank.h>
|
# include <drm/drm_vblank.h>
|
||||||
#else /* < 5.5.0 || RHEL < 8.3 || SLES < 15-SP3 */
|
#else /* < 5.5.0 || RHEL < 8.3 || SLES < 15-SP3 */
|
||||||
# include <drm/drmP.h>
|
# include <drm/drmP.h>
|
||||||
@@ -192,15 +193,15 @@
|
@@ -198,15 +199,15 @@
|
||||||
# include <drm/ttm/ttm_resource.h>
|
# include <drm/ttm/ttm_resource.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Aug 18 18:18:19 UTC 2023 - Larry Finger <Larry.Finger@gmail.com>
|
||||||
|
|
||||||
|
- An additional fix was needed to handle flexible arrays in kernel 6.5+.
|
||||||
|
A fix was made for breakage of kernels 6.4.10+ boo#1212761 and boo#1214391.
|
||||||
|
Note that the change in 6.4 missed an internal include that is present
|
||||||
|
in kernel 6.5.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Aug 9 19:44:14 UTC 2023 - Larry Finger <Larry.Finger@gmail.com>
|
Wed Aug 9 19:44:14 UTC 2023 - Larry Finger <Larry.Finger@gmail.com>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user