loader: Fix missing bounds check in parse_id_filter_environment_var#1910
Merged
charles-lunarg merged 1 commit intoJun 1, 2026
Merged
Conversation
Both parse_generic_filter_environment_var and parse_layers_disable_filter_environment_var correctly guard against exceeding MAX_ADDITIONAL_FILTERS before writing into their fixed-size filter arrays. parse_id_filter_environment_var was the only filter parser that lacked this guard, meaning a sufficiently long comma- separated environment variable (e.g. VK_LOADER_DEBUG) could write beyond the end of loader_envvar_id_filter::filters[MAX_ADDITIONAL_FILTERS], overflowing the stack or adjacent heap memory. Add the same count >= MAX_ADDITIONAL_FILTERS early-break that the other two parsers already use, and emit a WARN log entry so users know that entries beyond the limit are silently ignored. Fixes: write past end of loader_envvar_id_filter::filters[] Reported-by: code review Reviewed-by: (pending)
|
Author kaushalrog not on autobuild list. Waiting for curator authorization before starting CI build. |
1 similar comment
|
Author kaushalrog not on autobuild list. Waiting for curator authorization before starting CI build. |
charles-lunarg
approved these changes
Jun 1, 2026
|
CI Vulkan-Loader build queued with queue ID 752283. |
|
CI Vulkan-Loader build # 3497 running. |
|
CI Vulkan-Loader build # 3497 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.
Both parse_generic_filter_environment_var and
parse_layers_disable_filter_environment_var correctly guard against exceeding MAX_ADDITIONAL_FILTERS before writing into their fixed-size filter arrays. parse_id_filter_environment_var was the only filter parser that lacked this guard, meaning a sufficiently long comma- separated environment variable (e.g. VK_LOADER_DEBUG) could write beyond the end of loader_envvar_id_filter::filters[MAX_ADDITIONAL_FILTERS], overflowing the stack or adjacent heap memory.
Add the same count >= MAX_ADDITIONAL_FILTERS early-break that the other two parsers already use, and emit a WARN log entry so users know that entries beyond the limit are silently ignored.
Fixes: write past end of loader_envvar_id_filter::filters[]
Reported-by: code review
Reviewed-by: (pending)