Skip to content

Add input size validation to Module.execute #10701

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

keyprocedure
Copy link
Contributor

Summary

Adds input size validation to Module.execute to prevent possible silent memory corruption when too many EValue inputs are passed.

Fixes #10510

Test plan

  • Added unit test TestExecuteWithTooManyInputs

  • Verified by successfully running all module_test.cpp tests, except TestPTD (did not have access to ModuleLinear.ptd)

  • To run locally:

    • Bypass is_fbcode guard in targets.bzl and redirect test file paths to use a locally exported ModuleAdd.pte file
    • Build and run tests via:
    buck2 build //extension/module/test:test
    buck2 run //extension/module/test:test
    

@keyprocedure keyprocedure requested a review from shoumikhin as a code owner May 5, 2025 23:56
Copy link

pytorch-bot bot commented May 5, 2025

🔗 Helpful Links

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

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:

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 May 5, 2025
@keyprocedure
Copy link
Contributor Author

@pytorchbot label "topic: not user facing"

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. topic: not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Module.execute does not check input count
2 participants