Gentoo Archives: gentoo-hardened

From: Scott Taylor <scott@××××××××××××××××.net>
To: gentoo-hardened@g.o
Subject: Re: [gentoo-hardened] __guard and __stack_smash_handler transition from libgcc to libc
Date: Wed, 26 Nov 2003 02:34:00
Message-Id: 1069814044.4977.98.camel@Star.BerthoudWireless.net
In Reply to: [gentoo-hardened] Re: __guard and __stack_smash_handler transition from libgcc to libc by "Peter S. Mazinger"
1 On Sun, 23 Nov 2003, Alexander Gabert wrote:
2
3 > hi Martin,
4 >
5 > sorry to disturb you but there has been a hot weekend with me sorting
6 > out the side effects of the glibc transition to guard symbols.
7 >
8 > As this is becoming a technical challenge, i will explain it because i
9 > am sure we are on the right path with
10 > http://bugs.gentoo.org/show_bug.cgi?id=25299 containing a gcc ebuild
11 > diff which can do it right if bootstrap.sh on stage1 installations goes
12 > for building gcc directly after glibc (seemant told me this is a simple
13 > change).
14 >
15 > If the existing glibc is to be found to have the functions and the
16 > object of propolice inserted, the ebuild needs to search for binaries
17 > containing references to the __guard@GCC Version symbol in the shared
18 > library libgcc.so before removing the object and the functions in the
19 > gcc libgcc.
20 >
21 <stuff removed>
22 >
23 > Please approve and submit my changes in
24 > http://dev.gentoo.org/~pappy/gentoo-x86/sys-devel/gcc/ to the
25 > appropriate ebuilds of gcc and report back any improvements you would
26 > like to see in the progress of this movement.
27
28 However brave, dangerous, foolish or whatever, I got a chance to adopt
29 this patch early, though it was on gcc 3.3.2-r2 as I'm running ~x86
30 here. I had run into the issue of not being able to compile static
31 libs. Anyway, I ran the patch before the readelf sanity check was
32 written. It killed python on one machine, and restoring its binary got
33 that (and therefore, portage) back in action, it was rather painless
34 aside from that. There were a handful of programs on each machine that
35 were linked to the _guard in libgcc. By that point, I already had the
36 patched gcc installed, so I recompiled the affected packages directly,
37 without taking the extra step of compiling them without
38 -fstack-protector which would now be required (and would've assured a
39 safer migration) for the gcc ebuild to allow the patch to apply. So
40 yeah, I was living on the edge there. But with what we learned from
41 that, I have a pretty good feeling about this patch. It solved other
42 compiling issues, and I've now got the patched gcc-3.3.2-r2 on five
43 different machines here, all of which had been unable to finish an
44 emerge world due to some attempt at compiling a static library.
45
46 --
47 Scott Taylor - <scott@××××××××××××××××.net>
48
49 "So here's a picture of reality: (picture of circle with lots of sqiggles in it) As we all know, reality is a mess."
50
51 -- Larry Wall (Open Sources, 1999 O'Reilly and Associates)

Attachments

File name MIME type
signature.asc application/pgp-signature