Gentoo Archives: gentoo-hardened

From: "Peter S. Mazinger" <ps.m@×××.net>
To: gentoo-hardened@g.o
Subject: [gentoo-hardened] -fstack-protector-all used for kernel build
Date: Sat, 13 Dec 2003 09:15:58
Message-Id: Pine.LNX.4.44.0312131412230.21639-100000@lnx.bridge.net
1 Hello!
2
3 I am trying to build a kernel-2.4.23 with stack protector enabled using
4 gcc-3.3.2, propolice 3.3-5 and frogger's patch (needs some cleanup in
5 propolice.c:
6 1 warning can be solved by adding #include <linux/kernel.h> (for panic)
7 the other is:
8 warning: octal escape sequence out of range
9 warning: multi-character character constant
10
11 I do not understand what the warning means (gcc-2.96 has another warning),
12 it happens for the line
13 int __guard = '\0\0\n\777';
14 How to correct this?
15
16 I tried to add -fstack-protector-all and -fforce-addr (like in
17 hardened-gcc), but -fforce-addr does not work at all
18 (assembler definition of BUG() in asm-i386/page.h, produces the warning
19 below in blkdev.h, if I change 1 to 0, to get the simplified version of
20 BUG(), then the blkdev.h warning is gone), but after that the assembler
21 usage in random.c/sched.c produces:
22
23 warning: asm operand 1 probably doesn't match constraints
24 error: impossible constraint in `asm'
25
26 and exits (make -s bzImage)
27
28 Now back to frogger's patch and -fstack-protector -fstack-protector-all
29
30 Warnings due to gcc-3.3 usage (not present for gcc-2.95/96)
31 vt.c: In function `do_kdsk_ioctl':
32 vt.c:166: warning: comparison is always false due to limited range of data type
33 vt.c: In function `do_kdgkb_ioctl':
34 vt.c:283: warning: comparison is always false due to limited range of data type
35 keyboard.c: In function `do_fn':
36 keyboard.c:640: warning: comparison is always true due to limited range of data type
37 string.c:384: warning: conflicting types for built-in function `bcopy'
38
39 see above
40 propolice.c:8:15: warning: octal escape sequence out of range
41 propolice.c:8:15: warning: multi-character character constant
42
43 Warning due to gcc-3.3 usage (not present for gcc-2.95/96)
44 process.c: In function `machine_restart':
45 process.c:427: warning: use of memory input without lvalue in asm operand 0 is deprecated
46
47 My problem:
48 misc.o(.text+0xb): In function `huft_build':
49 : undefined reference to `__guard'
50 misc.o(.text+0x4e8): In function `huft_build':
51 : undefined reference to `__guard'
52 misc.o(.text+0x4fb): In function `huft_build':
53 : undefined reference to `__stack_smash_handler'
54 misc.o(.text+0x511): In function `huft_free':
55 : undefined reference to `__guard'
56 misc.o(.text+0x53a): In function `huft_free':
57 : undefined reference to `__guard'
58 misc.o(.text+0x549): In function `huft_free':
59 : undefined reference to `__stack_smash_handler'
60 misc.o(.text+0x55c): In function `inflate_codes':
61 : undefined reference to `__guard'
62 misc.o(.text+0x911): In function `inflate_codes':
63 : undefined reference to `__guard'
64 misc.o(.text+0x921): In function `inflate_codes':
65 : undefined reference to `__stack_smash_handler'
66 misc.o(.text+0x93d): In function `inflate_stored':
67 : undefined reference to `__guard'
68 misc.o(.text+0xa9a): In function `inflate_stored':
69 : undefined reference to `__guard'
70 misc.o(.text+0xaa9): In function `inflate_stored':
71 : undefined reference to `__stack_smash_handler'
72 misc.o(.text+0xac5): In function `inflate_fixed':
73 : undefined reference to `__guard'
74 misc.o(.text+0xc19): In function `inflate_fixed':
75 : undefined reference to `__guard'
76 misc.o(.text+0xc2c): In function `inflate_fixed':
77 : undefined reference to `__stack_smash_handler'
78 misc.o(.text+0xc46): In function `inflate_dynamic':
79 : undefined reference to `__guard'
80 misc.o(.text+0x11b4): In function `inflate_dynamic':
81 : undefined reference to `__guard'
82 misc.o(.text+0x11c7): In function `inflate_dynamic':
83 : undefined reference to `__stack_smash_handler'
84 misc.o(.text+0x11df): In function `inflate_block':
85 : undefined reference to `__guard'
86 misc.o(.text+0x12bc): In function `inflate_block':
87 : undefined reference to `__guard'
88 misc.o(.text+0x12cb): In function `inflate_block':
89 : undefined reference to `__stack_smash_handler'
90 misc.o(.text+0x12eb): In function `inflate':
91 : undefined reference to `__guard'
92 misc.o(.text+0x136f): In function `inflate':
93 : undefined reference to `__guard'
94 misc.o(.text+0x137f): In function `inflate':
95 : undefined reference to `__stack_smash_handler'
96 misc.o(.text+0x13a3): In function `makecrc':
97 : undefined reference to `__guard'
98 misc.o(.text+0x1425): In function `makecrc':
99 : undefined reference to `__stack_smash_handler'
100 misc.o(.text+0x143a): In function `gunzip':
101 : undefined reference to `__guard'
102 misc.o(.text+0x18b0): In function `gunzip':
103 : undefined reference to `__guard'
104 misc.o(.text+0x18bf): In function `gunzip':
105 : undefined reference to `__stack_smash_handler'
106 misc.o(.text+0x18d1): In function `malloc':
107 : undefined reference to `__guard'
108 misc.o(.text+0x192d): In function `malloc':
109 : undefined reference to `__guard'
110 misc.o(.text+0x193c): In function `malloc':
111 : undefined reference to `__stack_smash_handler'
112 misc.o(.text+0x194d): In function `free':
113 : undefined reference to `__guard'
114 misc.o(.text+0x1964): In function `free':
115 : undefined reference to `__stack_smash_handler'
116 misc.o(.text+0x1972): In function `gzip_mark':
117 : undefined reference to `__guard'
118 misc.o(.text+0x1989): In function `gzip_mark':
119 : undefined reference to `__guard'
120 misc.o(.text+0x1998): In function `gzip_mark':
121 : undefined reference to `__stack_smash_handler'
122 misc.o(.text+0x19a7): In function `gzip_release':
123 : undefined reference to `__guard'
124 misc.o(.text+0x19c9): In function `gzip_release':
125 : undefined reference to `__stack_smash_handler'
126 misc.o(.text+0x19d7): In function `scroll':
127 : undefined reference to `__guard'
128 misc.o(.text+0x1a41): In function `scroll':
129 : undefined reference to `__guard'
130 misc.o(.text+0x1a50): In function `scroll':
131 : undefined reference to `__stack_smash_handler'
132 misc.o(.text+0x1a61): In function `puts':
133 : undefined reference to `__guard'
134 misc.o(.text+0x1b08): In function `puts':
135 : undefined reference to `__guard'
136 misc.o(.text+0x1b17): In function `puts':
137 : undefined reference to `__stack_smash_handler'
138 misc.o(.text+0x1b2c): In function `memset':
139 : undefined reference to `__guard'
140 misc.o(.text+0x1b52): In function `memset':
141 : undefined reference to `__guard'
142 misc.o(.text+0x1b61): In function `memset':
143 : undefined reference to `__stack_smash_handler'
144 misc.o(.text+0x1b76): In function `memcpy':
145 : undefined reference to `__guard'
146 misc.o(.text+0x1ba1): In function `memcpy':
147 : undefined reference to `__guard'
148 misc.o(.text+0x1bb0): In function `memcpy':
149 : undefined reference to `__stack_smash_handler'
150 misc.o(.text+0x1bc1): In function `fill_inbuf':
151 : undefined reference to `__guard'
152 misc.o(.text+0x1c06): In function `fill_inbuf':
153 : undefined reference to `__guard'
154 misc.o(.text+0x1c15): In function `fill_inbuf':
155 : undefined reference to `__stack_smash_handler'
156 misc.o(.text+0x1c2c): In function `flush_window_low':
157 : undefined reference to `__guard'
158 misc.o(.text+0x1c91): In function `flush_window_low':
159 : undefined reference to `__guard'
160 misc.o(.text+0x1ca0): In function `flush_window_low':
161 : undefined reference to `__stack_smash_handler'
162 misc.o(.text+0x1cb9): In function `flush_window_high':
163 : undefined reference to `__guard'
164 misc.o(.text+0x1d2d): In function `flush_window_high':
165 : undefined reference to `__guard'
166 misc.o(.text+0x1d3c): In function `flush_window_high':
167 : undefined reference to `__stack_smash_handler'
168 misc.o(.text+0x1d4c): In function `flush_window':
169 : undefined reference to `__guard'
170 misc.o(.text+0x1d6d): In function `flush_window':
171 : undefined reference to `__guard'
172 misc.o(.text+0x1d7c): In function `flush_window':
173 : undefined reference to `__stack_smash_handler'
174 misc.o(.text+0x1d8b): In function `error':
175 : undefined reference to `__guard'
176 misc.o(.text+0x1db9): In function `setup_normal_output_buffer':
177 : undefined reference to `__guard'
178 misc.o(.text+0x1e01): In function `setup_normal_output_buffer':
179 : undefined reference to `__guard'
180 misc.o(.text+0x1e10): In function `setup_normal_output_buffer':
181 : undefined reference to `__stack_smash_handler'
182 misc.o(.text+0x1e29): In function `setup_output_buffer_if_we_run_high':
183 : undefined reference to `__guard'
184 misc.o(.text+0x1ed4): In function `setup_output_buffer_if_we_run_high':
185 : undefined reference to `__guard'
186 misc.o(.text+0x1ee3): In function `setup_output_buffer_if_we_run_high':
187 : undefined reference to `__stack_smash_handler'
188 misc.o(.text+0x1ef2): In function `close_output_buffer_if_we_run_high':
189 : undefined reference to `__guard'
190 misc.o(.text+0x1f34): In function `close_output_buffer_if_we_run_high':
191 : undefined reference to `__guard'
192 misc.o(.text+0x1f43): In function `close_output_buffer_if_we_run_high':
193 : undefined reference to `__stack_smash_handler'
194 misc.o(.text+0x1f52): In function `decompress_kernel':
195 : undefined reference to `__guard'
196 misc.o(.text+0x2002): In function `decompress_kernel':
197 : undefined reference to `__guard'
198 misc.o(.text+0x2011): In function `decompress_kernel':
199 : undefined reference to `__stack_smash_handler'
200 make[2]: *** [bvmlinux] Error 1
201 make[1]: *** [compressed/bvmlinux] Error 2
202 make: *** [bzImage] Error 2
203
204 This does not happen for only using -fstack-protector.
205
206 Can this be solved? Or otherway round, would the -fstack-protector-all
207 enhance kernel security?
208
209 Thanks, Peter
210
211 --
212 Peter S. Mazinger <ps.m@×××.net> ID: 0xA5F059F2 NIC: IXUYHSKQLI
213 Key fingerprint = 92A4 31E1 56BC 3D5A 2D08 BB6E C389 975E A5F0 59F2
214
215
216 ____________________________________________________________________
217 Miert fizetsz az internetert? Korlatlan, ingyenes internet hozzaferes a FreeStarttol.
218 Probald ki most! http://www.freestart.hu
219
220 --
221 gentoo-hardened@g.o mailing list

Replies

Subject Author
[gentoo-hardened] Re: -fstack-protector-all used for kernel build Peter Simons <simons@××××.to>
[gentoo-hardened] Re: -fstack-protector-all used for kernel build "Peter S. Mazinger" <ps.m@×××.net>