Handle all extensions for structure size calculation

Structure size is needed to parse incoming streams correctly.
This avoids emulator crashes when an unsupported extension structure is
used on the guest side.

Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
This commit is contained in:
Serdar Kocdemir
2024-07-04 09:39:41 +01:00
committed by Marge Bot
parent 3fb873808a
commit 3478de8444
@@ -171,6 +171,13 @@ SUPPORTED_MODULES = {
"VK_KHR_swapchain" : HOST_MODULES,
}
# These modules will be used when the feature is not supported.
# This is necessary to cover all extensions where needed.
UNSUPPORTED_FEATURE_MODULES = {
"goldfish_vk_extension_structs",
}
REQUIRED_TYPES = {
"int",
"uint16_t",
@@ -789,10 +796,14 @@ class BumpPool;
if self.featureName == supportedFeature:
self.featureSupported = True
if self.featureSupported == False:
if self.featureSupported == False and UNSUPPORTED_FEATURE_MODULES:
self.featureSupported = True
self.supportedModules = UNSUPPORTED_FEATURE_MODULES
elif self.featureSupported == False:
return
else:
self.supportedModules = SUPPORTED_MODULES.get(self.featureName)
self.supportedModules = SUPPORTED_MODULES.get(self.featureName)
self.typeInfo.onBeginFeature(self.featureName, self.featureType)
self.forEachModule(