Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 213255 - hardened-sources-2.6.23-r9: stabilize request (pending)
Summary: hardened-sources-2.6.23-r9: stabilize request (pending)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: The Gentoo Linux Hardened Team
URL: http://www.securityfocus.com/bid/27704
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-13 12:37 UTC by cilly
Modified: 2008-04-08 17:09 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to address bug #206678 (selectively-disable-pax_emutramp.patch,750 bytes, patch)
2008-03-30 16:57 UTC, kfm
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description cilly 2008-03-13 12:37:16 UTC
please mark stable/unmask
Comment 1 cilly 2008-03-13 21:19:53 UTC
-r8 fixes issues in above url
Comment 2 kfm 2008-03-22 19:01:32 UTC
Updating summary to reference 2.6.23-r9 (which has recently been committed).
Comment 3 solar (RETIRED) gentoo-dev 2008-03-22 19:38:20 UTC
-r9 will be what we would like to begin targeting stable testing for a few weeks.
Comment 4 kfm 2008-03-22 20:09:46 UTC
A vote of confidence from the PPC camp would be most welcome :)
Comment 5 nixnut (RETIRED) gentoo-dev 2008-03-23 14:26:32 UTC
Builds and boots ok. It'll be running on this machine now. So some ppc testing is underway as of now.
Comment 6 cilly 2008-03-23 17:34:59 UTC
x86

Build and runs fine with pax and grsec enabled, hardened userland, traffic shaping & l7-filter.

Running services:

apache, bind, postfix, courier, sshd, nfs, dhcpd, ddclient, mrtg, snmp, mysql, ntp, privoxy, tor, rngd, syslog-ng, cron
Comment 7 kfm 2008-03-23 17:56:22 UTC
Thanks. For those users that are able to do so, I would like for the stock "Hardened [Gentoo]" security level to be tested with a view to ensuring that there is no adverse impact upon their respective workloads.

As noted in the help text for this level and the ewarn statements in the ebuild, this level now enables PAX_MEMORY_UDEREF by default for x86 so be sure to switch that option off if running the kernel on a VM guest (host is OK).
Comment 8 kfm 2008-03-23 18:34:38 UTC
Also, if anyone does actually test the Hardened [Gentoo] level and finds that it's a bit sluggish for their workload would they please switch to a Custom level, disable PAX_MEMORY_SANTIZE and offer some observations regarding the changes in performance, if any?
Comment 9 solar (RETIRED) gentoo-dev 2008-03-23 19:09:45 UTC
(In reply to comment #8)
> Also, if anyone does actually test the Hardened [Gentoo] level and finds that
> it's a bit sluggish for their workload would they please switch to a Custom
> level, disable PAX_MEMORY_SANTIZE and offer some observations regarding the
> changes in performance, if any?

This is what I'm doing now. I did feel a performance hit.. But just to make 
sure it's not in my mind I'll be putting this to the test under nbench and 
report results here.

Comment 10 solar (RETIRED) gentoo-dev 2008-03-23 19:45:22 UTC
benchmark results were inconclusive. Looking at the sysctl controllable value 
kernel.grsecurity.destroy_unused_shm which was probably set to =1 by the 
CONFIG_GRKERNSEC_SYSCTL_ON that was causing the performance hit.
Comment 11 cilly 2008-03-24 02:36:37 UTC
http://forums.grsecurity.net/viewtopic.php?f=3&t=1934&st=0&sk=t&sd=a&start=15

make sure CONFIG_ELF_CORE=y is set in the kernel
Comment 12 cilly 2008-03-24 16:59:02 UTC
gradm -E
You are using incompatible versions of gradm and grsecurity.
Please update both versions to the ones available on the website.
Make sure your gradm has been compiled for the kernel you are currently running.

compiled gradm against r9
Comment 13 cilly 2008-03-24 17:00:08 UTC
(In reply to comment #12)
> gradm -E
> You are using incompatible versions of gradm and grsecurity.
> Please update both versions to the ones available on the website.
> Make sure your gradm has been compiled for the kernel you are currently
> running.
> 
> compiled gradm against r9
> 

forgot version of gradm:

sys-apps/gradm-2.1.10.200702231759
Comment 14 cilly 2008-03-24 17:09:08 UTC
If marking -r9 stable, =sys-apps/gradm-2.1.11.200708011700 must be stabilized, too. Older versions of gradm do not work with -r9.
Comment 15 kfm 2008-03-24 17:45:01 UTC
Re: Comment 14, it doesn't qualify as a blocker because people who are using versions of hardened-sources/gradm keyworded stable right *now* are already affected. Therefore, it's not a regression. Nonetheless, we intend to sort it out in as soon as possible.
Comment 16 kfm 2008-03-30 16:57:36 UTC
Created attachment 147701 [details, diff]
Patch to address bug #206678
Comment 17 kfm 2008-03-30 19:08:27 UTC
Removing block on 206678. We don't want to hold up stabilisation of a mature 2.6.23 release any longer. Instead, we'll ewarn and address the matter in a better way for the 2.6.24 release.
Comment 18 kfm 2008-04-04 21:56:22 UTC
Well I ran some tests to try and determine the impact of the PAX_MEMORY_SANITIZE option. Firstly, some information about my hardware:

 System: Dell PowerEdge SC1435
    CPU: 2 x Dual-Core AMD Opteron(tm) Processor 2212 HE
    RAM: 1GB
Storage: Symbios Logic SAS1068 PCI-X Fusion-MPT SAS; 2 x Seagate 
         ST3300555SS drives (RAID1 in hardware) 

Prior to the entire process I created a dedicated 7GB logical volume to contain the kernel sources. I also ensured that the bootloader was configured to boot a 2.6.23-r9 kernel image.

For the first test, I enabled the stock "Hardened [Gentoo]" level then switched to the Custom level in order to disable PAX_MEMORY_SANITIZE. Note that I went through the correct process to ensure that no options were inadvertently changed when switching to Custom (as documented by our new help text). Furthermore, I should point out that - as the level allows for many otherwise unselected options to be enabled by the user - I was sure to wipe the portion of my .config containing any grsecurity/PaX related options beforehand, thus ensuring that the policy defined by the level was initially effected in exactly the same way as it would be if no prior .config existed at all (i.e. as it would be in the case of a new Hardened Gentoo user enabling grsecurity for the first time).

For the second test, I enabled PAX_MEMORY_SANITIZE whilst keeping all other configuration options the same, thus rendering the overall configuration completely identical to that of the "Hardened [Gentoo]" level. No more, no less.

Running in single mode was not practical. Nonetheless, I ensured that only the bare minimum of init scripts were present in the default runlevel (most notably, net.eth0 and ssh).

The testing procedure itself was as follows:

1) Created a fresh ext3 filesystem upon the volume with "mkfs -j"
2) Copied a hardened-2.6.23-r9 source tree to the filesystem
3) Configured the kernel with: make allyesconfig
4) Ran: sync && echo 3 > /proc/sys/vm/drop_caches
5) Ran: time make -j3

Now for the results:

Test #1 (+GRKERNSEC_HARDENED -PAX_MEMORY_SANITIZE)

Setup is 10808 bytes (padded to 11264 bytes).
System is 14274 kB
Kernel: arch/x86_64/boot/bzImage is ready  (#1)

real    26m34.191s
user    40m1.210s
sys     5m19.136s

Test #2 (+GRKERNSEC_HARDENED)

Setup is 10808 bytes (padded to 11264 bytes).
System is 14274 kB
Kernel: 	arch/x86_64/boot/bzImage is ready  (#1)

real    27m44.696s
user    40m12.779s
sys     7m29.820s

As can be seen, the impact upon real time is somewhat modest.

Looking at it from a subjective viewpoint, I enabled PAX_MEMORY_SANITIZE on my setup after first booting with a work-in-progress 2.6.24 patchset a few weeks ago and have not noticed any adverse effect upon my workload.

As it stands, I am not aware of any compelling data to suggest that it would be remiss to keep this option enabled in the default level.
Comment 19 kfm 2008-04-04 22:20:30 UTC
Re: Comment 10

> benchmark results were inconclusive. Looking at the sysctl controllable value 
> kernel.grsecurity.destroy_unused_shm which was probably set to =1 by the 
> CONFIG_GRKERNSEC_SYSCTL_ON that was causing the performance hit.

I concur. When the level was enabled for the first time on miranda, the prior .config options were inherited. This would have caused a considerable number of options to be enabled above and beyond those selected by the level itself. In particular, I suspect that this may have caused the logging to go nuts. This is not something that would affect a new user enabling grsecurity for the first time as the logging options that are explicitly selected are actually fairly conservative (although the user is free to do as they will, and instructions are provided as how to inherit this - in my view, sensible - default policy into the Custom level).
Comment 20 Gordon Malm (RETIRED) gentoo-dev 2008-04-04 23:12:57 UTC
Thank you for testing Kerin.  From your results the performance hit is ~4.25%, which is not that different from the 3% performance hit quoted in the help for the SANITIZE option.

Our "Hardened Gentoo" security level is supposed to be security-oriented first and foremost (while remaining compatible with the vast majority of software of course).  Since the performance hit in most circumstances is not that large and the option does not completely break any known software, my opinion is the option should stay enabled for our security level.

With this question resolved, I can see no additional blockers to 2.6.23-r9 going stable, so IMO stabilization should go forward now.
Comment 21 kfm 2008-04-07 21:09:10 UTC
Keyworded stable on x86/amd64. nixnut, would you be so kind as to endorse that the same happens for ppc/ppc64?
Comment 22 nixnut (RETIRED) gentoo-dev 2008-04-08 16:46:25 UTC
(In reply to comment #21)
> Keyworded stable on x86/amd64. nixnut, would you be so kind as to endorse that
> the same happens for ppc/ppc64?

ppc stable. can't speak for ppc64 since I don't have the hardware.
Comment 23 kfm 2008-04-08 17:09:26 UTC
I guess that covers all the platforms for which we are collectively able to perform any testing. Closing.