1 |
Barry Dunn wrote: |
2 |
> Hi, I've converted a recent install to hardened (USE=hardened, changed |
3 |
> the profile to hardened-x86-2004.0, emerge gcc binutils glibc && emerge |
4 |
> -e world, using hardened-dev-sources-2.6.7-r3) and now cpufreqd won't |
5 |
> start, it segfaults every time. I will be using grsec/pax but have |
6 |
> removed them from the kernel for now, cpufreqd is still the same though. |
7 |
> |
8 |
> Guess I need to post a bug report, just thought I'd see if anyone had |
9 |
> any suggestions first on things to try. There's an strace below fwiw. |
10 |
> |
11 |
> Now that flags like -pie and -fstack-protector are deprecated in favour |
12 |
> of the hardened use flag, can anyone tell me how best to disable |
13 |
> hardened stuff when compiling particular packages, to work around any |
14 |
> problem like this? (I confess I'm not too clear on what all the compiler |
15 |
> options do or how they interrelate... more reading required.) |
16 |
> |
17 |
> Anyway, must say the conversion went very smoothly overall, looking |
18 |
> forward to getting to grips with it all... thank you contributors for |
19 |
> your time and efforts. :) |
20 |
> |
21 |
> Barry |
22 |
> |
23 |
> |
24 |
> strace output: |
25 |
> |
26 |
> execve("/usr/sbin/cpufreqd", ["/usr/sbin/cpufreqd"], [/* 31 vars */]) = |
27 |
> 0 uname({sys="Linux", node="tin", ...}) = 0 |
28 |
> brk(0) = 0x800075e0 |
29 |
> open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or |
30 |
> directory) open("/etc/ld.so.cache", O_RDONLY) = 3 |
31 |
> fstat64(3, {st_mode=S_IFREG|0644, st_size=31190, ...}) = 0 |
32 |
> mmap2(NULL, 31190, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40014000 |
33 |
> close(3) = 0 |
34 |
> open("/lib/libdl.so.2", O_RDONLY) = 3 |
35 |
> read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\\\33\0"..., |
36 |
> 512) = 512 fstat64(3, {st_mode=S_IFREG|0755, st_size=10452, ...}) = 0 |
37 |
> mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, |
38 |
> 0) = 0x4001c000 mmap2(NULL, 12072, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, |
39 |
> 0) = 0x4001d000 mmap2(0x4001f000, 4096, PROT_READ|PROT_WRITE, |
40 |
> MAP_PRIVATE|MAP_FIXED, 3, 0x1) = 0x4001f000 close(3) |
41 |
> = 0 open("/lib/libc.so.6", O_RDONLY) = 3 |
42 |
> read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0001Y\1\000"..., |
43 |
> 512) = 512 fstat64(3, {st_mode=S_IFREG|0755, st_size=1182840, ...}) = 0 |
44 |
> mmap2(NULL, 1103620, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = |
45 |
> 0x40020000 mmap2(0x40128000, 12288, PROT_READ|PROT_WRITE, |
46 |
> MAP_PRIVATE|MAP_FIXED, 3, 0x107) = 0x40128000 mmap2(0x4012b000, 9988, |
47 |
> PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = |
48 |
> 0x4012b000 close(3) = 0 |
49 |
> munmap(0x40014000, 31190) = 0 |
50 |
> open("/dev/urandom", O_RDONLY) = 3 |
51 |
> read(3, "\17;\256\334", 4) = 4 |
52 |
> close(3) = 0 |
53 |
> brk(0) = 0x800075e0 |
54 |
> brk(0x800285e0) = 0x800285e0 |
55 |
> brk(0) = 0x800285e0 |
56 |
> brk(0x80029000) = 0x80029000 |
57 |
> stat64("/proc/cpufreq", 0xbffff92c) = -1 ENOENT (No such file or |
58 |
> directory) stat64("/sys/devices/system/cpu/cpu0/cpufreq", |
59 |
> {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0 open("/etc/cpufreqd.conf", |
60 |
> O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=1687, ...}) = |
61 |
> 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, |
62 |
> 0) = 0x40014000 read(3, "# cpufreqd.conf\n\n[General]\npidfi"..., 4096) |
63 |
> = 1687 time([1090190008]) = 1090190008 |
64 |
> open("/etc/localtime", O_RDONLY) = 4 |
65 |
> fstat64(4, {st_mode=S_IFREG|0644, st_size=1323, ...}) = 0 |
66 |
> mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, |
67 |
> 0) = 0x40015000 read(4, |
68 |
> "TZif\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\7\0\0\0\7\0"..., 4096) = |
69 |
> 1323 close(4) = 0 |
70 |
> munmap(0x40015000, 4096) = 0 |
71 |
> rt_sigaction(SIGPIPE, {0x400ceef2, [], 0}, {SIG_DFL}, 8) = 0 |
72 |
> socket(PF_UNIX, SOCK_DGRAM, 0) = 4 |
73 |
> fcntl64(4, F_SETFD, FD_CLOEXEC) = 0 |
74 |
> connect(4, {sa_family=AF_UNIX, path="/dev/log"}, 16) = -1 EPROTOTYPE |
75 |
> (Protocol wrong type for socket) close(4) |
76 |
> = 0 socket(PF_UNIX, SOCK_STREAM, 0) = 4 |
77 |
> fcntl64(4, F_SETFD, FD_CLOEXEC) = 0 |
78 |
> connect(4, {sa_family=AF_UNIX, path="/dev/log"}, 16) = 0 |
79 |
> send(4, "<28>Jul 18 23:33:28 cpufreqd: pa"..., 80, 0) = 80 |
80 |
> rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0 |
81 |
> read(3, "", 4096) = 0 |
82 |
> close(3) = 0 |
83 |
> munmap(0x40014000, 4096) = 0 |
84 |
> time([1090190008]) = 1090190008 |
85 |
> rt_sigaction(SIGPIPE, {0x400ceef2, [], 0}, {SIG_DFL}, 8) = 0 |
86 |
> send(4, "<29>Jul 18 23:33:28 cpufreqd: pa"..., 91, 0) = 91 |
87 |
> rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0 |
88 |
> time([1090190008]) = 1090190008 |
89 |
> rt_sigaction(SIGPIPE, {0x400ceef2, [], 0}, {SIG_DFL}, 8) = 0 |
90 |
> send(4, "<29>Jul 18 23:33:28 cpufreqd: pa"..., 87, 0) = 87 |
91 |
> rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0 |
92 |
> time([1090190008]) = 1090190008 |
93 |
> rt_sigaction(SIGPIPE, {0x400ceef2, [], 0}, {SIG_DFL}, 8) = 0 |
94 |
> send(4, "<29>Jul 18 23:33:28 cpufreqd: pa"..., 84, 0) = 84 |
95 |
> rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0 |
96 |
> time([1090190008]) = 1090190008 |
97 |
> rt_sigaction(SIGPIPE, {0x400ceef2, [], 0}, {SIG_DFL}, 8) = 0 |
98 |
> send(4, "<29>Jul 18 23:33:28 cpufreqd: pa"..., 89, 0) = 89 |
99 |
> rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0 |
100 |
> time([1090190008]) = 1090190008 |
101 |
> rt_sigaction(SIGPIPE, {0x400ceef2, [], 0}, {SIG_DFL}, 8) = 0 |
102 |
> send(4, "<29>Jul 18 23:33:28 cpufreqd: pa"..., 89, 0) = 89 |
103 |
> rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0 |
104 |
> geteuid32() = 0 |
105 |
> time([1090190008]) = 1090190008 |
106 |
> rt_sigaction(SIGPIPE, {0x400ceef2, [], 0}, {SIG_DFL}, 8) = 0 |
107 |
> send(4, "<29>Jul 18 23:33:28 cpufreqd: St"..., 52, 0) = 52 |
108 |
> rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0 |
109 |
> rt_sigaction(SIGTERM, {0x800032fa, [HUP INT TERM], 0}, NULL, 8) = 0 |
110 |
> rt_sigaction(SIGINT, {0x8000327c, [HUP INT TERM], 0}, NULL, 8) = 0 |
111 |
> rt_sigaction(SIGHUP, {0x800031fe, [HUP INT TERM], 0}, NULL, 8) = 0 |
112 |
> open("/usr/lib/libsys_acpi.so", O_RDONLY) = 3 |
113 |
> read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200\f\0"..., |
114 |
> 512) = 512 fstat64(3, {st_mode=S_IFREG|0755, st_size=10168, ...}) = 0 |
115 |
> mmap2(NULL, 9000, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40014000 |
116 |
> mmap2(0x40016000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, |
117 |
> 0x2) = 0x40016000 close(3) = 0 |
118 |
> --- SIGSEGV (Segmentation fault) @ 0 (0) --- |
119 |
> +++ killed by SIGSEGV +++ |
120 |
> |
121 |
> -- |
122 |
> gentoo-hardened@g.o mailing list |
123 |
> |
124 |
please try chpaxing or paxctling it: |
125 |
|
126 |
chpax -pemsrv or paxctl --help |
127 |
|
128 |
and then find out which protection needs to be disabled, reenable all |
129 |
the others and tell us what thing you had to turn on/off to make it work. |
130 |
|
131 |
i doubt its the hardened and i assume its some kind of memory access/io |
132 |
access that leads it to fail. |
133 |
|
134 |
thanks, |
135 |
|
136 |
Alex |
137 |
|
138 |
-- |
139 |
Chaos is just a perceptional disorder of reality. |
140 |
|
141 |
-- |
142 |
gentoo-hardened@g.o mailing list |