Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Issue 1928683002: [Courgette] ELF: Fix abs32 / rel32 ordering in ParseFile() and restrict rel32 parsing to .text. (Closed)

Created:
4 years, 7 months ago by huangs
Modified:
4 years, 7 months ago
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Courgette] ELF: Fix abs32 / rel32 ordering in ParseFile() and restrict rel32 parsing to .text. This CL fixes 2 problems in Courgette ELF parsing: 1. ParseFile() scans through file bytes in file offset order while visiting abs32 and rel32 locations in lockstep. However, these locations were previously not sorted by file offset, resulting in some abs32 and rel32 locations being ignored. 2. ParseRel32RelocsFromSections() is too permissive, and extracts bogus rel32 addresses from non-code. To solve (1) we sort abs32 and rel32 addresses by file offset in ParseFile(). To solve (2) we restrict rel32 parsing to ".text" section (heuristic). Also updating ELF test results. BUG=601948 Committed: https://crrev.com/3da0dd9308f66ae1122bbaefda2c99a4f90372d4 Cr-Commit-Position: refs/heads/master@{#390506}

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+40 lines, -16 lines) Patch
M courgette/disassembler_elf_32.h View 2 chunks +7 lines, -1 line 0 comments Download
M courgette/disassembler_elf_32.cc View 3 chunks +26 lines, -8 lines 3 comments Download
M courgette/disassembler_elf_32_x86_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M courgette/encode_decode_unittest.cc View 3 chunks +5 lines, -5 lines 0 comments Download

Messages

Total messages: 16 (5 generated)
huangs
Please note that this affects ELF results. For production (Win32) this affects nacl_irt_x86_32.nexe: Fixing bug ...
4 years, 7 months ago (2016-04-27 18:02:53 UTC) #3
Andrew Hayden (chromium.org)
I am not qualified to review this from knowledge of the ELF standard, but logically ...
4 years, 7 months ago (2016-04-28 10:13:55 UTC) #4
huangs
For disassembler_elf_32_x86_unittest.cc: the number of (ELF) rel32 addresses found reduced because bogus ones disappeared. Abs32 ...
4 years, 7 months ago (2016-04-28 14:31:16 UTC) #5
Andrew Hayden (chromium.org)
On 2016/04/28 14:31:16, huangs wrote: > For disassembler_elf_32_x86_unittest.cc: the number of (ELF) rel32 addresses > ...
4 years, 7 months ago (2016-04-28 15:07:45 UTC) #6
Will Harris
https://codereview.chromium.org/1928683002/diff/1/courgette/disassembler_elf_32.cc File courgette/disassembler_elf_32.cc (right): https://codereview.chromium.org/1928683002/diff/1/courgette/disassembler_elf_32.cc#newcode552 courgette/disassembler_elf_32.cc:552: VLOG(1) << "Warning: Found no rel32 addresses. Missing .text ...
4 years, 7 months ago (2016-04-28 19:45:49 UTC) #7
huangs
https://codereview.chromium.org/1928683002/diff/1/courgette/disassembler_elf_32.cc File courgette/disassembler_elf_32.cc (right): https://codereview.chromium.org/1928683002/diff/1/courgette/disassembler_elf_32.cc#newcode552 courgette/disassembler_elf_32.cc:552: VLOG(1) << "Warning: Found no rel32 addresses. Missing .text ...
4 years, 7 months ago (2016-04-28 19:53:45 UTC) #8
Will Harris
lgtm https://codereview.chromium.org/1928683002/diff/1/courgette/disassembler_elf_32.cc File courgette/disassembler_elf_32.cc (right): https://codereview.chromium.org/1928683002/diff/1/courgette/disassembler_elf_32.cc#newcode552 courgette/disassembler_elf_32.cc:552: VLOG(1) << "Warning: Found no rel32 addresses. Missing ...
4 years, 7 months ago (2016-04-28 20:04:02 UTC) #9
huangs
Thanks! Committing soon.
4 years, 7 months ago (2016-04-28 20:05:13 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1928683002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1928683002/1
4 years, 7 months ago (2016-04-28 20:06:55 UTC) #12
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 7 months ago (2016-04-28 22:14:55 UTC) #14
commit-bot: I haz the power
4 years, 7 months ago (2016-04-30 17:22:01 UTC) #15
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/3da0dd9308f66ae1122bbaefda2c99a4f90372d4
Cr-Commit-Position: refs/heads/master@{#390506}

Powered by Google App Engine
This is Rietveld 408576698