This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Fix AddressSanitizer heap-buffer-overflow in disassembling
ClosedPublic

Authored by apazos on Sep 5 2018, 4:04 PM.

Details

Summary

RISCVDisassembler should check number of bytes available before reading them.
Crash noticed when enabling -DLLVM_USE_SANITIZER=Address.

This bug was uncovered by a LLVM MC Disassembler Protocol Buffer Fuzzer for the RISC-V assembly language.

Diff Detail

Repository
rL LLVM

Event Timeline

apazos created this revision.Sep 5 2018, 4:04 PM
asb accepted this revision.Sep 6 2018, 7:18 AM

Looks good to me, thanks.

This revision is now accepted and ready to land.Sep 6 2018, 7:18 AM
apazos updated this revision to Diff 164471.Sep 7 2018, 11:20 AM

Moved test to MC/Disassembler/RISCV

This revision was automatically updated to reflect the committed changes.