Skip to content
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

[TorchFix] Add codemod for unsafe load #4715

Merged
merged 3 commits into from
Nov 9, 2023
Merged

Conversation

kit1980
Copy link
Member

@kit1980 kit1980 commented Nov 9, 2023

#4671 added linter-only TorchUnsafeLoadVisitor, but it turned out that the issue is so widespread that manual fixes would be tedious.

The codemod is somewhat unsafe correctness-wise because full pickling functionality may still be needed even without pickle_module, but I think it's OK because it fixes a security-related issue and the codemods need to be verified anyway.

Maybe later we should add something like Ruff's recently added --unsafe-fixes: https://docs.astral.sh/ruff/linter/#fix-safety

I used this for pytorch/vision#8105

Copy link

vercel bot commented Nov 9, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
torchci ⬜️ Ignored (Inspect) Visit Preview Nov 9, 2023 2:25am

@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 Nov 9, 2023
@kit1980 kit1980 requested a review from malfet November 9, 2023 01:28
@kit1980 kit1980 marked this pull request as ready for review November 9, 2023 01:28
@kit1980 kit1980 merged commit 6c6442c into main Nov 9, 2023
3 checks passed
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