PyTorch v0.1.10 legacy negative storageOffset first-write abort PoC
This repository contains two PyTorch v0.1.10 legacy .pt files:
- a normal control legacy tensor-ref artifact
- a malicious legacy tensor-ref artifact whose serialized tensor
storageOffsetis changed from0to-1
Observed in the pinned torch 0.1.10.post2 Python 2.7 runtime:
- control:
torch.load(path)succeedstorch.load(path); x.zero_()succeedstorch.load(path); x.fill_(7)succeeds
- malicious:
torch.load(path)still succeedstorch.load(path); x.zero_()aborts withfree(): invalid pointertorch.load(path); x.fill_(7)aborts withmunmap_chunk(): invalid pointer
Reproduction:
python3 reproduce/replay_negative_storageoffset_write_abort.py --repeat 3