projects
/
project
/
procd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9211278
)
ujail: add ELF interpreter (DT_INTERP) to the jail
author
Etienne CHAMPETIER
<champetier.etienne@gmail.com>
Fri, 27 Nov 2015 16:27:16 +0000
(16:27 +0000)
committer
John Crispin
<blogic@openwrt.org>
Fri, 27 Nov 2015 16:50:24 +0000
(17:50 +0100)
this is needed by musl (openwrt DD)
uClibc/glibc is working without this
this partly fixes
https://dev.openwrt.org/ticket/20785
we still don't handle DT_RPATH, DT_RUNPATH, nodeflib, ...
see http://man7.org/linux/man-pages/man8/ld.so.8.html
Signed-off-by: Etienne CHAMPETIER <champetier.etienne@gmail.com>
jail/elf.c
patch
|
blob
|
history
diff --git
a/jail/elf.c
b/jail/elf.c
index 136789e1300dce1b924c13edd91931082d767bd0..b8f2cc549e8c33ce490d0a59bcef411e0263cd81 100644
(file)
--- a/
jail/elf.c
+++ b/
jail/elf.c
@@
-234,6
+234,7
@@
int elf_load_deps(const char *path, const char *map)
{
unsigned int dyn_offset, dyn_size;
unsigned int load_offset, load_vaddr;
+ unsigned int interp_offset;
if (elf_find_section(map, PT_LOAD, &load_offset, NULL, &load_vaddr)) {
ERROR("failed to load the .load section from %s\n", path);
@@
-245,6
+246,10
@@
int elf_load_deps(const char *path, const char *map)
return -1;
}
+ if (elf_find_section(map, PT_INTERP, &interp_offset, NULL, NULL) == 0) {
+ add_path_and_deps(map+interp_offset, 1, -1, 0);
+ }
+
int clazz = map[EI_CLASS];
if (clazz == ELFCLASS32)