Re: [PATCH] Support non-fPIC shared objects

2018-10-29 Thread Nadav Har'El
On Mon, Oct 29, 2018 at 2:28 PM Waldek Kozaczuk wrote: > > On Mon, Oct 29, 2018 at 07:23 Nadav Har'El wrote: > >> Hi. Looks good. Just one question about the test - why is >> misc-non-fpic.so a shared object that another >> test runs, instead of just being an indepedent test of its own, >>

Re: [PATCH] Support non-fPIC shared objects

2018-10-29 Thread Waldek Kozaczuk
On Mon, Oct 29, 2018 at 07:23 Nadav Har'El wrote: > Hi. Looks good. Just one question about the test - why is misc-non-fpic.so > a shared object that another > test runs, instead of just being an indepedent test of its own, > tst-non-fpic.so (that we compile a bit differently > from the other

Re: [PATCH] Support non-fPIC shared objects

2018-10-29 Thread Nadav Har'El
Hi. Looks good. Just one question about the test - why is misc-non-fpic.so a shared object that another test runs, instead of just being an indepedent test of its own, tst-non-fpic.so (that we compile a bit differently from the other tests)? On Thu, Oct 25, 2018 at 1:10 AM Waldemar Kozaczuk

[PATCH] Support non-fPIC shared objects

2018-10-29 Thread Waldek Kozaczuk
Nadav, Does this patch look OK to you to commit? Thanks, Waldek -- You received this message because you are subscribed to the Google Groups "OSv Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to osv-dev+unsubscr...@googlegroups.com. For

Re: [PATCH] Support non-fPIC shared objects

2018-10-28 Thread Waldek Kozaczuk
I know I am hijacking this patch email. But I am glad to report that I was able to run unmodified /bin/ls on OSv with this patch: diff --git a/linux.cc b/linux.cc index d1cd61b7..2bb47f8c 100644 --- a/linux.cc +++ b/linux.cc @@ -445,3 +445,8 @@ extern "C" long syscall_wrapper(long number, long

Re: [PATCH] Support non-fPIC shared objects

2018-10-28 Thread Nadav Har'El
On Sun, Oct 28, 2018 at 10:14 PM Waldek Kozaczuk wrote: > > BTW I have noticed that on my latest Ubuntu 18.10 distribution programs > like 'ls' and 'grep' seems to be pies as well. > > file hello > hello: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically > linked, interpreter

Re: [PATCH] Support non-fPIC shared objects

2018-10-28 Thread Waldek Kozaczuk
I wonder if that is relevant - https://wiki.ubuntu.com/SecurityTeam/PIE. In my case when I build native-example hello.c like so (notice absence of -fPIC and -pie): gcc hello.c -o hello I automatically get a pie: file hello hello: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV),

Re: [PATCH] Support non-fPIC shared objects

2018-10-28 Thread Waldek Kozaczuk
It is my understanding that this patch enhances OSv only as far as supporting programs using non-fPIC shared libraries. It in no way affects or changes how OSv handles loading and execution of executables themselves (ELF with symbol main). I guess you are referring to so called non-pie

Re: [PATCH] Support non-fPIC shared objects

2018-10-25 Thread Qixuan Wu
Good news, can we support NON-fPIC elf executable binary ? 在 2018年10月25日星期四 UTC+8上午6:10:09,Waldek Kozaczuk写道: > > This patch enhances ELF dynamic loader to support position > dependent shared libraries. It does it by detecting presence > of DT_TEXTREL marker and temporarilily making PT_LOAD

[PATCH] Support non-fPIC shared objects

2018-10-24 Thread Waldemar Kozaczuk
This patch enhances ELF dynamic loader to support position dependent shared libraries. It does it by detecting presence of DT_TEXTREL marker and temporarilily making PT_LOAD sections writable so that corresponding references in code get updated to point to correct addresses in memory. Eventually