Stack smash protection: Automated (de)bugging?

John Richard Moser nigelenki at comcast.net
Wed Jul 12 06:17:10 BST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



Dan Kegel wrote:
> On 7/11/06, John Richard Moser <nigelenki at comcast.net> wrote:
>> I am planning to rewrite libssp0 clean and produce a version that takes
>> advantage of an external daemon
> 
> I've been wanting to do something similar, but with a
> preload library, kind of like catchsegv uses libSegFault.so,
> instead of trying to jam the external daemon hook into the toolchain.

It won't be in the toolchain, the changes will go like this:

 * toolchain supplies a __stack_chk_fail2() in libssp0

 * toolchain uses __stack_chk_fail2() to handle stack smashes

 * glibc provides its own minimal __stack_chk_fail2() (it provides a
   __stack_chk_fail() now)

 * we modify the glibc __stack_chk_fail2() to use a library under
   certain conditions

 * We supply a libssp that talks to our daemon

 * We tell glibc to use that libssp for stack_chk_fail2()

Our daemon and hooks to talk to it will be completely external to the
toolchain.  In fact the final result can remove our libssp and behave
exactly as any other system.

> You might want to consider the same.
> (Hmm,  been thinking about it for three years now, never got around to
> it... http://sources.redhat.com/ml/libc-alpha/2003-05/msg00006.html )
> 
> The nice thing about this approach is that users who want to get rid
> of the feature can just unset LD_PRELOAD.
> - Dan

Has problems, mainly in a multi-lib environment; I want a robust
solution that won't break on distributions that want to run 32- and
64-bit code at the same time.  Also LD_PRELOAD is more a debugging tool
than anything else.  (yes ironically this is a debugging tool as well
but...)

> 

- --
All content of all messages exchanged herein are left in the
Public Domain, unless otherwise explicitly stated.

    Creative brains are a valuable, limited resource. They shouldn't be
    wasted on re-inventing the wheel when there are so many fascinating
    new problems waiting out there.
                                                 -- Eric Steven Raymond

    We will enslave their women, eat their children and rape their
    cattle!
                  -- Bosc, Evil alien overlord from the fifth dimension
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQIVAwUBRLSF1As1xW0HCTEFAQLaAA/7B9te56UrqSig7Dl2Z1KZOxin43gxVo2R
0f3ZvzbDjORFJGZadw9R2x/3kOWoW78cYhGN9Kxgq9c2+EYBNHqrYSai6wcQzFsK
7UD8lOqndgX5F1ldSrEoA4IGP05Hw+JT69Y5tQ/ekaapSB84qYZW1JuUA5sUN6Zi
TXNrrHekkMurHB9PxGtzCIkexZIDJbcE+TKPa+Vn7fNGs5UmWzKkId+9O4Z5Rbnt
YruTKNmYjt4Nu0XNr376paA0q8gVBvnwb9qcTYbbihKkqr3TQX0PZvatIx3nOJM9
GcvQqRYvQznUFJ1ODK+Mr77e1hbsn4I9cM2ZNOHg6CEaC+yjykxuEUITlVkcKrPB
2WE4RCM9AOH4xOhdpa7yyidV8uTNlRqRDT/a2298Yd1kMsTiqHxnFjiumqhXx/ar
ZkmwlYNcU7pclMpyZ+4sGGaIie02997sS2qBAk9DXnSVddQy8o0rJYrBdzXrkjci
2kViFiGVntVM8fF/4RRIS320b8NbjzLAWwHHwvNqyn3tWPB46j2XXmYsGfwlvFjz
E9iTy6JjL0h6KmYNKIEv8sgrkgXeJvDgKXhNQN/jGaTswalOBmwG/XD1EetjT8br
kTeImTWj59HwYwG5KHWucUhUiqYf04T2PAAMGr8dvMJH4USatDeyE+3AMdTdXuUS
pYuZDQ96f9w=
=dnq1
-----END PGP SIGNATURE-----



More information about the ubuntu-devel mailing list