zero-init entrypoints in loader_add_to_dev_ext_list - #2007
Merged
charles-lunarg merged 1 commit intoAug 11, 2026
Conversation
|
Author aizu-m not on autobuild list. Waiting for curator authorization before starting CI build. |
1 similar comment
|
Author aizu-m not on autobuild list. Waiting for curator authorization before starting CI build. |
charles-lunarg
approved these changes
Aug 11, 2026
|
CI Vulkan-Loader build queued with queue ID 74644. |
|
CI Vulkan-Loader build # 3697 running. |
|
CI Vulkan-Loader build # 3697 passed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ASan, teardown of an instance created with an app
pfnReallocation:Chased the wild pointer back to
loader_add_to_dev_ext_list. It memcpys thepropssub-struct of the new element but only assigns the nestedentrypointsloader_string_listwhen the caller hands it a non-NULLentrys. Adevice_extensionsentry with noentrypointsarray reaches it withentrys == NULL(loader.c:3097-3101, and the component-layer merge at loader.c:2653), soentrypointskeeps whatever was in the slot.Nothing showed up until a discovered layer had 33+ device extensions. The first 32 slots come from
loader_init_generic_list/loader_callocand are zeroed, so the field read as empty. Slot 32 onwards comes from this function's ownloader_instance_heap_reallocgrowth, andloader_realloconly zeroes the grown region on the plainreallocpath, not the apppfnReallocationpath (allocation.c:94-97). AtvkDestroyInstance,free_string_listthen walks that indeterminate list and count.Zero
entrypointsin the else branch so the appended element is fully initialised whatever allocator is in use. Regression test added under the alloc-callback suite; it poisons the grown region so the read is deterministic, and trips the SEGV without this change.