Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Jul 1998 09:04:27 +1000 (EST)
From:      Peter Jeremy <peter.jeremy@alcatel.com.au>
To:        snar@paranoia.ru
Cc:        security@FreeBSD.ORG
Subject:   Re: The 99,999-bug question: Why can you execute from the stack?
Message-ID:  <199807212304.JAA28032@gsms01.alcatel.com.au>

next in thread | raw e-mail | index | archive | help
On Wed, 22 Jul 1998 01:31:20 +0400, Alexandre Snarskii <snar@paranoia.ru> wrote:
>On Mon, Jul 20, 1998 at 02:30:33PM -0700, Don Lewis wrote:
>> In the situations where I've used code compiled this way, it seems
>> to average about a factor of 20 more expensive in terms of CPU usage.
>
>Strange result. Program, which does nothig but 100.000 strcpy's
>works _six_ times slower with bounds checking, but not 20... 

It's strongly dependent on which strcpy was used:
1) If you use the strcpy in libc, then there's no bounds checking -
   all you get is that both the source and destination pointers are
   valid when strcpy is called.
2) The bounds checking library includes a strcpy which is bounds
   checking aware - it explicitly checks the source string and
   destination buffer for validity and compatibility and then performs
   the copy without further checks.
3) If you wrote your own strcpy, then each time you copy a character,
   both the source and destination pointers will be checked.

Six times is about right for the second case.  I got about 200 times
for the third case.

Peter
--
Peter Jeremy (VK2PJ)                    peter.jeremy@alcatel.com.au
Alcatel Australia Limited
41 Mandible St                          Phone: +61 2 9690 5019
ALEXANDRIA  NSW  2015                   Fax:   +61 2 9690 5247

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe security" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199807212304.JAA28032>