diff options
| author | Vedant Kumar <vsk@apple.com> | 2017-10-23 18:04:34 +0000 |
|---|---|---|
| committer | Vedant Kumar <vsk@apple.com> | 2017-10-23 18:04:34 +0000 |
| commit | 35b50a83aba3a5eedd3395341b5be76600a6841c (patch) | |
| tree | f70f4bba61b5f853cf7edcf6653510af4d8505b7 /llvm/test/tools | |
| parent | 1108d072f47b74ff671df61b434a18da02f4dd3e (diff) | |
| download | bcm5719-llvm-35b50a83aba3a5eedd3395341b5be76600a6841c.tar.gz bcm5719-llvm-35b50a83aba3a5eedd3395341b5be76600a6841c.zip | |
[wasm] readSection: Avoid reading past eof (fixes oss-fuzz #3219)
A wasm file crafted with a bogus section size can trigger an ASan issue
in the DWARFObjInMemory constructor. Nip the problem in the bud when we
read the wasm section.
Found by OSS-Fuzz:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3219
Differential Revision: https://reviews.llvm.org/D38777
llvm-svn: 316357
Diffstat (limited to 'llvm/test/tools')
| -rw-r--r-- | llvm/test/tools/llvm-objdump/Inputs/corrupt-section.wasm | bin | 0 -> 22 bytes | |||
| -rw-r--r-- | llvm/test/tools/llvm-objdump/wasm-corrupt-section.test | 2 |
2 files changed, 2 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-objdump/Inputs/corrupt-section.wasm b/llvm/test/tools/llvm-objdump/Inputs/corrupt-section.wasm Binary files differnew file mode 100644 index 00000000000..3bf45f715db --- /dev/null +++ b/llvm/test/tools/llvm-objdump/Inputs/corrupt-section.wasm diff --git a/llvm/test/tools/llvm-objdump/wasm-corrupt-section.test b/llvm/test/tools/llvm-objdump/wasm-corrupt-section.test new file mode 100644 index 00000000000..9ba7a7ef6bd --- /dev/null +++ b/llvm/test/tools/llvm-objdump/wasm-corrupt-section.test @@ -0,0 +1,2 @@ +# RUN: not llvm-objdump -h %p/Inputs/corrupt-section.wasm 2>&1 | FileCheck %s +# CHECK: '{{.*}}corrupt-section.wasm': Section too large |

