Skip to content

skip layers missing api_version or implementation_version#1977

Merged
charles-lunarg merged 1 commit into
KhronosGroup:mainfrom
aizu-m:layer-missing-version-fields
Jul 16, 2026
Merged

skip layers missing api_version or implementation_version#1977
charles-lunarg merged 1 commit into
KhronosGroup:mainfrom
aizu-m:layer-missing-version-fields

Conversation

@aizu-m

@aizu-m aizu-m commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

A layer manifest that omits api_version is logged as skipped, but still shows up:

[Vulkan Loader] WARNING: ... didn't find required layer value "api_version" in manifest JSON file, skipping this layer
// vkEnumerateInstanceLayerProperties then still lists the layer

loader_read_layer_json seeds result to VK_SUCCESS and every required-field check sets it back to VK_ERROR_INITIALIZATION_FAILED before jumping to out: (name, type, the api_version variant check, description, disable_environment, library_arch). The out: epilogue only appends the layer when result stayed VK_SUCCESS. The two missing-field checks for api_version and implementation_version jump to out: without setting the failure result, so the layer is appended anyway.

Both checks sit above the library_path parsing, so the appended layer never gets a lib_name. Once such a layer is activated the loader calls loader_platform_open_library(NULL). dlopen(NULL) returns the host program handle, and loader_open_layer_file then logs the NULL lib_name through a %s conversion. Layer manifests are untrusted input, so a manifest dropping one key is enough to reach this.

Set the failure result in both checks to match the neighbours. Added a regression test covering both fields.

@ci-tester-lunarg

Copy link
Copy Markdown

Author aizu-m not on autobuild list. Waiting for curator authorization before starting CI build.

1 similar comment
@ci-tester-lunarg

Copy link
Copy Markdown

Author aizu-m not on autobuild list. Waiting for curator authorization before starting CI build.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 43626.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3642 running.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3642 passed.

@charles-lunarg
charles-lunarg merged commit 2d39628 into KhronosGroup:main Jul 16, 2026
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants