Fix out_of_bounds_read in getConstantDataPtr (XNNCompiler.cpp) (T267371218)#19595
Fix out_of_bounds_read in getConstantDataPtr (XNNCompiler.cpp) (T267371218)#19595psiddh wants to merge 1 commit into
Conversation
…71218) Reviewed By: psiddh Differential Revision: D104380965
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/19595
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: ❌ 3 New Failures, 3 Unrelated FailuresAs of commit 3217833 with merge base 12c1195 ( NEW FAILURES - The following jobs have failed:
FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
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
This PR hardens XNNPACK constant-weight loading by adding explicit bounds checking when resolving constant data offsets, preventing out-of-bounds reads when deserializing models that use the external constant-data region (via XNNHeader).
Changes:
- Pass
constant_data_sizethrough the compilation pipeline so constant data lookups can be validated. - Add an out-of-bounds guard for
{offset, size}entries before returningconstant_data_ptr + offset. - Include
<cinttypes>to safely formatuint64_tvalues in error messages.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Reviewed By: psiddh
Differential Revision: D104380965