Skip to content

Remove fatal ET_CHECK for unknown instruction #1515

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

Closed
wants to merge 6 commits into from

Conversation

dbort
Copy link
Contributor

@dbort dbort commented Jan 3, 2024

Summary: Turn an ET_CHECK into an error return when encountering an unknown instruction type.

Differential Revision: D52451743

Copy link

pytorch-bot bot commented Jan 3, 2024

🔗 Helpful Links

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

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

✅ No Failures

As of commit 2008b66 with merge base a81c2d4 (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 3, 2024
@facebook-github-bot
Copy link
Contributor

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

dbort added a commit to dbort/executorch that referenced this pull request Jan 3, 2024
Summary:

Turn an ET_CHECK into an error return when encountering an unknown instruction type.

Differential Revision: D52451743
dbort added 6 commits January 2, 2024 16:57
Summary:

Don't fail fatally if the .pte file contains an unknown type enum value. Discovered by lionhead fuzzing.

Differential Revision: D52493415
Summary:

Flatbuffer array fields can be missing, so we need to check for `nullptr` before calling `size()` on them. Discovered by lionhead fuzzing.

Differential Revision: D52493423
Summary:

Fail non-fatally when encountering an unknown/unhandled `ScalarType` in a `.pte` file. As part of this:
- Move the "types not supported yet" logic out of `scalar_type_util` and into `tensor_parser`, since that decision is an aspect of the runtime and not a fundamental aspect of `ScalarType`.
- Remove the now-duplicate `sizeof_scalar_type` function, which is the same as the exsting `elementSize` function. Before this diff, `sizeof_scalar_type` did the "unsupported" checks that have now moved.
- Add an `isValid()` function to let users of `ScalarType` know whether a given enum value is legit. This makes it possible to avoid the fatal error when calling `elementSize` on a bad value.
- Add unit tests for the new `isValid()`.

Differential Revision: D52451738
Summary:

Ensure that arg indices are in range before looking up values. Corrupted files with very large indices could cause arbitrary memory reads.

Differential Revision: D52451739
Summary:

Ensure that op indices are in range before looking up values. Corrupted files with very large indices could cause arbitrary memory reads.

Also ensure that the chains array is present before calling `size()` on it.

Differential Revision: D52451740
Summary:

Turn an ET_CHECK into an error return when encountering an unknown instruction type.

Differential Revision: D52451743
@dbort dbort force-pushed the export-D52451743 branch from 04ec31b to 2008b66 Compare January 3, 2024 00:58
@facebook-github-bot
Copy link
Contributor

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

dbort added a commit to dbort/executorch that referenced this pull request Jan 3, 2024
Summary:

Turn an ET_CHECK into an error return when encountering an unknown instruction type.

Differential Revision: D52451743
dbort added a commit to dbort/executorch that referenced this pull request Jan 3, 2024
Summary:

Turn an ET_CHECK into an error return when encountering an unknown instruction type.

Differential Revision: D52451743
dbort added a commit to dbort/executorch that referenced this pull request Jan 3, 2024
Summary:

Turn an ET_CHECK into an error return when encountering an unknown instruction type.

Differential Revision: D52451743
dbort added a commit to dbort/executorch that referenced this pull request Jan 3, 2024
Summary:

Turn an ET_CHECK into an error return when encountering an unknown instruction type.

Differential Revision: D52451743
dbort added a commit to dbort/executorch that referenced this pull request Jan 3, 2024
Summary:

Turn an ET_CHECK into an error return when encountering an unknown instruction type.

Differential Revision: D52451743
dbort added a commit to dbort/executorch that referenced this pull request Jan 3, 2024
Summary:

Turn an ET_CHECK into an error return when encountering an unknown instruction type.

Differential Revision: D52451743
dbort added a commit to dbort/executorch that referenced this pull request Jan 3, 2024
Summary:

Turn an ET_CHECK into an error return when encountering an unknown instruction type.

Differential Revision: D52451743
dbort added a commit to dbort/executorch that referenced this pull request Jan 3, 2024
Summary:

Turn an ET_CHECK into an error return when encountering an unknown instruction type.

Differential Revision: D52451743
dbort added a commit to dbort/executorch that referenced this pull request Jan 3, 2024
Summary:

Turn an ET_CHECK into an error return when encountering an unknown instruction type.

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

This pull request has been merged in 46300bc.

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 Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants