fix off-by-one scanf width in filter_parse_component_name#10854
Open
jmestwa-coder wants to merge 1 commit into
Open
fix off-by-one scanf width in filter_parse_component_name#10854jmestwa-coder wants to merge 1 commit into
jmestwa-coder wants to merge 1 commit into
Conversation
Collaborator
|
Can one of the admins verify this patch?
|
lgirdwood
requested changes
Jun 9, 2026
lgirdwood
left a comment
Member
There was a problem hiding this comment.
@jmestwa-coder can you add a proper commit message and sign off. Thanks !
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a stack-buffer off-by-one overflow in tools/logger’s -F component-name parsing by ensuring sscanf()’s scanset conversion cannot write a full UUID_NAME_MAX_LEN characters plus the terminating NUL into a UUID_NAME_MAX_LEN buffer.
Changes:
- Cap the
sscanf()width used for parsing component names toUUID_NAME_MAX_LEN - 1to leave space for the NUL terminator.
Comment on lines
105
to
+107
| if (strlen(scan_format_string) == 0) { | ||
| ret = snprintf(scan_format_string, sizeof(scan_format_string), | ||
| "%%%d[^0-9* ]s", UUID_NAME_MAX_LEN); | ||
| "%%%d[^0-9* ]s", UUID_NAME_MAX_LEN - 1); |
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.
sscanf writes one byte past comp_name when parsing a -F component name:
Capped the scan width at UUID_NAME_MAX_LEN - 1.