Re: Crash in VirtualBox virtual machines running kernel 6.5

From: Kees Cook
Date: Wed Jul 19 2023 - 11:37:03 EST


Okay, please try:

diff --git a/fs/vboxsf/shfl_hostintf.h b/fs/vboxsf/shfl_hostintf.h
index aca829062c12..902fe3224453 100644
--- a/fs/vboxsf/shfl_hostintf.h
+++ b/fs/vboxsf/shfl_hostintf.h
@@ -68,12 +68,11 @@ struct shfl_string {

/** UTF-8 or UTF-16 string. Nul terminated. */
union {
- u8 utf8[2];
- u16 utf16[1];
- u16 ucs2[1]; /* misnomer, use utf16. */
+ DECLARE_FLEX_ARRAY(u8, utf8);
+ DECLARE_FLEX_ARRAY(u16, utf16);
} string;
};
-VMMDEV_ASSERT_SIZE(shfl_string, 6);
+VMMDEV_ASSERT_SIZE(shfl_string, 4);

/* The size of shfl_string w/o the string part. */
#define SHFLSTRING_HEADER_SIZE 4


The size assert doesn't seem to be used anywhere else, but I can do a
more careful binary analysis later today...

--
Kees Cook