Add security guards to avoid crashes in torch::jit module #102156
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi!
I've been fuzzing different pytorch modules with with sydr-fuzz, and found a multiple crashes in torch::jit::load() function.
All found errors could be reproduced with provided docker: Dockerfile.
Crash in torch/csrc/jit/unpickler.cpp:1075
crash-1f59083b8396c5b62b4705c7556e68f129e833b1.zip
Crash in torch/csrc/jit/unpickler.cpp:386
crash-2e9923de375c393e700e8c0441f0ebe8252ca364.zip
Crash in torch/csrc/jit/serialization/source_range_serialization.cpp:211
crash-5598d386057152f606bfa69d85605499e8852625.zip
Segmentation fault in /pytorch/aten/src/ATen/core/ivalue.h:526
crash-9bd059c1ae85ab9cdb41d786932214d942baa189.zip