Use safe_numel() in et#19075
Conversation
The wasm bindings' assert_valid_numel() helper previously computed numel without overflow detection, letting a malicious tensor shape wrap to a small value that bypassed the data-size check. Replace with safe_numel() (returns Result<ssize_t>) and propagate the error via THROW_IF_ERROR as a JavaScript exception, matching the rest of the wasm error plumbing. Authored with Claude. Differential Revision: [D102082911](https://our.internmc.facebook.com/intern/diff/D102082911/) [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/19075
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ❌ 1 Cancelled Job, 1 Pending, 4 Unrelated FailuresAs of commit 75530a3 with merge base eef7921 ( CANCELLED JOB - The following job was cancelled. Please retry:
FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
BROKEN TRUNK - The following jobs failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
The wasm bindings' assert_valid_numel() helper previously computed numel without overflow detection, letting a malicious tensor shape wrap to a small value that bypassed the data-size check. Replace with safe_numel() (returns Result<ssize_t>) and propagate the error via THROW_IF_ERROR as a JavaScript exception, matching the rest of the wasm error plumbing. Authored with Claude. Differential Revision: [D102082911](https://our.internmc.facebook.com/intern/diff/D102082911/) [ghstack-poisoned]
Pull Request resolved: #19075 Replace compute_numel() with safe_numel() Authored with Claude. ghstack-source-id: 371824079 @exported-using-ghexport Differential Revision: [D102082911](https://our.internmc.facebook.com/intern/diff/D102082911/)
The wasm bindings' assert_valid_numel() helper previously computed numel without overflow detection, letting a malicious tensor shape wrap to a small value that bypassed the data-size check. Replace with safe_numel() (returns Result<ssize_t>) and propagate the error via THROW_IF_ERROR as a JavaScript exception, matching the rest of the wasm error plumbing. Authored with Claude. Differential Revision: [D102082911](https://our.internmc.facebook.com/intern/diff/D102082911/) [ghstack-poisoned]
Pull Request resolved: #19075 Replace compute_numel() with safe_numel() Authored with Claude. ghstack-source-id: 372480318 @exported-using-ghexport Differential Revision: [D102082911](https://our.internmc.facebook.com/intern/diff/D102082911/)
The wasm bindings' assert_valid_numel() helper previously computed numel without overflow detection, letting a malicious tensor shape wrap to a small value that bypassed the data-size check. Replace with safe_numel() (returns Result<ssize_t>) and propagate the error via THROW_IF_ERROR as a JavaScript exception, matching the rest of the wasm error plumbing. Authored with Claude. Differential Revision: [D102082911](https://our.internmc.facebook.com/intern/diff/D102082911/) [ghstack-poisoned]
Pull Request resolved: #19075 Replace compute_numel() with safe_numel() Authored with Claude. ghstack-source-id: 372584817 @exported-using-ghexport Differential Revision: [D102082911](https://our.internmc.facebook.com/intern/diff/D102082911/)
The wasm bindings' assert_valid_numel() helper previously computed numel without overflow detection, letting a malicious tensor shape wrap to a small value that bypassed the data-size check. Replace with safe_numel() (returns Result<ssize_t>) and propagate the error via THROW_IF_ERROR as a JavaScript exception, matching the rest of the wasm error plumbing. Authored with Claude. Differential Revision: [D102082911](https://our.internmc.facebook.com/intern/diff/D102082911/) [ghstack-poisoned]
Pull Request resolved: #19075 Replace compute_numel() with safe_numel() Authored with Claude. ghstack-source-id: 372584817 @exported-using-ghexport Differential Revision: [D102082911](https://our.internmc.facebook.com/intern/diff/D102082911/)
The wasm bindings' assert_valid_numel() helper previously computed numel without overflow detection, letting a malicious tensor shape wrap to a small value that bypassed the data-size check. Replace with safe_numel() (returns Result<ssize_t>) and propagate the error via THROW_IF_ERROR as a JavaScript exception, matching the rest of the wasm error plumbing. Authored with Claude. Differential Revision: [D102082911](https://our.internmc.facebook.com/intern/diff/D102082911/) [ghstack-poisoned]
Pull Request resolved: #19075 Replace compute_numel() with safe_numel() Authored with Claude. ghstack-source-id: 372649703 @exported-using-ghexport Differential Revision: [D102082911](https://our.internmc.facebook.com/intern/diff/D102082911/)
b84894f
into
gh/lucylq/155/base
Differential Revision: D102082911 Pull Request resolved: #19075
Stack from ghstack (oldest at bottom):
The wasm bindings' assert_valid_numel() helper previously computed numel without overflow detection, letting a malicious tensor shape wrap to a small value that bypassed the data-size check. Replace with safe_numel() (returns Result<ssize_t>) and propagate the error via THROW_IF_ERROR as a JavaScript exception, matching the rest of the wasm error plumbing.
Authored with Claude.
Differential Revision: D102082911