Summary

gcc 4.1 comes with SSP now, which is a nice technology to mitigate exploitability of many buffer overflows. This greatly enhances security in the time between publication of a vulnerability and the USN.

Rationale

A considerable percentage of arbitrary code execution vulnerabilities result from buffer overflows; about half of them occur due to overflowing a stack variable. While this does not avoid the necessity of issuing USNs, it provides effective zero-day protection for a subset of vulnerabilities, and since it is now in gcc upstream, it is very cheap for us to enable and support.

Use cases

Scope

This affects all packages in all components.

Design

SSP provides a technology to stop exploitability of this class of vulnerabilities by (1) reordering stack variables and (2) adding a 'canary' (a random number) to the bottom of the stack, which is checked when the function is returned, so that attempts to overwrite the return pointer are detected and stopped.

SSP itself has been around for some years and thus has matured quite a bit, and many distros are using it by default already. Therefore this should not be a major risk, since we are merely catching up with existing technology.

Implementation

RedHat and gentoo are using SSP by default for years, so we do not expect much breakage potential. So we will build packages with SSP enabled right from the start in Edgy, so that we have much time to discover breakage. If it is not trivial to fix a package for SSP, we can disable it by building it with fno-stack-protector.

We will not rebuild the archive in one shot. So in the unlikely event that SSP will cause many regressions, we can immediately revert enabling it and just have to rebuild a relatively low number of packages.

testing

The following dapper packages have been tested with SSP enabled (built with gcc-4.1 and -fstack-protector under edgy):

perl

ok

python

ok

apache2

ok

php5

ok

postgresql-8.1

ok

firefox

ok

mysql-dfsg-5.0

ok

glib2.0

ok

gtk+2.0

ok

glibc

ok

mono

ok

ghc6

ok

xorg

kernel

does not link since SSP uses external symbols provided by libssp.so

Before enabling SSP by default we will ensure that all those packages work flawlessly with SSP.

gcc changes

This would mean to change gcc-4.1 to enable -fstack-protector.

Archived discussion

Option 1: change gcc default behaviour

Pros:

Cons:

Option 2: dpkg gcc wrapper

Short-term solution for Edgy:

Generic long-term solution:

Pros:

Cons:

Decision

After discussing the options with several people, it was decided that we will enable SSP by default in gcc proper (option 1).

Record of problems


CategorySpec

GccSsp (last edited 2008-08-06 16:19:12 by localhost)