A certain Fedora patch for the utrace subsystem in the Linux kernel before 2.6.26.5-28 on Fedora 8, and before 2.6.26.5-45 on Fedora 9, allows local users to cause a denial of service (NULL pointer dereference and system crash or hang) via a call to the utracecontrol function.
Double free vulnerability in the utrace support in the Linux kernel, probably 2.6.18, in Red Hat Enterprise Linux (RHEL) 5 and Fedora Core 6 (FC6) allows local users to cause a denial of service (oops), as demonstrated by a crash when running the GNU GDB testsuite, a different vulnerability than CVE-2008-2365.
Description of problem:
Alexei Dobryanov has reported the following kernel utrace related issue (BZ#245735):
1. late ptracemayattach() check
static int ptraceattach(struct taskstruct task) { ... engine = utraceattach(task, (UTRACEATTACHCREATE | UTRACEATTACHEXCLUSIVE | UTRACEATTACHMATCHOPS), &ptraceutraceops, 0); [error checking] if (ptracemayattach(task)) { [more attaching process]
Doing may attach check there is asking for trouble, because utraceattach() will happily create and modify "struct utrace " and create and attach engines to it on task you don't have permissions. Order should be reverted. That's easy.
2. race around &deadengineops setting...
I originally thought #1 would lead to memory leaks, however, written dumb PTRACEATTACH'er gave much more amazing results.
The following program quickly (1 sec) oopses kernel when run against process you normally can't attach to (like normal user to getty processes)
#include <stdlib.h> #include <sys/ptrace.h>
int main(int argc, char argv[]) { pidt pid = atoi(argv[1]);
while (1) ptrace(PTRACEATTACH, pid, NULL, NULL);
return 0; }
Unable to handle kernel NULL pointer dereference at 0000000000000000 RIP: [<0000000000000000>] [<ffffffff8005f1cd>] reportquiescent+0x36/0x154 [<ffffffff8005f316>] utracequiescent+0x2b/0x238 [<ffffffff800601e9>] utracegetsignal+0x45d/0x4c0 [<ffffffff80039c6f>] getsignaltodeliver+0x169/0x47a [<ffffffff80008f5a>] donotifyresume+0xd0/0x7e2 [<ffffffff80203673>] spinunlockirqrestore+0x3f/0x45 [<ffffffff80051d71>] tracehardirqson+0x11b/0x13f [<ffffffff801400c0>] ttyread+0x81/0xc7 [<ffffffff80202ede>] tracehardirqsonthunk+0x35/0x37 [<ffffffff80051d71>] tracehardirqson+0x11b/0x13f [<ffffffff80009b43>] sysretsignal+0x21/0x31 [<ffffffff80009deb>] ptregscallcommon+0x67/0xac
This is a race we chatted with Roland about: http://marc.info/?l=linux-kernel&m=117863520707703&w=2
engine's flags and ops settings in utracedetach() and acting on them in reportquiescent():
utracedetach() reportquiescent() --------------- ------------------ [utrace lock held] [utrace lock is not held]
engine->flags = UTRACEEVENT(QUIESCE) | UTRACEACTIONQUIESCE;
if (engine->flags & UTRACEEVENT(QUIESCE)) REPORT(reportquiesce);
rcuassignpointer(engine->ops, &deadengineops);
At the moment of REPORT call engine's ops are still "live" ptrace ops which do not have ->reportquiesce callback. So, there will oops while calling function at NULL address. "Dead" ptrace engine ops do have dummy callback but it wasn't yet glued.
Obviously, patch #1 won't fix this.
3. Looks like nobody filed double free at utrace aka oops at rcuprocesscallbacks() against RHEL5 kernel.
It's bug https://bugzilla.redhat.com/bugzilla/showbug.cgi?id=207002 against FC6, but, hey, every utrace version has it. Test program attached. Every user can trigger it.
Description of problem: Name: CVE-2009-4306 Status: Candidate URL: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-4306 Final-Decision: Interim-Decision: Modified: Proposed: Assigned: 20091212 Category: Reference: MISC:http://grsecurity.org/test/grsecurity-2.1.14-2.6.32-200912112157.patch Reference: MISC:http://twitter.com/fotisl/statuses/6568947714 Reference: MISC:http://twitter.com/spendergrsec/statuses/6551797457 Reference: MISC:http://twitter.com/spendergrsec/statuses/6567167692 Reference: MISC:http://twitter.com/spendergrsec/statuses/6569596339 Reference: MISC:http://twitter.com/spendergrsec/statuses/6572069107 Reference: MISC:http://twitter.com/spendergrsec/statuses/6583954567 Reference: MISC:http://twitter.com/tytso/statuses/6571730411
Unspecified vulnerability in the EXT4IOCMOVEEXT (aka move extents) ioctl implementation in the ext4 filesystem in the Linux kernel 2.6.32-git6 and earlier allows local users to cause a denial of service (filesystem corruption) via unknown vectors, a different vulnerability than CVE-2009-4131.
The dommappgoff function in mm/nommu.c in the Linux kernel before 2.6.31.6, when the CPU lacks a memory management unit, allows local users to cause a denial of service (OOPS) via an application that attempts to allocate a large amount of memory.
The updatecr8intercept function in arch/x86/kvm/x86.c in the KVM subsystem in the Linux kernel before 2.6.32-rc1 does not properly handle the absence of an Advanced Programmable Interrupt Controller (APIC), which allows local users to cause a denial of service (NULL pointer dereference and system crash) or possibly gain privileges via a call to the kvmvcpuioctl function.
The getinstantiationkeyring function in security/keys/keyctl.c in the KEYS subsystem in the Linux kernel before 2.6.32-rc5 does not properly maintain the reference count of a keyring, which allows local users to gain privileges or cause a denial of service (OOPS) via vectors involving calls to this function without specifying a keyring by ID, as demonstrated by a series of keyctl request2 and keyctl list commands.
The ttyldischangup function in drivers/char/ttyldisc.c in the Linux kernel 2.6.31-rc before 2.6.31-rc8 allows local users to cause a denial of service (system crash, sometimes preceded by a NULL pointer dereference) or possibly gain privileges via certain pseudo-terminal I/O activity, as demonstrated by KernelTtyTest.c.
Description of problem: OpenVZ linux kernel team has found deadlock between ptrace and coredump code, no root privileges required.
2.6.18-128.1.10.el5 affected, exploit in attach.
--- SysRq-T trace:
explzap3 R ffff81003fa6cd70 0 8645 10409 8646 (NOTLB) 0000000000000068 ffffffff8006358b ffff81007e13f980 0000000000000000 ffff81003fa6cd70 ffff81003fa6cd70 0000013e867d5d52 0000027bcf133f75 ffff81003fa6cf80 ffffffff8046b780 ffffffff802fa680 ffff81003d0f1ec8 Call Trace: [<ffffffff8006358b>] schedtextstart+0x11b/0xfcb [<ffffffff800863c2>] taskrqlock+0x26/0x45 [<ffffffff80088be2>] sysschedyield+0xb1/0xb8 [<ffffffff800c8fa8>] ptracestart+0x3bd/0x465 [<ffffffff80029223>] dowait+0xafd/0xb99 [<ffffffff800c9cfb>] sysptrace+0x48/0x1f7 [<ffffffff80060477>] ptregscallcommon+0x67/0xac [<ffffffff80060166>] systemcall+0x7e/0x83
explzap3 D ffff81007ff395c0 0 8647 8645 8646 (NOTLB) ffff81007f6abc58 0000000000000086 0000000000000006 ffff81007b944c30 ffff81007ff395c0 ffff81007ff33500 0000004ed2555339 0000009d55ffa665 ffff81007ff397c8 ffffffff8046b780 0000004ed2554f5e ffff81007ff33500 Call Trace: [<ffffffff80086900>] activatetask+0x92/0x157 [<ffffffff800492ac>] trytowakeup+0x3ce/0x3e0 [<ffffffff80064691>] waitforcompletion+0x79/0xa2 [<ffffffff80088417>] defaultwakefunction+0x0/0xe [<ffffffff800ecbb5>] docoredump+0x341/0x8a1 [<ffffffff800a32e5>] ubslabuncharge+0xd0/0xdb [<ffffffff800a3493>] doubsiginfouncharge+0x42/0x55 [<ffffffff80096391>] recalcsigpending+0xe/0x25 [<ffffffff8002c00a>] getsignaltodeliver+0x434/0x46b [<ffffffff8005d8f6>] donotifyresume+0xd0/0x7e3 [<ffffffff80096f63>] groupsendsiginfo+0x89/0x94 [<ffffffff8005d26a>] groupsendsiginfo+0x76/0x83 [<ffffffff80088a0d>] vcpuput+0x8e/0x16e [<ffffffff8004ea1d>] syskill+0x19f/0x1b2 [<ffffffff80088a0d>] vcpuput+0x8e/0x16e [<ffffffff800601ef>] sysretsignal+0x1c/0x27 [<ffffffff80060477>] ptregscallcommon+0x67/0xac