Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4745)

Issue 49008: Issue 357: New Linux file_id code doesn't persist across strip (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 4 months ago by Ted Mielczarek
Modified:
14 years, 4 months ago
Reviewers:
agl, zhanglei, mochalatte
CC:
google-breakpad-dev_googlegroups.com
Base URL:
http://google-breakpad.googlecode.com/svn/trunk/
Visibility:
Public.

Description

The Linux client rewrite changed the file id to be a 16-byte XOR of the first
page of the binary. This doesn't really work very well for Breakpad, since
generally you'll dump the symbols, then strip the binaries, which will result in
different IDs for stripped and unstripped binaries. I've revived some bits of
the old code, which locates the .text section, but changed it to XOR the first
4k of that data instead of generating an MD5 hash.

I've attempted to follow the guidelines for code that runs within the
compromised process, the new code in file_id.cc that's shared uses the libc and
syscall helpers, and doesn't do any allocation. The only thing I was unsure of
was calling sys_mmap2 in LinuxDumper::ElfFileIdentifierForMapping. Is that ok?
There isn't any other way to easily figure out where the text section starts,
AFAICT.

One other caveat is that you can't use this code as written to calculate a file
ID of a binary of different word size than the binary you're running, so you
can't use a 64-bit dump_syms to dump 32-bit binaries, for example. I don't have
any pressing need for that particular configuration, but I thought I'd mention
it.

Patch Set 1 #

Total comments: 12
Unified diffs Side-by-side diffs Delta from patch set Stats Patch
src/client/linux/Makefile View 1 chunk +1 line, -0 lines 0 comments Download
src/client/linux/minidump_writer/linux_dumper.cc View 2 chunks +27 lines, -0 lines 3 comments Download
src/client/linux/minidump_writer/linux_dumper.h View 2 chunks +5 lines, -0 lines 0 comments Download
src/client/linux/minidump_writer/linux_dumper_unittest.cc View 2 chunks +65 lines, -0 lines 1 comment Download
src/client/linux/minidump_writer/minidump_writer.cc View 1 chunk +5 lines, -20 lines 3 comments Download
src/common/linux/file_id.cc View 3 chunks +79 lines, -14 lines 4 comments Download
src/common/linux/file_id.h View 1 chunk +8 lines, -2 lines 0 comments Download
src/common/linux/file_id_unittest.cc View 1 chunk +76 lines, -0 lines 0 comments Download
src/tools/linux/dump_syms/Makefile View 2 chunks +17 lines, -0 lines 1 comment Download

Messages

Total messages: 7
Ted Mielczarek
14 years, 4 months ago #1
zhanglei
FYI, for Google Chrome, we currently dump the symbol, strip the binary, then take the ...
14 years, 4 months ago #2
Ted Mielczarek
Yeah, I asked Neal and he confirmed that that's what was happening. No offense, but ...
14 years, 4 months ago #3
agl
Generally LGTM, however, nealsid should have the final say. http://breakpad.appspot.com/49008/diff/1/7 File src/client/linux/minidump_writer/linux_dumper.cc (right): http://breakpad.appspot.com/49008/diff/1/7#newcode166 Line ...
14 years, 4 months ago #4
mochalatte
LGTM with some minor nits in addition to agl's feedback Thanks, Ted. Neal http://breakpad.appspot.com/49008/diff/1/3 File ...
14 years, 4 months ago #5
Ted Mielczarek
http://breakpad.appspot.com/49008/diff/1/7 File src/client/linux/minidump_writer/linux_dumper.cc (right): http://breakpad.appspot.com/49008/diff/1/7#newcode166 Line 166: uint8_t identifier[sizeof(MDGUID)]) On 2009/12/18 23:07:29, agl wrote: > ...
14 years, 4 months ago #6
agl
14 years, 4 months ago #7
http://breakpad.appspot.com/49008/diff/1/9
File src/client/linux/minidump_writer/minidump_writer.cc (right):

http://breakpad.appspot.com/49008/diff/1/9#newcode552
Line 552: dumper_.ElfFileIdentifierForMapping(i, signature);
On 2009/12/23 16:50:12, Ted Mielczarek wrote:
> This actually violates the style guide:
>
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Functi...

You can leave it as is. The style guide is flat out wrong here, but I'm too old
to care these days.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1004:630ec63f810e-tainted