Uh oh!
There was an error while loading. Please reload this page.
Stack buffer overflow in prepare_input_tensors() due to unchecked memcpy size - #16797
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/16797
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 8 PendingAs of commit b1dadab with merge base 86b4bea ( NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a |
There was a problem hiding this comment.
Pull request overview
Mitigates a stack buffer overflow risk in prepare_input_tensors() by validating scalar input buffer sizes before copying into stack-allocated variables.
Changes:
- Add strict size checks for
Tag::Int(int64_t),Tag::Double(double), andTag::Bool(bool) inputs prior tomemcpy. - Return
InvalidArgumentwith a descriptive error when the provided scalar buffer size is unexpected.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
mergennachin
commented
Jan 22, 2026
Can you add a regression test? |
b0e5c6d to
8c8d7dcCompareThere was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
8c8d7dc to
c621f13Comparec621f13 to
33aa861Compare33aa861 to
8090b55CompareThere was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
lucylq
commented
Jan 23, 2026
@mergennachin added one for double. Feel like that should be OK as it's the same logic, and adding tests for bool/int would need new models to |
Uh oh!
There was an error while loading. Please reload this page.
larryliu0820
left a comment
There was a problem hiding this comment.
Left some non-blocking comments
8090b55 to
801f5a3CompareThere was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
801f5a3 to
e95bc65CompareThere was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
e95bc65 to
1f63405Compare1f63405 to
9c75403CompareThere was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
9c75403 to
b1dadabCompareUh oh!
There was an error while loading. Please reload this page.
Summary
Add size checks for int, double, bool before memcpying. Otherwise the input buffer may be larger than the intended size and overwrite adjacent memory.
Test Plan