Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 77666 - Kernel i386 SMP page fault handler privilege escalation (CAN-2005-0001)
Summary: Kernel i386 SMP page fault handler privilege escalation (CAN-2005-0001)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Security
Classification: Unclassified
Component: Kernel (show other bugs)
Hardware: All All
: High major
Assignee: Gentoo Security
URL: http://lists.netsys.com/pipermail/ful...
Whiteboard: [linux <2.6.11]
Keywords:
: 76818 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-01-12 05:17 UTC by Thierry Carrez (RETIRED)
Modified: 2009-05-03 14:07 UTC (History)
4 users (show)

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


Attachments
Patch against 2.6.10 (possibly others) (pagefault-race-fix.patch,2.53 KB, patch)
2005-01-12 12:17 UTC, tklauser
no flags Details | Diff
Patch against 2.4.29 (possibly others) (expand_stack-race-fix-2.4.patch,1.68 KB, patch)
2005-01-13 05:01 UTC, tklauser
no flags Details | Diff
2.6 #77094 Update (Prerequisite) (linux-2.6.10-77094.2.patch,4.92 KB, patch)
2005-01-15 14:00 UTC, Tim Yamin (RETIRED)
no flags Details | Diff
2.6 Compound Patch (linux-2.6.10-77666.patch,5.80 KB, patch)
2005-01-15 14:01 UTC, Tim Yamin (RETIRED)
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thierry Carrez (RETIRED) gentoo-dev 2005-01-12 05:17:10 UTC
Summary :

Locally  exploitable flaw has been found in the Linux page fault handler
code  that  allows  users  to  gain  root  privileges  if   running   on
multiprocessor machine.

See URL for details.
Comment 1 Thierry Carrez (RETIRED) gentoo-dev 2005-01-12 05:18:20 UTC
*** Bug 76818 has been marked as a duplicate of this bug. ***
Comment 2 tklauser 2005-01-12 12:15:18 UTC
It's fixed in Linus' BitKeeper tree:
http://linus.bkbits.net:8080/linux-2.5/cset@1.2360.3.5?nav=index.html|ChangeSet@-1d
Comment 3 tklauser 2005-01-12 12:17:23 UTC
Created attachment 48335 [details, diff]
Patch against 2.6.10 (possibly others)

Taken from BitKeeper
Comment 4 tklauser 2005-01-12 13:27:21 UTC
Marcelo fixed it in 2.4.29-rc2: http://article.gmane.org/gmane.linux.kernel/269997
Comment 6 tklauser 2005-01-13 05:01:20 UTC
Created attachment 48389 [details, diff]
Patch against 2.4.29 (possibly others)

Taken from Bitkeeper
Comment 7 tklauser 2005-01-13 05:18:29 UTC
Comment on attachment 48335 [details, diff]
Patch against 2.6.10 (possibly others)

The patch does not apply on vanilla 2.6.10 kernels. Seems to work only with
2.6.11-rc?
Comment 8 Daniel Drake (RETIRED) gentoo-dev 2005-01-13 14:09:35 UTC
This will be fixed in a new gentoo-dev-sources release that I'm just testing. Here's how I've done it:

Had to remove the patch for the RLIMIT memlock dos issue described in bug 77094
Replaced it with Linus's version,
http://dev.gentoo.org/~dsd/gentoo-dev-sources/release-10.05/dist/1130_rlimit-memlock-dos.patch

Then added our stack fix:
http://dev.gentoo.org/~dsd/gentoo-dev-sources/release-10.05/dist/1140_stack-resize.patch

Both required a rediff.

As already mentioned, I haven't tested this yet. Will get back to you in a bit whether this works ok or not.
Comment 9 Daniel Drake (RETIRED) gentoo-dev 2005-01-13 16:23:30 UTC
Having some problems booting up... It might not be this patch causing it, possibly one of the others I have added. Debugging now.
Comment 10 Adam Mondl (RETIRED) gentoo-dev 2005-01-14 01:11:31 UTC
Fixed in ~x86 hardened-dev-sources-2.6.10-r2
Comment 11 Daniel Drake (RETIRED) gentoo-dev 2005-01-14 13:31:36 UTC
The 1130 patch I referenced breaks bootup for myself... random bootup progs get killed with sig11. Investigating...
Adam, did you fix this another way?
Comment 12 Daniel Drake (RETIRED) gentoo-dev 2005-01-15 06:10:38 UTC
This patch:
http://linux.bkbits.net:8080/linux-2.6/cset@1.2273.1.9
alongside 1130 and 1140, solves it for me.
Comment 13 Tim Yamin (RETIRED) gentoo-dev 2005-01-15 14:00:00 UTC
Created attachment 48581 [details, diff]
2.6 #77094 Update (Prerequisite)
Comment 14 Tim Yamin (RETIRED) gentoo-dev 2005-01-15 14:01:25 UTC
Created attachment 48582 [details, diff]
2.6 Compound Patch
Comment 15 Tim Yamin (RETIRED) gentoo-dev 2005-01-15 14:11:22 UTC
Sidenote: For the #77094 patch (attachment #48581 [details, diff]) remove the netfilter/ip_conntrack_proto_tcp.c hunk if you are patching for kernels that are < 2.6.10...
Comment 16 Daniel Drake (RETIRED) gentoo-dev 2005-01-17 07:28:28 UTC
gentoo-dev-sources is done
Comment 17 Adam Mondl (RETIRED) gentoo-dev 2005-01-17 16:34:23 UTC
~x86 hardened-sources-2.4.28-r3 patched
Comment 18 solar (RETIRED) gentoo-dev 2005-01-18 09:39:46 UTC
CAN-2005-0001 fixed using attachment #48389 [details, diff] in >= grsec-sources-2.4.28.2.1.0-r1
Comment 19 Thierry Carrez (RETIRED) gentoo-dev 2005-03-16 03:16:33 UTC
Mass-Ccing kern-sec@gentoo.org to make sure Kernel Security guys know about all
of these...
Comment 20 Tim Yamin (RETIRED) gentoo-dev 2005-03-29 05:49:45 UTC
All fixed, closing bug.
Comment 21 Robert Buchholz (RETIRED) gentoo-dev 2009-05-03 14:07:39 UTC
commit fa6e49a2497cb4298d81c0d384c1ade8bcf1f0a3
Author: Linus Torvalds <torvalds@ppc970.osdl.org>

    Handle two threads both trying to expand their stack simultaneously.

commit 7d153fe70c171e9ea8dab7c0461d28651a44385f
Author: Linus Torvalds <torvalds@ppc970.osdl.org>

    Clean up stack growth checks and move them into a common function.

commit 092070386eaa3afc8e2375287bec98369736fc48
Author: Chris Wright <chrisw@osdl.org>

    [PATCH] acct_stack_growth nitpicks