Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 22014 - /proc error with grsecurity 1.99g + gentoo 2.4.20r5
Summary: /proc error with grsecurity 1.99g + gentoo 2.4.20r5
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: solar (RETIRED)
URL: http://forums.grsecurity.net/viewtopi...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-31 15:00 UTC by Parker Dexter
Modified: 2004-01-06 15:37 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Parker Dexter 2003-05-31 15:00:44 UTC
When /proc restrictions in grsecurity are enabled, 
access to the /proc tree is prohibited at first, 
but allowed after a few tries (being the root user).

Reproducible: Always
Steps to Reproduce:
1. try to access /proc/anything at bootup
2. access is denied, dirs are readonly
3. try a few times, with "ls /proc/sys/<tab>" or with using the full path
4. magically, the kernel allows access

Actual Results:  
# ls -la /proc/sys
-r--r--r-- 11 root root 0 May 31 17:00 /proc/sys

and one second later...

# ls -la /proc/sys
total 0
dr-xr-xr-x 11 root root 0 May 31 17:00 .
dr-xr-xr-x 128 root root 0 May 31 2003 ..
dr-xr-xr-x 2 root root 0 May 31 17:00 abi
dr-xr-xr-x 2 root root 0 May 31 17:00 debug
dr-xr-xr-x 5 root root 0 May 31 17:00 dev
dr-xr-xr-x 3 root root 0 May 31 17:00 fs
dr-xr-xr-x 4 root root 0 May 31 17:00 kernel
dr-xr-xr-x 7 root root 0 May 31 17:00 net
dr-xr-xr-x 2 root root 0 May 31 17:00 proc
dr-xr-xr-x 2 root root 0 May 31 17:00 sched
dr-xr-xr-x 2 root root 0 May 31 17:00 vm 

Expected Results:  
allow access in the first place.

i enabled /proc restrictions, my .config contains

#
# Filesystem Protections
#
CONFIG_GRKERNSEC_PROC=y
CONFIG_GRKERNSEC_PROC_USER=y
Comment 1 solar (RETIRED) gentoo-dev 2003-06-06 05:29:43 UTC
I've just run into this bug myself when using the acl features of grsecurity.

/proc/mounts was hidden per my acl setup.
/etc/fstab hidden
/etc/mtab hidden

I typed mount and noticed I was able to see my mounts when they should be hidden.
I then ran "strace -eopen mount" and saw the open("/proc/mounts", succeed

Tested gentoo-hardened-r2(grsecuirty-1.9.9g) and my files were hidden as expected.

This is a serious security flaw and should be fixed right away.

Tests not preformed vanilla kernel with grsecurity-1.9.9h.

Note: There was recent security fix for grsecurity ALSR leakage. (I think this is what we are encountering)
--
Comment 2 solar (RETIRED) gentoo-dev 2003-06-11 07:29:18 UTC
This bug seems to be present in grsecurity out of the box.

Downloaded linux-2.4.20.tar.gz, grsecurity-1.9.9h.patch (No other patches at all)
Recompiled and tested. Got the same results so I emailing spender (Grsecuirty Author) explaining this.
Comment 3 solar (RETIRED) gentoo-dev 2003-06-11 07:39:17 UTC
spender mail server is broke or rejecting mail.
Will try again later.
Comment 4 solar (RETIRED) gentoo-dev 2003-08-29 23:02:20 UTC
This should be fixed in gentoo-sources-2.4.20-r6 also note we have grsec-sources now in portage which will try to keep current to Brad's code upstream
Comment 5 Dave Liefbroer 2003-10-20 12:14:06 UTC
Tried with gentoo-sources-r7 still the same problem, /proc/sys is not accessible.
After a while (sorry can't define the time) it is accessible.
Comment 6 solar (RETIRED) gentoo-dev 2003-10-20 15:50:15 UTC
/proc/sys is not accessible to root?

Best thing I can say here is give grsec-sources a try..
If the problem exists still then we have a grsec problems vs a gentoo one.
If the problem goes away then the best I can do here is to make a fuss with
our current gentoo-sources maintainers.
Comment 7 solar (RETIRED) gentoo-dev 2003-11-28 14:55:47 UTC
Please use an updated sources.
Comment 8 solar (RETIRED) gentoo-dev 2003-12-24 17:33:16 UTC
Can anybody confirm if this is happening with a vanilla grsec-sources or is/was this happening only in the gentoo-sources?
Comment 9 solar (RETIRED) gentoo-dev 2004-01-06 15:37:10 UTC
changing resolution to WORKSFORSOME