New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Crash] torch.searchsorted
with out-of-bound sorter
#91606
Comments
I am happy to send a PR to fix this issue. However, it seems to safely use |
BTW, it seems the first link in https://github.com/pytorch/pytorch/security/policy is currently invalid (maybe I should report this case there if it becomes available). |
Hmm, what do you see when you are trying to access it? |
But you can access https://github.com/pytorch/pytorch/security/advisories, right? |
OK, I will try. I just hid the POC in #91606 (comment) in public for now. |
Oh, I can do a private report now. It seems the green block now appears. |
I've just tweaked the settings, but I'm curious, is the link correct? |
@ganler if you have the change that adds a boundary check, please do not hesitate to send a PR |
Sure, but just want to confirm with you that the "boundary check" will be applied to every element in the |
Fixes #91606, but in C++14 style. Prior fix (#94863) was in C++17 which might violate some builds. Pull Request resolved: #95109 Approved by: https://github.com/ngimel
…h#94863) Fixes pytorch#91606 Add a checker to `sorter` to make sure indices are inbound (as NumPy). Pull Request resolved: pytorch#94863 Approved by: https://github.com/Skylion007, https://github.com/malfet
Fixes pytorch#91606, but in C++14 style. Prior fix (pytorch#94863) was in C++17 which might violate some builds. Pull Request resolved: pytorch#95109 Approved by: https://github.com/ngimel
🐛 Describe the bug
torch.searchsorted
should check the integrity ofsorter
where all elements (which represent indices) should be smaller thansorted_sequence
's inner-most dimension size (3 here). Otherwise this is a out-of-bound read which leads to either:In numpy, the elements of
sorter
will be checked to make sure the data integrity:Versions
Env [click to expand]
The text was updated successfully, but these errors were encountered: