Skip to content

Fix out_of_bounds_read in getConstantDataPtr (XNNCompiler.cpp) (T267371218)#19595

Open
psiddh wants to merge 1 commit into
pytorch:mainfrom
psiddh:export-D104380965
Open

Fix out_of_bounds_read in getConstantDataPtr (XNNCompiler.cpp) (T267371218)#19595
psiddh wants to merge 1 commit into
pytorch:mainfrom
psiddh:export-D104380965

Conversation

@psiddh
Copy link
Copy Markdown
Contributor

@psiddh psiddh commented May 14, 2026

Reviewed By: psiddh

Differential Revision: D104380965

…71218)

Reviewed By: psiddh

Differential Revision: D104380965
Copilot AI review requested due to automatic review settings May 14, 2026 16:46
@psiddh psiddh requested a review from digantdesai as a code owner May 14, 2026 16:46
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented May 14, 2026

🔗 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 SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 3 New Failures, 3 Unrelated Failures

As of commit 3217833 with merge base 12c1195 (image):

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.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 14, 2026
@github-actions
Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_size through the compilation pipeline so constant data lookups can be validated.
  • Add an out-of-bounds guard for {offset, size} entries before returning constant_data_ptr + offset.
  • Include <cinttypes> to safely format uint64_t values in error messages.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@psiddh psiddh requested a review from GregoryComer May 14, 2026 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants