Bug 289470 - Loading of large Mach-O thin binaries fails.
Summary: Loading of large Mach-O thin binaries fails.
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.7 SVN
Platform: Unlisted Binaries macOS
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-21 00:19 UTC by Scott Byer
Modified: 2012-07-13 13:34 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch to fix the problem. (725 bytes, patch)
2011-12-21 00:19 UTC, Scott Byer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Byer 2011-12-21 00:19:38 UTC
Created attachment 66963 [details]
Patch to fix the problem.

Darwin barnbyerner.mtv.corp.google.com 11.2.0 Darwin Kernel Version 11.2.0: Tue Aug  9 20:54:00 PDT 2011; root:xnu-1699.24.8~1/RELEASE_X86_64 x86_64

load_thin_file currently uses the wrong value (size instead of len) to determine the end of the headers section. A large thin binary can end up wrapping around the end pointer, causing the sanity check in the headers load loop to fail.  (binary I was using was Chromium's browser_tests, as build on Lion w/ make). Patch attached.
Comment 1 Julian Seward 2012-07-13 13:34:57 UTC
Committed, r12739.  Thanks for the diagnosis + patch.