Skip to content

prevent stack overflow in check_name_matches_filter_environment_var#1912

Merged
charles-lunarg merged 1 commit into
KhronosGroup:mainfrom
aizu-m:filter-name-length-bounds
Jun 2, 2026
Merged

prevent stack overflow in check_name_matches_filter_environment_var#1912
charles-lunarg merged 1 commit into
KhronosGroup:mainfrom
aizu-m:filter-name-length-bounds

Conversation

@aizu-m
Copy link
Copy Markdown
Contributor

@aizu-m aizu-m commented Jun 2, 2026

check_name_matches_filter_environment_var lowercases its name argument into a fixed lower_name[VK_MAX_EXTENSION_NAME_SIZE] buffer indexed by strlen(name). Layer names are capped to that size when the manifest is parsed, but loader_icd_scan hands the ICD manifest filename to the driver select/disable filters, and a filename carries no such cap, so a long one writes past lower_name. Clamp the length the same way settings.c already does for layer names.

@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.

Copy link
Copy Markdown
Collaborator

@charles-lunarg charles-lunarg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a decent fix, but reveals a bigger problem - loader_icd_scan calls check_name_matches_filter_environment_var but gives it unbounded length strings.

Trying to support both in the same function is difficult, so I would rather approve this PR and create a followup issue to track it.

@ci-tester-lunarg
Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 754244.

@ci-tester-lunarg
Copy link
Copy Markdown

CI Vulkan-Loader build # 3500 running.

@ci-tester-lunarg
Copy link
Copy Markdown

CI Vulkan-Loader build # 3500 passed.

@charles-lunarg charles-lunarg merged commit bd74c3c into KhronosGroup:main Jun 2, 2026
46 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