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

Issue 8589027: Add a tool for patching ELF libraries/executables offline (Closed)

Created:
9 years, 1 month ago by Mark Seaborn
Modified:
9 years, 1 month ago
Reviewers:
Markus (顧孟勤)
CC:
chromium-reviews
Visibility:
Public.

Description

Add a tool for patching ELF libraries/executables offline This is for patching ELF objects for use with elf_loader.cc. It allows system call instructions to be patched before the library or executable is loaded. For simplicity, we replace system calls with "int $0", which is not very fast at run time. A more sophisticated version could insert jumps like library.cc does, but this would involve adding an extra code segment to the ELF object. BUG=http://code.google.com/p/seccompsandbox/issues/detail?id=13 TEST=For example: ./patch_offline /lib/ld-linux.so.2 -o ld.so.patched objdump -d ld.so.patched | grep -w int Automated tests will be added in a later change. Committed: http://code.google.com/p/seccompsandbox/source/detail?r=173

Patch Set 1 #

Patch Set 2 : Add to 'clean' target #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+142 lines, -1 line) Patch
M makefile View 1 3 chunks +6 lines, -1 line 0 comments Download
A patch_offline.cc View 1 chunk +136 lines, -0 lines 1 comment Download

Messages

Total messages: 2 (0 generated)
Mark Seaborn
9 years, 1 month ago (2011-11-17 17:39:14 UTC) #1
Markus (顧孟勤)
9 years, 1 month ago (2011-11-17 22:15:19 UTC) #2
lgtm

http://codereview.chromium.org/8589027/diff/2001/patch_offline.cc
File patch_offline.cc (right):

http://codereview.chromium.org/8589027/diff/2001/patch_offline.cc#newcode15
patch_offline.cc:15: // that they will work inside the sandbox.
I suspect, in the long run, you probably want a tool that can do this at
run-time. In that case, you also wouldn't be limited to inserting "int $0"
instructions.

But for now, this seems perfectly fine.

Powered by Google App Engine
This is Rietveld 408576698