{"action":"closed","issue":{"url":"https://api.github.com/repos/dyninst/dyninst/issues/93","repository_url":"https://api.github.com/repos/dyninst/dyninst","labels_url":"https://api.github.com/repos/dyninst/dyninst/issues/93/labels{/name}","comments_url":"https://api.github.com/repos/dyninst/dyninst/issues/93/comments","events_url":"https://api.github.com/repos/dyninst/dyninst/issues/93/events","html_url":"https://github.com/dyninst/dyninst/issues/93","id":160319466,"number":93,"title":"Rewritten libc.so is not usable","user":{"login":"cuviper","id":36186,"avatar_url":"https://avatars.githubusercontent.com/u/36186?v=3","gravatar_id":"","url":"https://api.github.com/users/cuviper","html_url":"https://github.com/cuviper","followers_url":"https://api.github.com/users/cuviper/followers","following_url":"https://api.github.com/users/cuviper/following{/other_user}","gists_url":"https://api.github.com/users/cuviper/gists{/gist_id}","starred_url":"https://api.github.com/users/cuviper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cuviper/subscriptions","organizations_url":"https://api.github.com/users/cuviper/orgs","repos_url":"https://api.github.com/users/cuviper/repos","events_url":"https://api.github.com/users/cuviper/events{/privacy}","received_events_url":"https://api.github.com/users/cuviper/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":39,"created_at":"2016-06-15T01:20:59Z","updated_at":"2016-06-28T21:11:07Z","closed_at":"2016-06-28T21:11:07Z","body":"On Fedora 23, I can \"run\" libc to get simple version info:\r\n\r\n```\r\n$ /lib64/libc-2.22.so\r\nGNU C Library (GNU libc) stable release version 2.22, by Roland McGrath et al.\r\nCopyright (C) 2015 Free Software Foundation, Inc.\r\nThis is free software; see the source for copying conditions.\r\nThere is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\r\nPARTICULAR PURPOSE.\r\nCompiled by GNU CC version 5.3.1 20151207 (Red Hat 5.3.1-2).\r\nAvailable extensions:\r\n        The C stubs add-on version 2.1.2.\r\n        crypt add-on version 2.1 by Michael Glad and others\r\n        GNU Libidn by Simon Josefsson\r\n        Native POSIX Threads Library by Ulrich Drepper et al\r\n        BIND-8.2.3-T5B\r\n        RT using linux kernel aio\r\nlibc ABIs: UNIQUE IFUNC\r\nFor bug reporting instructions, please see:\r\n<http://www.gnu.org/software/libc/bugs.html>.\r\n```\r\n\r\nIf I do a null rewrite, the result crashes:\r\n\r\n```\r\n$ parseThat --binary-edit=pt-libc.so -i0 /lib64/libc-2.22.so\r\nWrite File Path is pt-libc.so\r\n[ Processing /lib64/libc-2.22.so ] ============================================\r\nCreating new BPatch object.... done.\r\nRetrieving BPatch_image object.... done.\r\nParsing image for module information.... Found 1101 module(s).\r\nDyninst mutator exited normally and returned 0.\r\n[ Done processing /lib64/libc-2.22.so ] ---------------------------------------\r\nAnalysis complete.\r\n$ ./pt-libc.so\r\nSegmentation fault (core dumped)\r\n```\r\n\r\nIn GDB:\r\n\r\n```\r\nProgram received signal SIGSEGV, Segmentation fault.\r\n_dl_relocate_object (scope=0x7ffff7ffe4a0, reloc_mode=<optimized out>, consider_profiling=consider_profiling@entry=0)\r\n    at dl-reloc.c:232\r\n232         const char *strtab = (const void *) D_PTR (l, l_info[DT_STRTAB]);\r\n(gdb) bt\r\n#0  _dl_relocate_object (scope=0x7ffff7ffe4a0, reloc_mode=<optimized out>,\r\n    consider_profiling=consider_profiling@entry=0) at dl-reloc.c:232\r\n#1  0x00007ffff7ddfa33 in dl_main (phdr=<optimized out>, phnum=<optimized out>, user_entry=<optimized out>,\r\n    auxv=<optimized out>) at rtld.c:2066\r\n#2  0x00007ffff7df3c00 in _dl_sysdep_start (start_argptr=start_argptr@entry=0x7fffffffe1f0,\r\n    dl_main=dl_main@entry=0x7ffff7ddd990 <dl_main>) at ../elf/dl-sysdep.c:249\r\n#3  0x00007ffff7de0bd1 in _dl_start_final (arg=0x7fffffffe1f0) at rtld.c:305\r\n#4  _dl_start (arg=0x7fffffffe1f0) at rtld.c:411\r\n#5  0x00007ffff7ddcc88 in _start () from /lib64/ld-linux-x86-64.so.2\r\n#6  0x0000000000000001 in ?? ()\r\n#7  0x00007fffffffe4d1 in ?? ()\r\n#8  0x0000000000000000 in ?? ()\r\n```\r\n\r\nThere are a lot of errors from elfutils' `elflint`:\r\n\r\n```\r\n$ eu-elflint --gnu-ld /lib64/libc-2.22.so\r\nNo errors\r\n$ eu-elflint --gnu-ld pt-libc.so\r\nsection [35] '.dyninstInst' is both executable and writable\r\nsection [35] '.dyninstInst' is executable in nonexecutable segment 3\r\nsection [36] '.hash': hash bucket reference 1020 out of bounds\r\nsection [36] '.hash': hash bucket reference 1021 out of bounds\r\nsection [37] '.dynsym': symbol 1: local symbol outside range described in sh_info\r\nsection [37] '.dynsym': symbol 2: local symbol outside range described in sh_info\r\nsection [37] '.dynsym': symbol 300: st_value out of bounds of referenced section [23] '.tbss'\r\nsection [37] '.dynsym': symbol 1854: st_value out of bounds of referenced section [23] '.tbss'\r\nsection [37] '.dynsym': symbol 1896: st_value out of bounds of referenced section [22] '.tdata'\r\nsection [40] '.gnu.version_r': entry 1 has invalid offset to next entry\r\nmore than one version definition section present\r\nsection [41] '.gnu.version_d': no BASE definition\r\nsection [44] '.dynamic': entry 2: FINI value must point into loaded segment\r\nsection [81] '.symtab': symbol 34: st_value out of bounds\r\nsection [81] '.symtab': symbol 35: st_value out of bounds\r\nsection [81] '.symtab': symbol 36: st_value out of bounds\r\nsection [81] '.symtab': symbol 37: st_value out of bounds\r\nsection [81] '.symtab': symbol 38: st_value out of bounds\r\nsection [81] '.symtab': symbol 39: st_value out of bounds\r\nsection [81] '.symtab': symbol 40: st_value out of bounds\r\nsection [81] '.symtab': symbol 41: st_value out of bounds\r\nsection [81] '.symtab': symbol 42: st_value out of bounds\r\nsection [81] '.symtab': symbol 43: st_value out of bounds\r\nsection [81] '.symtab': symbol 44: st_value out of bounds\r\nsection [81] '.symtab': symbol 373: st_value out of bounds of referenced section [23] '.tbss'\r\nsection [81] '.symtab': symbol 374: st_value out of bounds of referenced section [23] '.tbss'\r\nsection [81] '.symtab': symbol 822: st_value out of bounds of referenced section [23] '.tbss'\r\nsection [81] '.symtab': symbol 974: st_value out of bounds of referenced section [23] '.tbss'\r\nsection [81] '.symtab': symbol 1940: st_value out of bounds of referenced section [23] '.tbss'\r\nsection [81] '.symtab': symbol 2599: st_value out of bounds of referenced section [23] '.tbss'\r\nsection [81] '.symtab': symbol 2975: st_value out of bounds of referenced section [23] '.tbss'\r\nsection [81] '.symtab': _DYNAMIC_ symbol value 0x3bbb80 does not match dynamic segment address 0x420459\r\nsection [81] '.symtab': symbol 3236: st_value out of bounds of referenced section [23] '.tbss'\r\nsection [81] '.symtab': symbol 3366: st_value out of bounds of referenced section [23] '.tbss'\r\nsection [81] '.symtab': symbol 3795: st_value out of bounds of referenced section [23] '.tbss'\r\nsection [81] '.symtab': symbol 4037: st_value out of bounds of referenced section [23] '.tbss'\r\nsection [81] '.symtab': symbol 4431: st_value out of bounds of referenced section [23] '.tbss'\r\nsection [81] '.symtab': symbol 4892: st_value out of bounds of referenced section [22] '.tdata'\r\nsection [81] '.symtab': symbol 4991: st_value out of bounds of referenced section [23] '.tbss'\r\nsection [81] '.symtab': symbol 6373: st_value out of bounds of referenced section [23] '.tbss'\r\nsection [81] '.symtab': symbol 6609: st_value out of bounds of referenced section [22] '.tdata'\r\nsection [81] '.symtab': symbol 7140: local symbol outside range described in sh_info\r\nsection [81] '.symtab': symbol 7141: st_value out of bounds\r\nsection [81] '.symtab': symbol 7142: st_value out of bounds\r\nsection [81] '.symtab': symbol 7142: local symbol outside range described in sh_info\r\nsection [39] '.gnu.version': symbol 621: invalid version index 25\r\nsection [39] '.gnu.version': symbol 1172: invalid version index 26\r\nsection [39] '.gnu.version': symbol 1192: invalid version index 26\r\nsection [39] '.gnu.version': symbol 1436: invalid version index 25\r\nduplicate version index 2\r\nduplicate version index 3\r\n```\r\n\r\nI'm sure some of this can be deemed harmless, but the \"out of bounds\" messages are troubling."}}
{"actor":{"display_login":"wrwilliams"}}