[PATCH] D30804: [llvm-readobj] Only print the real size of the note

Roland McGrath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 11 13:44:03 PST 2017


mcgrathr accepted this revision.
mcgrathr added a comment.
This revision is now accepted and ready to land.

LGTM.

This tool really should validate all its input's size fields, but that's a separate issue from this change and needs to be done here for n_namesz as well as n_descsz, and presumably lots of other places throughout the tool(s).  binutils and elfutils have had volunteers doing input fuzzing that found many such holes.  LLVM's ELF tools could use some of that too.

Neither binutils nor elfutils does anything about unprintable bytes in the contents  of NT_GNU_GOLD_VERSION, but both do stop printing at the first '\0' (so if they'd had the printing-the-padding bug too it might have gone unnoticed since it wouldn't had affected the output when the first padding byte was zero, which in practice it always is).  I'm willing to call it a feature to print the whole string rather than truncating it at the first '\0', but I'll point out the difference with other tools for the record.


Repository:
  rL LLVM

https://reviews.llvm.org/D30804





More information about the llvm-commits mailing list