fix: Improve validation for system shared memory register#8336
Merged
Conversation
pskiran1
commented
Aug 8, 2025
| const std::size_t first_non_slash = key_view.find_first_not_of('/'); | ||
|
|
||
| // If the entire key is slashes | ||
| if (first_non_slash == std::string_view::npos) { |
Member
Author
There was a problem hiding this comment.
This validation is optional; if we skip it, the code will fail later.
Since we need to check for slashes in this function, I added this validation to return error early.
pskiran1
marked this pull request as ready for review
August 8, 2025 17:06
yinggeh
self-requested a review
August 8, 2025 18:06
Contributor
|
Is |
Member
Author
Thank you for your note. I verified it, and it’s not an issue. It bypasses the validation, but the server still rejects it because it does not read the PB SHM and treats it as a different one. If we try to create an shm handle using the client, POSIX shm_open also rejects it with an error. |
pskiran1
added a commit
that referenced
this pull request
Aug 11, 2025
20 tasks
mc-nv
pushed a commit
that referenced
this pull request
Aug 11, 2025
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.
What does the PR do?
This PR is an enhancement for #8273.
Previously, users could bypass validation by using a leading slash in shm_key, such as
"/triton_python_backend_shm_region_my_test_shm_key","///triton_python_backend_shm_region_my_test_shm_key"Checklist
<commit_type>: <Title>Commit Type:
Check the conventional commit type
box here and add the label to the github PR.
Related PRs:
Where should the reviewer start?
Test plan:
Caveats:
Background
Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)