Skip to content

Validate tensor sizes during method load #7663

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

Merged
merged 1 commit into from
Jan 17, 2025

Conversation

dbort
Copy link
Contributor

@dbort dbort commented Jan 14, 2025

Summary:
If a tensor's sizes array contains a negative value, the TensorImpl ctor will panic.

Validate sizes before creating the TensorImpl to treat this as a non-fatal error when loading malformed PTE files.

Differential Revision: D68180029

Copy link

pytorch-bot bot commented Jan 14, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/7663

Note: Links to docs will display an error until the docs builds have been completed.

⏳ No Failures, 1 Pending

As of commit 1075351 with merge base 1b7b10e (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-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 Jan 14, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D68180029

@JacobSzwejbka
Copy link
Contributor

Why didnt we just make it a uint in the schema originally 🤔

Summary:

If a tensor's `sizes` array contains a negative value, the TensorImpl ctor will panic.

Validate sizes before creating the TensorImpl to treat this as a non-fatal error when loading malformed PTE files.

Reviewed By: JacobSzwejbka

Differential Revision: D68180029
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D68180029

@facebook-github-bot facebook-github-bot merged commit fbb0395 into pytorch:main Jan 17, 2025
10 of 11 checks passed
YIWENX14 pushed a commit that referenced this pull request Jan 28, 2025
Differential Revision: D68180029

Pull Request resolved: #7663
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. fb-exported topic: not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants