Gentoo Archives: gentoo-dev

From: "Diego Elio Pettenò" <flameeyes@×××××.com>
To: gentoo-dev@l.g.o
Cc: gentoo-qa@l.g.o
Subject: [gentoo-dev] Portage to die on sure-enough _FORTIFY_SOURCE overflows
Date: Tue, 28 Sep 2010 09:44:10
Message-Id: 1285667008.13141.31.camel@yamato.local
1 Hi all,
2
3 since the last time I asked Zac about this it came back to bite me[1]
4 this time I'm going to send the announce to the list first, and if
5 nobody can actually come up with a good reason not to, I'm going to ask
6 Zac tomorrow to re-enable the feature.
7
8 What is this about? Portage already reports some of the overflow
9 warnings coming from the glibc fortified sources (-D_FORTIFY_SOURCE=2
10 -O2 — enabled since gcc 4.3.3-r1 and even stronger with gcc 4.5 and
11 glibc 2.12+, afaict), but they really are divided into two categories:
12
13 - might overflow (depends on combination of parameters and variables the
14 compiler can't completely untangle);
15 - _will_ overflow (whenever that code path is hit, an overflow will
16 happen).
17
18 The former we should highlight but not die upon; the latter, though...
19
20 As Mike and me expressed on the linked bug, code that is built with that
21 warning is code that is going to crash as surely as
22
23 char *foo = NULL;
24 foo[3] = 'a';
25
26 which could result in nasty surprises for users (see [2] for the whole
27 reasoning).
28
29 Now, we've not seen "proper" false positives (in the Portage sense I
30 mean — because even if the C library hits a false positive, it _will_
31 crash with an abort() from its own code!), but Kumba pointed me at a
32 case that wasn't entirely clear, and took a bit of detective work to
33 track down [3] so you could have users report issues you cannot easily
34 identify or reproduce. I cannot make promises, but if all else fail I'll
35 see to be around to help you with those cases.
36
37 So if you want to have your say, gentoo-qa is there for that.
38
39 Thank you,
40
41 [1] https://bugs.gentoo.org/show_bug.cgi?id=337031
42 [2]
43 http://blog.flameeyes.eu/2010/09/14/not-all-failures-are-caused-equal
44 [3]
45 http://blog.flameeyes.eu/2010/09/12/some-_fortify_source-far-fetched-warnings-are-funny
46
47 --
48 Diego Elio Pettenò — “Flameeyes”
49 http://blog.flameeyes.eu/
50
51 If you found a .asc file in this mail and know not what it is,
52 it's a GnuPG digital signature: http://www.gnupg.org/

Replies