On 03/22/2016 12:33 AM, Andrew Udvare wrote:
> On 21/03/16 02:27, Zac Medico wrote:
>> Yeah, I know. Anyway, I went ahead and packaged it. Please try it out
>> and file bugs if there's anything wrong:
>>
>> https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f2ebd6535d66e0ba011c1a1beeb33df570dcff8d
>>
> Works well, except on hardened I get this:
> 
> drive: error while loading shared libraries: cannot make segment
> writable for relocation: Permission denied
> 
> strace output:
> 
> execve("/usr/bin/drive", ["drive"], [/* 59 vars */]) = 0
> brk(0)                                  = 0x1b63e83750
> mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
> = 0x3d6f913c000
> access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or
> directory)
> open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
> fstat(3, {st_mode=S_IFREG|0644, st_size=82250, ...}) = 0
> mmap(NULL, 82250, PROT_READ, MAP_PRIVATE, 3, 0) = 0x3d6f911d000
> close(3)                                = 0
> open("/lib64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
> read(3,
> "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360`\0\0\0\0\0\0"...,
> 832) = 832
> fstat(3, {st_mode=S_IFREG|0755, st_size=133656, ...}) = 0
> mmap(NULL, 2212496, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
> 0) = 0x3d6f8cf5000
> mprotect(0x3d6f8d0d000, 2093056, PROT_NONE) = 0
> mmap(0x3d6f8f0c000, 8192, PROT_READ|PROT_WRITE,
> MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x3d6f8f0c000
> mmap(0x3d6f8f0e000, 12944, PROT_READ|PROT_WRITE,
> MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3d6f8f0e000
> close(3)                                = 0
> open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
> read(3,
> "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\v\2\0\0\0\0\0"...,
> 832) = 832
> fstat(3, {st_mode=S_IFREG|0755, st_size=1730032, ...}) = 0
> mmap(NULL, 3838936, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
> 0) = 0x3d6f8945000
> mprotect(0x3d6f8ae5000, 2093056, PROT_NONE) = 0
> mmap(0x3d6f8ce4000, 24576, PROT_READ|PROT_WRITE,
> MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x19f000) = 0x3d6f8ce4000
> mmap(0x3d6f8cea000, 17368, PROT_READ|PROT_WRITE,
> MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3d6f8cea000
> close(3)                                = 0
> mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
> = 0x3d6f913b000
> mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
> = 0x3d6f9135000
> arch_prctl(ARCH_SET_FS, 0x3d6f9135740)  = 0
> mprotect(0x3d6f8ce4000, 16384, PROT_READ) = 0
> mprotect(0x3d6f8f0c000, 4096, PROT_READ) = 0
> 
> mprotect(0x1b617f6000, 12369920, PROT_READ|PROT_WRITE) = -1 EACCES
> (Permission denied)
> 
> writev(2, [{"drive", 5}, {": ", 2}, {"error while loading shared
> libra"..., 36}, {": ", 2}, {"", 0}, {"", 0}, {"cannot make segment
> writable for"..., 43}, {": ", 2}, {"Permission denied", 17}, {"\n", 1}],
> 10drive: error while loading shared libraries: cannot make segment
> writable for relocation: Permission denied
> ) = 108
> exit_group(127)                         = ?
> +++ exited with 127 +++
> 

There's some information about this type of error here:

https://wiki.gentoo.org/wiki/Hardened/FAQ#I_keep_getting_the_message:_.22error_while_loading_shared_libraries:_cannot_make_segment_writable_for_relocation:_Permission_denied..22_What_does_this_mean.3F

Please file a bug, and we'll see about resolving it.
-- 
Thanks,
Zac

Reply via email to