1 Feb 01:58
Re: Can we get PIE on all SUID binaries by default, por favor?
Anthony G. Basile <blueness <at> gentoo.org>
2012-02-01 00:58:32 GMT
2012-02-01 00:58:32 GMT
On 01/29/2012 02:14 PM, Mike Frysinger wrote:
> On Saturday 28 January 2012 07:26:59 Anthony G. Basile wrote:
>> I've run nbench on two amd64 systems both running the same kernel
>> vanilla-3.2.2.
> i don't think nbench is a good benchmark for this as it isn't really testing
> what you think it's testing. it's very good at validating math support in the
> ISA/ABI, optimized compiler output, and supplementary math implementations in
> libgcc. PIE vs non-PIE will still be able to multiply/divide in pretty much
> the same amount of time.
I know, but the problem is, what benchmark best approximates common
every day use? So I wrote the following which really hits the problem
hard on x86:
int modfac(int n)
{
if(n==0) return 1;
return n * modfac(n-1);
}
int main()
{
int i;
for( i = 0 ; i < 4096*4096 ; i++ ) modfac(4096);
return 0;
}
Using vanilla kernel 3.2.2, userland built with vanilla toolchain,
gcc-4.5.3-r1, glibc-2.13-r4, binutils-2.21.1-r1, compiling my code
simply as gcc -o test modfac.c, CFLAGS="-O2 -march=i686 -pipe" I get:
(Continue reading)
RSS Feed