Opened 6 years ago

Closed 6 years ago

Last modified 4 years ago

#12192 closed defect (fixed)

TOR does not function on hardened linux kernel with PaX

Reported by: cypherpunks Owned by:
Priority: Medium Milestone:
Component: Core Tor/Tor Version: Tor: 0.2.4.22
Severity: Keywords: grsec, pax, hardened, linux, mprotect
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

The latest version of TOR is suffering from an RWX mprotect issue which grsec is blocking for security reasons.

[user@localhost]$ tor
tor: error while loading shared libraries: cannot make segment writable for relocation: Permission denied

dmesg:
[ 1392.928420] grsec: denied RWX mprotect of /usr/bin/tor by /usr/bin/tor[tor:1003] uid/euid:1000/1000 gid/egid:100/100, parent /usr/bin/bash[bash:1001] uid/euid:1000/1000 gid/egid:100/100


strace:
1157 brk(0) = 0xcc9ffc5d390
1157 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
1157 open("/home/user/GNUstep/Library/Libraries/tls/x86_64/libz.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
1157 stat("/home/user/GNUstep/Library/Libraries/tls/x86_64", 0x707c3ec3a3a0) = -1 ENOENT (No such file or directory)
1157 open("/home/user/GNUstep/Library/Libraries/tls/libz.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
1157 stat("/home/user/GNUstep/Library/Libraries/tls", 0x707c3ec3a3a0) = -1 ENOENT (No such file or directory)
1157 open("/home/user/GNUstep/Library/Libraries/x86_64/libz.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
1157 stat("/home/user/GNUstep/Library/Libraries/x86_64", 0x707c3ec3a3a0) = -1 ENOENT (No such file or directory)
1157 open("/home/user/GNUstep/Library/Libraries/libz.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
1157 stat("/home/user/GNUstep/Library/Libraries", 0x707c3ec3a3a0) = -1 ENOENT (No such file or directory)
1157 open("/usr/lib/tls/x86_64/libz.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
1157 stat("/usr/lib/tls/x86_64", 0x707c3ec3a3a0) = -1 ENOENT (No such file or directory)
1157 open("/usr/lib/tls/libz.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
1157 stat("/usr/lib/tls", 0x707c3ec3a3a0) = -1 ENOENT (No such file or directory)
1157 open("/usr/lib/x86_64/libz.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
1157 stat("/usr/lib/x86_64", 0x707c3ec3a3a0) = -1 ENOENT (No such file or directory)
1157 open("/usr/lib/libz.so.1", O_RDONLY|O_CLOEXEC) = 3
1157 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000#\0\0\0\0\0\0@\0\0\0\0\0\0\0\20S\1\0\0\0\0\0\0\0\0\0@\0008\0\7\0@\0\34\0\33\0\1\0\0\0\5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<G\1\0\0\0\0\0<G\1\0\0\0\0\0\0\0 \0\0\0\0\0\1\0\0\0\6\0\0\0\260L\1\0\0\0\0\0\260L!\0\0\0\0\0\260L!\0\0\0\0\0P\5\0\0\0\0\0\0X\5\0\0\0\0\0\0\0\0 \0\0\0\0\0\2\0\0\0\6\0\0\0\320M\1\0\0\0\0\0\320M!\0\0\0\0\0\320M!\0\0\0\0\0\360\1\0\0\0\0\0\0\360\1\0\0\0\0\0\0\10\0\0\0\0\0\0\0\4\0\0\0\4\0\0\0\310\1\0\0\0\0\0\0\310\1\0\0\0\0\0\0\310\1\0\0\0\0\0\0$\0\0\0\0\0\0\0$\0\0\0\0\0\0\0\4\0\0\0\0\0\0\0P\345td\4\0\0\0\210+\1\0\0\0\0\0\210+\1\0\0\0\0\0\210+\1\0\0\0\0\0\264\3\0\0\0\0\0\0\264\3\0\0\0\0\0\0\4\0\0\0\0\0\0\0Q\345td\6\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\10\0\0\0\0\0\0\0R\345td\4\0\0\0\260L\1\0\0\0\0\0\260L!\0\0\0\0\0\260L!\0\0\0\0\0P\3\0\0\0\0\0\0P\3\0\0\0\0\0\0\1\0\0\0\0\0\0\0\4\0\0\0\24\0\0\0\3\0\0\0GNU\0r\22\244\307\251\227G\251
\356\216\244g_\266\"\27\357F&\0\0\0\0\247\0\0\0\27\0\0\0\10\0\0\0\t\0\0\0\0\3h\24\f\3$\24\221\0\223A;\0\16\30\234\1\4DQ\f\0\210,\0\303\"\224\27\212\203\0c0\262G\212PC ,\20\35\210\341\200\213A\220\23e$g\304\201V\0.\20\2\200\0\20\0\0\0\0\27\0\0\0\0\0\0\0\31\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\32\0\0\0\33\0\0\0\0\0\0\0\0\0\0\0\34\0\0\0\35\0\0\0\37\0\0\0\0\0\0\0\0\0\0\0 \0\0\0!\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0#\0\0\0\0\0\0\0\0\0\0\0$\0\0\0\0\0\0\0%\0\0\0&\0\0\0'\0\0\0\0\0\0\0)\0\0\0*\0\0\0,\0\0\0.\0\0\0\0\0\0\0\0\0\0\0/\0\0\0000\0\0\0001\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0002\0\0\0003\0\0\0\0\0\0\0004\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0005\0\0\0\0\0\0\0\0\0\0\0006\0\0\0\0\0\0\0007\0\0\0008\0\0\0\0\0\0\0", 832) = 832
1157 fstat(3, {st_dev=makedev(8, 3), st_ino=135701, st_mode=S_IFREG|0755, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=176, st_size=88592, st_atime=2014/06/02-22:17:38, st_mtime=2013/10/21-04:39:42, st_ctime=2013/10/27-12:37:30}) = 0
1157 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x66443bcdd000
1157 mmap(NULL, 2183688, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x66443b8aa000
1157 mprotect(0x66443b8bf000, 2093056, PROT_NONE) = 0
1157 mmap(0x66443babe000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14000) = 0x66443babe000
1157 close(3) = 0
1157 open("/usr/lib/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
1157 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200U\0\0\0\0\0\0@\0\0\0\0\0\0\0@2\20\0\0\0\0\0\0\0\0\0@\0008\0\t\0@\0\36\0\35\0\6\0\0\0\5\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0\370\1\0\0\0\0\0\0\370\1\0\0\0\0\0\0\10\0\0\0\0\0\0\0\3\0\0\0\4\0\0\0P\227\17\0\0\0\0\0P\227\17\0\0\0\0\0P\227\17\0\0\0\0\0\36\0\0\0\0\0\0\0\36\0\0\0\0\0\0\0\20\0\0\0\0\0\0\0\1\0\0\0\5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\224*\20\0\0\0\0\0\224*\20\0\0\0\0\0\0\0 \0\0\0\0\0\1\0\0\0\6\0\0\0\220-\20\0\0\0\0\0\220-0\0\0\0\0\0\220-0\0\0\0\0\0|\3\0\0\0\0\0\0\310\3\0\0\0\0\0\0\0\0 \0\0\0\0\0\2\0\0\0\6\0\0\0\250-\20\0\0\0\0\0\250-0\0\0\0\0\0\250-0\0\0\0\0\0\20\2\0\0\0\0\0\0\20\2\0\0\0\0\0\0\10\0\0\0\0\0\0\0\4\0\0\0\4\0\0\0008\2\0\0\0\0\0\0008\2\0\0\0\0\0\0008\2\0\0\0\0\0\0D\0\0\0\0\0\0\0D\0\0\0\0\0\0\0\4\0\0\0\0\0\0\0P\345td\4\0\0\0p\227\17\0\0\0\0\0p\227\17\0\0\0\0\0p\227\17\0\0\0\0\0\374\22\0\0\0\0\0\0\374\22\0\0\0\0\0\0\4\0\0\0\0\0\0\0Q\345td\6\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20\0\0\0\0\0\0\0R\345td\4\0\0\0\220-\20\0\0\0\0\0\220-0\0\0\0\0\0\220-0\0\0\0\0\0p\2\0\0\0\0\0\0p\2\0\0\0\0\0\0\1\0\0\0\0\0\0\0\4\0\0\0\24\0\0\0\3\0\0\0GNU\0\272\371\360@.\300}\311\243\260\355\27\271\374=\n1\233\264\251\4\0\0\0\20\0\0\0\1\0\0\0GNU\0\0\0\0\0\2\0\0\0\6\0\0\0 \0\0\0\0\0\0\0\35\3\0\0\24\0\0\0@\0\0\0\f\0\0\0%\0\0\0\240.\"\200\0\26\211\0 E\"\2\0\300`i\10\212\0\t\0\0\0\0\0\0\0\0\0\0\0\0\212P\20\1\10\0\0\4\1\302\24\1 \210\"\0\304\243X\240\n\6\216\0\212\0\0\4\0@\0\0 \20\0\5\0\5\r\7\7\22A\0\1\0\10\0\0@\0\t\0\20\4D\30\4\200a(\22@\4\1\nE\221 @\200\f\22\1\0\0\0\0\0\0\0\0\4\2\0\0\0@\0\200\2\20\322\0\1\10\4\301 E\1\0\310\"\0\4\2\0\202\0\4\0\0\0\4\0Y\4\2\0\n\200\1\0\0\4\0\20 \3\0\0\210 \10\20\0\0", 832) = 832
1157 fstat(3, {st_dev=makedev(8, 3), st_ino=136763, st_mode=S_IFREG|0755, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=2080, st_size=1063360, st_atime=2014/06/02-21:25:52, st_mtime=2014/05/16-04:15:29, st_ctime=2014/05/24-20:19:08}) = 0
1157 mmap(NULL, 3158360, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x66443b5a6000
1157 mprotect(0x66443b6a9000, 2093056, PROT_NONE) = 0
1157 mmap(0x66443b8a8000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x102000) = 0x66443b8a8000
1157 close(3) = 0
1157 open("/usr/lib/libevent-2.0.so.5", O_RDONLY|O_CLOEXEC) = 3
1157 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\320\0\0\0\0\0\0@\0\0\0\0\0\0\0000n\4\0\0\0\0\0\0\0\0\0@\0008\0\7\0@\0\33\0\32\0\1\0\0\0\5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0TP\4\0\0\0\0\0TP\4\0\0\0\0\0\0\0 \0\0\0\0\0\1\0\0\0\6\0\0\0\230Z\4\0\0\0\0\0\230Z$\0\0\0\0\0\230Z$\0\0\0\0\0\230\22\0\0\0\0\0\0\220\31\0\0\0\0\0\0\0\0 \0\0\0\0\0\2\0\0\0\6\0\0\0\240]\4\0\0\0\0\0\240]$\0\0\0\0\0\240]$\0\0\0\0\0\340\1\0\0\0\0\0\0\340\1\0\0\0\0\0\0\10\0\0\0\0\0\0\0\4\0\0\0\4\0\0\0\310\1\0\0\0\0\0\0\310\1\0\0\0\0\0\0\310\1\0\0\0\0\0\0$\0\0\0\0\0\0\0$\0\0\0\0\0\0\0\4\0\0\0\0\0\0\0P\345td\4\0\0\0\254\254\3\0\0\0\0\0\254\254\3\0\0\0\0\0\254\254\3\0\0\0\0\0\f\27\0\0\0\0\0\0\f\27\0\0\0\0\0\0\4\0\0\0\0\0\0\0Q\345td\6\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\10\0\0\0\0\0\0\0R\345td\4\0\0\0\230Z\4\0\0\0\0\0\230Z$\0\0\0\0\0\230Z$\0\0\0\0\0h\5\0\0\0\0\0\0h\5\0\0\0\0\0\0\1\0\0\0\0\0\0\0\4\0\0\0\24\0\0\0\3\0\0\0GNU\0\226u\327\347\265Y\250/\345B\356\211\316\340\t8\3\n\226\235\0\0\0\0\372\3\0\0]\0\0\0@\0\0\0\f\0\0\0 \203\0B\1\200,p\201\210I\200\0\20\0\0\202\4d\4\1\24\201\304\4\3\3Tm\0\5\222\21\24\306\30(\200:(@\3@\340\0\0\0Jl\10\314\25\300\212\250@\240\3 \1\24*\10\270\3\1\"\10\10\4\0 Q\264A\36T\264\0#\200\10\0\2\2\0\5\10\236\t\246\0\5\214\22\5\t\2\31\31\n\5\200\0 \0\4\1\20(\5\4\0\0\200\0\4@\20\30\3\307\324\320\16\225p AC@\10\n\10(\310\350]\0\4p\4\1X\300$\n\300\10\2\322R\226bA\20\2\224\4\300)\205\201@\10\"\0\4\f4S\265v\n\243\1\4\0\22\311\200\0\320\200\200\202Q\0@L\220\16\200@ \0\20\0D\"\0p\0m0\32\4R\240 \0\2\320L-\t\0\310D)!(\0\4\0\1\1 \300@\0\220@e\2\0000\"\10\230Q\f\200\200\232\20$\0\20\2\200\244\0004\0\4\20\0d U\7\26\1\200\0\2\224\320\1\21H\0\2\21\10\1\10D\311R\4F0\34a\f5\312\200\r.\240\1@\30\0\20\210\3450\rE\0\21R\3s\210@\f\0\1\5\5\10\202\"", 832) = 832
1157 fstat(3, {st_dev=makedev(8, 3), st_ino=142850, st_mode=S_IFREG|0755, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=576, st_size=292080, st_atime=2014/06/03-12:42:45, st_mtime=2013/10/24-00:48:28, st_ctime=2013/10/27-12:38:54}) = 0
1157 mmap(NULL, 2389032, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x66443b35e000
1157 mprotect(0x66443b3a4000, 2093056, PROT_NONE) = 0
1157 mmap(0x66443b5a3000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x45000) = 0x66443b5a3000
1157 mmap(0x66443b5a5000, 1064, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x66443b5a5000
1157 close(3) = 0
1157 open("/usr/lib/libssl.so.1.0.0", O_RDONLY|O_CLOEXEC) = 3
1157 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240y\1\0\0\0\0\0@\0\0\0\0\0\0\0X\301\6\0\0\0\0\0\0\0\0\0@\0008\0\7\0@\0\35\0\32\0\1\0\0\0\5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\314\"\6\0\0\0\0\0\314\"\6\0\0\0\0\0\0\0 \0\0\0\0\0\1\0\0\0\6\0\0\0\310,\6\0\0\0\0\0\310,&\0\0\0\0\0\310,&\0\0\0\0\0h\223\0\0\0\0\0\0h\224\0\0\0\0\0\0\0\0 \0\0\0\0\0\2\0\0\0\6\0\0\0\210]\6\0\0\0\0\0\210]&\0\0\0\0\0\210]&\0\0\0\0\0\360\1\0\0\0\0\0\0\360\1\0\0\0\0\0\0\10\0\0\0\0\0\0\0\4\0\0\0\4\0\0\0\310\1\0\0\0\0\0\0\310\1\0\0\0\0\0\0\310\1\0\0\0\0\0\0$\0\0\0\0\0\0\0$\0\0\0\0\0\0\0\4\0\0\0\0\0\0\0P\345td\4\0\0\0\0\241\5\0\0\0\0\0\0\241\5\0\0\0\0\0\0\241\5\0\0\0\0\0\344\22\0\0\0\0\0\0\344\22\0\0\0\0\0\0\4\0\0\0\0\0\0\0Q\345td\6\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20\0\0\0\0\0\0\0R\345td\4\0\0\0\310,\6\0\0\0\0\0\310,&\0\0\0\0\0\310,&\0\0\0\0\00083\0\0\0\0\0\00083\0\0\0\0\0\0\1\0\0\0\0\0\0\0\4\0\0\0\24\0\0\0\3\0\0\0GNU\0\246B\237F\375\200\360r\"j\304\362\34CL\16x7\304\0\0\0\0\353\3\0\0q\1\0\0@\0\0\0\f\0\0\0\0\30\211i\24H\25\23E\21\10 \2\2\0B.5L\0\v\n\4\10\216\250H\1\0<\20B\0(\0\4\0\0\0\10\0\0\n\0\0\6\33\0\6\10\3\340\304\1\"l\224\210\0\35O\2!\0\30Y\t\20@\6\301\10\5\210\4\0\0@\2\210,A\0\242 \22\0Y\0\10\321\0\5p\20\200\2\21\r@\23@\0\10\10:\1\211\200\226\204\0\200D\0028NB\10\10\260,\215\0 \304\2\"\210\200\202\0\1\0\304Aq\220\200\222 \2 \200\4\1P\24P\0\30\"\"\0*@bA\341\10\10\2 \1F\242\301D\32\2\25\1@\244\n\1G \3\0010\"FF\2\0B\0\5 @@\240\34\20\2@\2\202\214\31a B!\2060 A\37v\204A@\1\326\203B\230\26\3\3\0H@0\210\266\0\4 \10\200@\4\222C\200\330\200\nB,\0,\t\20\10H\"l\10 B\24\346\0\t\21 r\20\2\n \4\4\2112\24\4\1 $\204\0\4\360\250p1\212\f\4\35\3\0\4\7\0@\0\1Cp\1\2\0\20\300 \10 \2H\0\21\0250\0\212\246\30\311\211\3", 832) = 832
1157 fstat(3, {st_dev=makedev(8, 3), st_ino=138401, st_mode=S_IFREG|0555, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=968, st_size=492396, st_atime=2014/06/02-22:17:38, st_mtime=2014/04/07-16:27:39, st_ctime=2014/04/09-23:26:41}) = 0
1157 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x66443bcdc000
1157 mmap(NULL, 2539824, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x66443b0f1000
1157 mprotect(0x66443b154000, 2093056, PROT_NONE) = 0
1157 mmap(0x66443b353000, 45056, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x62000) = 0x66443b353000
1157 close(3) = 0
1157 open("/usr/lib/libcrypto.so.1.0.0", O_RDONLY|O_CLOEXEC) = 3
1157 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0-\6\0\0\0\0\0@\0\0\0\0\0\0\0\350\37 \0\0\0\0\0\0\0\0\0@\0008\0\7\0@\0\35\0\32\0\1\0\0\0\5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0,\312\35\0\0\0\0\0,\312\35\0\0\0\0\0\0\0 \0\0\0\0\0\1\0\0\0\6\0\0\0\270\317\35\0\0\0\0\0\270\317=\0\0\0\0\0\270\317=\0\0\0\0\0\tO\2\0\0\0\0\0\215\2\0\0\0\0\0\0\0 \0\0\0\0\0\2\0\0\0\6\0\0\0\260m\37\0\0\0\0\0\260m?\0\0\0\0\0\260m?\0\0\0\0\0\0\2\0\0\0\0\0\0\0\2\0\0\0\0\0\0\10\0\0\0\0\0\0\0\4\0\0\0\4\0\0\0\310\1\0\0\0\0\0\0\310\1\0\0\0\0\0\0\310\1\0\0\0\0\0\0$\0\0\0\0\0\0\0$\0\0\0\0\0\0\0\4\0\0\0\0\0\0\0P\345td\4\0\0\0\250 \32\0\0\0\0\0\250 \32\0\0\0\0\0\250 \32\0\0\0\0\0<\217\0\0\0\0\0\0<\217\0\0\0\0\0\0\4\0\0\0\0\0\0\0Q\345td\6\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20\0\0\0\0\0\0\0R\345td\4\0\0\0\270\317\35\0\0\0\0\0\270\317=\0\0\0\0\0\270\317=\0\0\0\0\0H\240\1\0\0\0\0\0H\240\1\0\0\0\0\0\1\0\0\0\0\0\0\0\4\0\0\0\24\0\0\0\3\0\0\0GNU\0\37\335\354\267\233\265\350L2\312\24\276\rw\35\27\16\21\350\1\0\0\0\0\371\3\0\0t\0\0\0\0\2\0\0\17\0\0\0\1\0\30\205D\4\201\200a\200\2\0%L\4\200\201\0\0\10\30\206\4\200\10\2!\300\220\0@\0\201\204\3\21\204\244\0F\10\fH\0\3\200\24\201\0\212\4\t\3\311\204\10\2l\30\200\2\0051\10H\1\204\10\0 \0\254\24t\201\23(T\4\0\22BE\t@\340\20\f\224\34\0\0Q\0\300 \1\0H(\f\300C\10D\211\2\0\34\0\0@\2 \210\21Q,\224\205\200\0@\fh\"\16\0\0@\0\24@\0\0\0\6\220\16\0\0(\5\7\0f\0b\264\2\2\4\200\220@\0T2\10\0\0\0\0\340\0\0\1\3\t\f\202\24#\10\v\10\0A\200\2 \4\202;\4@\27\5\2\17@\242`\v\0245\201\2E\306\2\0\210\21\0\0'\200\0\202!\f\204\0\2\0010\341\10\10\0\240 \273\0\2250\201\204\20\0a\10B\10\34\10\240\21\r\0@\4 \"\4\4\0@\204\261\201\f\200\300\31\24p4\200\2\0\6Ta\0\220D!\2\244\200@A\20@i@\n\240\240\223\0\23$\354\2D&\270\10\20\0C\1\0H$\0\0C\4\2B\254\21@\4 \"@\2\16 \0\0\5\221Q", 832) = 832
1157 fstat(3, {st_dev=makedev(8, 3), st_ino=138402, st_mode=S_IFREG|0555, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=4648, st_size=2378773, st_atime=2014/06/02-22:17:38, st_mtime=2014/04/07-16:27:39, st_ctime=2014/04/09-23:26:41}) = 0
1157 mmap(NULL, 4218136, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x66443aceb000
1157 mprotect(0x66443aec8000, 2093056, PROT_NONE) = 0
1157 mmap(0x66443b0c7000, 155648, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1dc000) = 0x66443b0c7000
1157 mmap(0x66443b0ed000, 15640, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x66443b0ed000
1157 close(3) = 0
1157 open("/usr/lib/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
1157 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000\0\0\0\0\0\0@\0\0\0\0\0\0\0h\225\1\0\0\0\0\0\0\0\0\0@\0008\0\t\0@\0%\0\"\0\6\0\0\0\5\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0\370\1\0\0\0\0\0\0\370\1\0\0\0\0\0\0\10\0\0\0\0\0\0\0\3\0\0\0\4\0\0\0\0%\1\0\0\0\0\0\0%\1\0\0\0\0\0\0%\1\0\0\0\0\0\36\0\0\0\0\0\0\0\36\0\0\0\0\0\0\0\20\0\0\0\0\0\0\0\1\0\0\0\5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\244\177\1\0\0\0\0\0\244\177\1\0\0\0\0\0\0\0 \0\0\0\0\0\1\0\0\0\6\0\0\0\213\1\0\0\0\0\0\213!\0\0\0\0\0\213!\0\0\0\0\0\7\0\0\0\0\0\0000I\0\0\0\0\0\0\0\0 \0\0\0\0\0\2\0\0\0\6\0\0\0000\215\1\0\0\0\0\0000\215!\0\0\0\0\0000\215!\0\0\0\0\0000\2\0\0\0\0\0\0000\2\0\0\0\0\0\0\10\0\0\0\0\0\0\0\4\0\0\0\4\0\0\0008\2\0\0\0\0\0\0008\2\0\0\0\0\0\0008\2\0\0\0\0\0\0D\0\0\0\0\0\0\0D\0\0\0\0\0\0\0\4\0\0\0\0\0\0\0P\345td\4\0\0\0 %\1\0\0\0\0\0 %\1\0\0\0\0\0 %\1\0\0\0\0\0,\v\0\0\0\0\0\0,\v\0\0\0\0\0\0\4\0\0\0\0\0\0\0Q\345td\6\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20\0\0\0\0\0\0\0R\345td\4\0\0\0\213\1\0\0\0\0\0\213!\0\0\0\0\0\213!\0\0\0\0\0\240\4\0\0\0\0\0\0\240\4\0\0\0\0\0\0\1\0\0\0\0\0\0\0\4\0\0\0\24\0\0\0\3\0\0\0GNU\0000\357\306+hc4\325\3\21\334\313\303\206=\3238&\306\250\4\0\0\0\20\0\0\0\1\0\0\0GNU\0\0\0\0\0\2\0\0\0\6\0\0\0 \0\0\0\0\0\0\0\345\1\0\0V\0\0\0 \0\0\0\v\0\0\0\31#\2\261\1\10\20\2@@a\370\3\10\10\25\200 \0\0\0\0\200\300\321Q\0\0\0\22\353\3020D\0\10\20A\0\2\0\2\f\1\200\v\221\1\330\240\r\240@\230 \244\200\21\n\202-l@g\214V\24\0\224 \200$H\200P(\1\22\f\311B\240\220\22\10\f \2ZdA\245c\4@\n\n\n\0\2009\1(\314@\204\201@\22\10(\fD\0\0\0\200Q\10\200\35\4B\320\2608A\0\1\0\0\265\0300\0\200`\2\20\"\0\tA\20\1\5\0P(\251\22G(\0\0\202\4\230@\4\0\20\340T\0\2@\2\2\20\3010D\26\200\0", 832) = 832
1157 fstat(3, {st_dev=makedev(8, 3), st_ino=137645, st_mode=S_IFREG|0755, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=296, st_size=149301, st_atime=2014/06/02-20:23:46, st_mtime=2014/05/16-04:15:20, st_ctime=2014/05/24-20:19:08}) = 0
1157 mmap(NULL, 2217104, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x66443aacd000
1157 mprotect(0x66443aae5000, 2097152, PROT_NONE) = 0
1157 mmap(0x66443ace5000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18000) = 0x66443ace5000
1157 mmap(0x66443ace7000, 13456, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x66443ace7000
1157 close(3) = 0
1157 open("/usr/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
1157 read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\1\2\0\0\0\0\0@\0\0\0\0\0\0\0\230\246\32\0\0\0\0\0\0\0\0\0@\0008\0\n\0@\0F\0C\0\6\0\0\0\5\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0000\2\0\0\0\0\0\0000\2\0\0\0\0\0\0\10\0\0\0\0\0\0\0\3\0\0\0\4\0\0\0\200\6\27\0\0\0\0\0\200\6\27\0\0\0\0\0\200\6\27\0\0\0\0\0\36\0\0\0\0\0\0\0\36\0\0\0\0\0\0\0\20\0\0\0\0\0\0\0\1\0\0\0\5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0l?\32\0\0\0\0\0l?\32\0\0\0\0\0\0\0 \0\0\0\0\0\1\0\0\0\6\0\0\0hE\32\0\0\0\0\0hE:\0\0\0\0\0hE:\0\0\0\0\0XS\0\0\0\0\0\0\250\231\0\0\0\0\0\0\0\0 \0\0\0\0\0\2\0\0\0\6\0\0\0{\32\0\0\0\0\0{:\0\0\0\0\0{:\0\0\0\0\0\360\1\0\0\0\0\0\0\360\1\0\0\0\0\0\0\10\0\0\0\0\0\0\0\4\0\0\0\4\0\0\0p\2\0\0\0\0\0\0p\2\0\0\0\0\0\0p\2\0\0\0\0\0\0D\0\0\0\0\0\0\0D\0\0\0\0\0\0\0\4\0\0\0\0\0\0\0\7\0\0\0\4\0\0\0hE\32\0\0\0\0\0hE:\0\0\0\0\0hE:\0\0\0\0\0\20\0\0\0\0\0\0\0\200\0\0\0\0\0\0\0\10\0\0\0\0\0\0\0P\345td\4\0\0\0\240\6\27\0\0\0\0\0\240\6\27\0\0\0\0\0\240\6\27\0\0\0\0\0004j\0\0\0\0\0\0004j\0\0\0\0\0\0\4\0\0\0\0\0\0\0Q\345td\6\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20\0\0\0\0\0\0\0R\345td\4\0\0\0hE\32\0\0\0\0\0hE:\0\0\0\0\0hE:\0\0\0\0\0\230:\0\0\0\0\0\0\230:\0\0\0\0\0\0\1\0\0\0\0\0\0\0\4\0\0\0\24\0\0\0\3\0\0\0GNU\0\35\262)\34\4\5yc\17U\0335h\320\274\207X\252%\327\4\0\0\0\20\0\0\0\1\0\0\0GNU\0\0\0\0\0\2\0\0\0\6\0\0\0 \0\0\0\0\0\0\0\363\3\0\0\n\0\0\0\0\1\0\0\16\0\0\0\0000\20D\240 \2\1\210\3\346\220\305E\214\0\300\0\10\0\5\200\0\300\200\0\r\212\f\0\4\20\0\210D2\10.@\210P4, \16\"H&\204\300\214\4\10\0\2\2\16\241\254\32\4f\300\0\3002\0\300\0P\1 \201\10\204\v ($\0\4 P\0\20X\200\312DB(\0\6\200\20\30B\0 @\200\0\tP\0Q\212@\20\0\0\0\0\10\0\0\21\20", 832) = 832
1157 fstat(3, {st_dev=makedev(8, 3), st_ino=137622, st_mode=S_IFREG|0755, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=4000, st_size=2047384, st_atime=2014/06/02-20:23:46, st_mtime=2014/05/16-04:15:28, st_ctime=2014/05/24-20:19:08}) = 0
1157 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x66443bcdb000
1157 mmap(NULL, 3858192, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x66443a71f000
1157 mprotect(0x66443a8c3000, 2097152, PROT_NONE) = 0
1157 mmap(0x66443aac3000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1a4000) = 0x66443aac3000
1157 mmap(0x66443aac9000, 16144, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x66443aac9000
1157 close(3) = 0
1157 open("/usr/lib/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
1157 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320\16\0\0\0\0\0\0@\0\0\0\0\0\0\0\3201\0\0\0\0\0\0\0\0\0\0@\0008\0\t\0@\0\36\0\35\0\6\0\0\0\5\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0\370\1\0\0\0\0\0\0\370\1\0\0\0\0\0\0\10\0\0\0\0\0\0\0\3\0\0\0\4\0\0\0\220\32\0\0\0\0\0\0\220\32\0\0\0\0\0\0\220\32\0\0\0\0\0\0\36\0\0\0\0\0\0\0\36\0\0\0\0\0\0\0\20\0\0\0\0\0\0\0\1\0\0\0\5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0h \0\0\0\0\0\0h \0\0\0\0\0\0\0\0 \0\0\0\0\0\1\0\0\0\6\0\0\0-\0\0\0\0\0\0- \0\0\0\0\0- \0\0\0\0\0@\3\0\0\0\0\0\0\260\3\0\0\0\0\0\0\0\0 \0\0\0\0\0\2\0\0\0\6\0\0\0\210-\0\0\0\0\0\0\210- \0\0\0\0\0\210- \0\0\0\0\0\20\2\0\0\0\0\0\0\20\2\0\0\0\0\0\0\10\0\0\0\0\0\0\0\4\0\0\0\4\0\0\0008\2\0\0\0\0\0\0008\2\0\0\0\0\0\0008\2\0\0\0\0\0\0D\0\0\0\0\0\0\0D\0\0\0\0\0\0\0\4\0\0\0\0\0\0\0P\345td\4\0\0\0\260\32\0\0\0\0\0\0\260\32\0\0\0\0\0\0\260\32\0\0\0\0\0\0\274\0\0\0\0\0\0\0\274\0\0\0\0\0\0\0\4\0\0\0\0\0\0\0Q\345td\6\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20\0\0\0\0\0\0\0R\345td\4\0\0\0-\0\0\0\0\0\0- \0\0\0\0\0- \0\0\0\0\0\240\2\0\0\0\0\0\0\240\2\0\0\0\0\0\0\1\0\0\0\0\0\0\0\4\0\0\0\24\0\0\0\3\0\0\0GNU\0!7\275\r\227\247\270\313\20\30y]\f\363\203\375x\376\305\"\4\0\0\0\20\0\0\0\1\0\0\0GNU\0\0\0\0\0\2\0\0\0\6\0\0\0 \0\0\0\0\0\0\0\33\0\0\0\33\0\0\0\2\0\0\0\7\0\0\0\230\2\21\0\200H\0\4\22\0\0@\203(\10\236\33\0\0\0\0\0\0\0\34\0\0\0\0\0\0\0\0\0\0\0\35\0\0\0\0\0\0\0\36\0\0\0\0\0\0\0\37\0\0\0\0\0\0\0 \0\0\0\0\0\0\0!\0\0\0#\0\0\0$\0\0\0&\0\0\0'\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0(\0\0\0\0\0\0\0\0\0\0\0\353\26\251\30a\257\0\371\301S\200\30\273\25sB\257\304M\17\221!\374\370\6\2\4\371\3733\373\17\371\31sB\372\31sB\225\263_\31\177\236\320\30a\242\222\6", 832) = 832
1157 fstat(3, {st_dev=makedev(8, 3), st_ino=137336, st_mode=S_IFREG|0755, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=32, st_size=14672, st_atime=2014/06/02-21:01:01, st_mtime=2014/05/16-04:15:29, st_ctime=2014/05/24-20:19:08}) = 0
1157 mmap(NULL, 2109712, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x66443a51b000
1157 mprotect(0x66443a51e000, 2093056, PROT_NONE) = 0
1157 mmap(0x66443a71d000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x66443a71d000
1157 close(3) = 0
1157 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x66443bcda000
1157 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x66443bcd9000
1157 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x66443bcd8000
1157 arch_prctl(ARCH_SET_FS, 0x66443bcd9700) = 0
1157 mprotect(0x66443aac3000, 16384, PROT_READ) = 0
1157 mprotect(0x66443a71d000, 4096, PROT_READ) = 0
1157 mprotect(0x66443ace5000, 4096, PROT_READ) = 0
1157 mprotect(0x66443babe000, 4096, PROT_READ) = 0
1157 mprotect(0x66443b0c7000, 110592, PROT_READ) = 0
1157 mprotect(0x66443b353000, 16384, PROT_READ) = 0
1157 mprotect(0x66443b5a3000, 4096, PROT_READ) = 0
1157 mprotect(0x66443b8a8000, 4096, PROT_READ) = 0
1157 mprotect(0xcc9fe78f000, 1843200, PROT_READ|PROT_WRITE) = -1 EACCES (Permission denied)
1157 writev(2, [{"tor", 3}, {": ", 2}, {"error while loading shared libraries", 36}, {": ", 2}, {"", 0}, {"", 0}, {"cannot make segment writable for relocation", 43}, {": ", 2}, {"Permission denied", 17}, {"\n", 1}], 10) = 106
1157 exit_group(127) = ?
1157 +++ exited with 127 +++

Child Tickets

Change History (8)

comment:1 Changed 6 years ago by nickm

Milestone: Tor: 0.2.???
Status: newneeds_information

So, Tor 0.2.4.21 worked for this, but 0.2.4.22 does not?

If so, can you confirm that this Tor was built with all the same libraries and options as the last version of Tor?

If neither version of Tor works, can you try configuring Tor with --disable-gcc-hardening to see whether one of those options is responsible?

According to the FAQ [1], this error message means that Tor -- or one of the libraries it's using -- is using text relocation for linking. It says that you can maybe find out which program or library it is using the "scanelf" utility from app-misc/pax-utils (which may have a different names if you aren't on gentoo).

[1] http://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

comment:2 in reply to:  1 Changed 6 years ago by cypherpunks

Replying to nickm:

So, Tor 0.2.4.21 worked for this, but 0.2.4.22 does not?

Correct. Tor 0.2.4.21 does not suffer from this bug.

However in 0.2.4.22 scanelf reports:
scanelf -qtmyR /usr/bin/
TEXTREL /usr/bin/tor
TEXTREL /usr/bin/tor-gencert
TEXTREL /usr/bin/tor-resolve

If so, can you confirm that this Tor was built with all the same libraries and options as the last version of Tor?

It should be the same as this package as both are currently in the main repository of Arch Linux. I will open a bug there as well to figure out how this happened/if they made any changes...

comment:3 Changed 6 years ago by strcat

I'm the maintainer of linux-grsec in Arch Linux. Here's the downstream bug report: https://bugs.archlinux.org/task/40685

This isn't a bug in tor itself, so the issue here can be closed. At the moment, Arch Linux has a backported binutils patch causing every single PIE binary (even hello world) built with ld.bfd to conflict with the PaX MPROTECT mitigations. Passing -fuse-ld=gold in LDFLAGS is enough to work around this issue. Tor is one of the few packages going to the trouble of using PIE (which is great!) so that's why it occurred with this package. Chromium is another project opting into PIE, but it already has an MPROTECT exception for the JavaScript VM and PNaCl.

Last edited 6 years ago by strcat (previous) (diff)

comment:4 Changed 6 years ago by nickm

Resolution: fixed
Status: needs_informationclosed

Okay. So the next time somebody reports this failure, we'll point them here, and tell them about -fuse-ld=gold ? Thanks!

comment:5 Changed 6 years ago by strcat

Yeah, although I hope this will be fixed in binutils soon. I'll likely just rebuild Arch's tor package with ld.gold as a temporary workaround if I can't figure out a fix for bfd.

comment:6 Changed 6 years ago by blueness

I maintain both Gentoo's hardened-sources and tor. 1) We have not seen this issue in gentoo. 2) Gentoo's hardened toolchain builds everything PIE without introducing textrels using ld.bfd. But now we are off topic. If Arch needs a binutils patch that's PaX friendly, ping me in freenode/#gentoo-hardened.

comment:7 Changed 4 years ago by teor

Milestone: Tor: 0.2.???Tor: 0.3.???

Milestone renamed

comment:8 Changed 4 years ago by nickm

Milestone: Tor: 0.3.???

Milestone deleted

Note: See TracTickets for help on using tickets.