tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

gmake crashes in _rtld_shared_enter when security.pax.aslr.enabled=1



This problem has been annoying me for quite some time but I looked at it
only today. I know that PIE is work in progress but since most things
work for me, I wonder if anyone sees the same problem.

I checked out -current today and built everything with MKPIE=yes on
amd64.

Then I built GNU make 3.82 with PIE options:

$ cd make-3.82
$ ./configure CFLAGS='-O -g -fPIE' CXXFLAGS='-O2 -fPIE' LDFLAGS=-pie
$ make


and tried to 'make clean' in luajit-2.0:

$ cd ../luajit-2.0
$ gdb $OLDPWD/make
(gdb) run clean

Sometimes it works but often it crashes when trying to read protected
anon page:

Program received signal SIGSEGV, Segmentation fault.
0x00007f7ff7c04439 in _rtld_shared_enter () from /usr/libexec/ld.elf_so
(gdb) disassemble
Dump of assembler code for function _rtld_shared_enter:
   0x00007f7ff7c04430 <+0>:     push   %rbp
   0x00007f7ff7c04431 <+1>:     push   %rbx
   0x00007f7ff7c04432 <+2>:     callq  0x7f7ff7c0c690 <membar_enter>
   0x00007f7ff7c04437 <+7>:     xor    %ebp,%ebp
=> 0x00007f7ff7c04439 <+9>:     mov    0x20d869(%rip),%ebx        # 0x7f7ff7e11ca8 <_rtld_mutex>
   0x00007f7ff7c0443f <+15>:    test   %ebx,%ebx
 
(gdb) x 0x20d869+0x00007f7ff7c0443f
0x7f7ff7e11ca8 <_rtld_mutex>:   0x00000000

(gdb) info thread
  Id   Target Id         Frame
* 1    process 27560     0x00007f7ff7c04439 in _rtld_shared_enter () from /usr/libexec/ld.elf_so


$ pmap 27560
000000016BA01000    184K read/exec         /home/alnsn/src/make-3.82/make
000000016BC2E000      8K read/write        /home/alnsn/src/make-3.82/make
000000016BC30000      8K read/write          [ anon ]
00007A00B6B00000     64K read/write          [ anon ]
00007A00B6B10000    960K read/write          [ anon ]
00007A00B6C00000    768K read/exec         /lib/libc.so.12.197
00007A00B6CC0000     64K read/exec         /lib/libc.so.12.197
00007A00B6CD0000    528K read/exec         /lib/libc.so.12.197
00007A00B6D54000   2048K                   /lib/libc.so.12.197
00007A00B6F54000     48K read/write        /lib/libc.so.12.197
00007A00B6F60000     76K read/write          [ anon ]
00007A00B7000000     48K read/exec         /lib/libgcc_s.so.1.0
00007A00B700C000   2044K                   /lib/libgcc_s.so.1.0
00007A00B720B000      4K read/write        /lib/libgcc_s.so.1.0
00007A00B7312000     40K read/write          [ anon ]
00007F7FF7C00000     68K read/exec         /libexec/ld.elf_so
00007F7FF7C11000    716K                     [ anon ]
00007F7FF7CC4000   1332K                     [ anon ]
00007F7FF7E11000      8K                     [ anon ]     <======= CRASH at offset 3240
00007F7FF8000000 123664K                     [ stack ]
00007F7FFF8C4000   4016K read/write          [ stack ]
00007F7FFFCB0000     80K read/write          [ stack ]
 total             6964K


(gdb) print 0x20d869+0x00007f7ff7c0443f-0x00007F7FF7E11000
$4 = 3240


Alex


Home | Main Index | Thread Index | Old Index