Port-amd64 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Turning on stack protection by default

On Fri Oct 23 2009 at 09:20:42 +0100, Matthias Scheler wrote:
> On Fri, Oct 23, 2009 at 01:47:54AM +0100, Mindaugas Rasiukevicius wrote:
> > > Considering that this feature helps finding bugs and increases system
> > > security I would like to suggest to turn in on by default on these
> > > two NetBSD ports.
> > 
> > Can you provide some numbers how it affects performance?
> I've attached a little test program which is very recursive.(*)
> Where are the results on my NetBSD/amd64 5.0_STABLE system
> which is driven by a ?Xen 3040 CP running at 1.83GHz:
> tron@colwyn:~>gcc fib.c -Wall -O2 -o fib  
> tron@colwyn:~>time ./fib 42
> 42 -> 267914296
> ./fib 42  14.07s user 0.00s system 99% cpu 14.119 total
> tron@colwyn:~>gcc fib.c -fstack-protector-all -Wstack-protector -Wall -O2 -o 
> fib 
> tron@colwyn:~>time ./fib 42
> 42 -> 267914296
> ./fib 42  15.07s user 0.00s system 98% cpu 15.261 total
> That is 8% overhead in a program which I believe gets affected particular
> bad by enabling stack protection.
>       Kind regards
> (*) Yes, this can be done much more efficient. The program is written
>     to defeat some of GCC's optimisations and to enforce stack protection.


I think I support enabling it (per gut feeling).

But to make up my mind, could you post some useful numbers on performance?
I don't really care if a program written to be slow is slow (it's almost
like you're arguing against your own proposal! ;).

What's the effect on something that people might actually care about,
say build.sh or apachebench?  Do we have a "firefoxbench" which measures
web client speed?  Or run the mysql benchmark Andy used extensively in
his work.  lmbench might be good to run too, just for a general overview.

  - antti

Home | Main Index | Thread Index | Old Index