[PATCH] D43684: [WebAssembly] Add validation to reloc section

Nicholas Wilson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 23 08:40:44 PST 2018


ncw created this revision.
ncw added reviewers: dschuff, sunfish, sbc100.
Herald added subscribers: llvm-commits, aheejin, jgravelle-google, jfb.

When reading in the reloc sections, check that the offsets are within the allowed range, and that the symbol indexes are within range and also point to the right symbol type.

Could this be controversial?!? I know some people advocate for "minimal" correctness checks in LLVM, since the linker reads in hundreds of object files and we don't want to do expensive validation for each one.

These checks are pretty lightweight though, and should handily catch any bugs we might have.


Repository:
  rL LLVM

https://reviews.llvm.org/D43684

Files:
  include/llvm/Object/Wasm.h
  lib/Object/WasmObjectFile.cpp
  test/ObjectYAML/wasm/code_section.yaml
  test/ObjectYAML/wasm/data_section.yaml

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43684.135648.patch
Type: text/x-patch
Size: 6729 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180223/11c64a3e/attachment.bin>


More information about the llvm-commits mailing list