Wow, good question.
Yes.
That a good enough answer? (joke)
Which part would you like me to quantify? There are several statements.
You got me, I don't know it all. I admit, I did get some of my information from posts on here. I may not post much, but I do read. I did specify where I did test, but this is one area where I have not extensively tested, and should have specified.
To break it down:
pic/pie are really handy (required) for building ET_DYN executables that PAX can randomize with minimal loss of performance vs. building ET_EXEC and forcing randomization.
A) the gentoo USE flags pic/pie are required to build proper ET_DYN executables under gentoo. This isnt under debate, I assume.
B) I read on previous messages on the original grsecurity forum about ET_DYN allowing the execution of processed with randomized memory to occur faster. This is based upon information that I read, so it may not be correct or interpreted correctly.
This really isn’t a huge deal, but when you really harden your system you can lose a lot of performance.
Most of the time, hardening reduces the amount of overhead on the system by reducing unneeded crud. (i.e. - disabling and moving stuff you don’t need, both on the system and in applications) This is a good thing.
When you start getting overly paranoid, like me, hardening can work against you – atleast performance wise.
This is how:
A) By default, Propolice/SSP ads about 0-8% performance hit, depending on the application. (see
http://www.research.ibm.com/trl/project ... 0000000000 )
I mentioned this in my previous message, so I won’t go in to detail, but I found through testing that GCC compile options directly affected the functionality of Propolice/SSP. –Os would allow Propolice/SSP to catch the most overflow attempts, while –O3 would catch the least. (none, -O and –O2 would fall in the middle). By my memory, -O3 would render propolice/ssp almost completely ineffective, and –Os was almost 15-20% more effective than –O2. Meaning if you wanted the extra assurance, you would use –Os, which would optimize all binaries for size and not speed… Making your binaries even slower, but harder to overflow.
B) Libsafe can have, as they put it, less than 15% overhead on commonly used applications. (
http://www.research.avayalabs.com/proje ... aton_tests ) Using libsafe on programs can and will slow it down, the real measure can only be done on each program, as their use of ANSI-C string functions will be different.
C) If you really harden your system, you probably (at least you should be) enforcing that only stronger encryption/authentication methods that can be used in applications, disallowing breaches of privacy through downgrade attacks, brute force attacks, etc. Although this isnt perfect (is anything?), it’s a nice little layer. Still to my point, enforcing stronger encryption/authentication can add more processing, thus slowing your system a little more.
D) More related to PAX, using randomization vs. static memory layout causes more processing to be performed when a process starts and allocates memory. Although I do not have hard number on this, it doesn't take a rocket scientist to realize that it is doing more work initially. As to ET_DYN being faster than ET_EXEC on starting processes, I do not have hard numbers. Only read it here previously, and possibly mis-interpreted.
E) The more extensive access control lists you have (iptables, tcpwrappers, posix ACL’s, grsecurity, etc/whatever) the more performance impact they will have. Okay so you can optimize the lists so they have minimal impact, but they still have a direct impact on performance.
And there are probably even more factors.
The more insane your hardening, the worse you can make performance. All the little additions you make here and there can add up. Its not really a knock against any specific hardening tools, such as grsec or anything else.
No I do not have hard numbers on this, would you like some? Come up with a specific test and I’ll run it, but many of the tests would be subjective to configuration.
Of course, there is something to be said for simplicity.
So, is my logic completely flawed? Please educate me. (Sometimes the best way to learn is to be proven wrong)