Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 119087 - Fix double decrement of mqueue_mnt->mnt_count in sys_mq_open (CVE-2005-3356)
Summary: Fix double decrement of mqueue_mnt->mnt_count in sys_mq_open (CVE-2005-3356)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Security
Classification: Unclassified
Component: Kernel (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Security
URL: http://kernel.org/git/?p=linux/kernel...
Whiteboard: [linux < 2.6.15.2]
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-15 06:24 UTC by Sune Kloppenborg Jeppesen (RETIRED)
Modified: 2009-05-03 16:01 UTC (History)
5 users (show)

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


Attachments
fix-double-decrement-in-sys_mq_open.patch (fix-double-decrement-in-sys_mq_open.patch,2.60 KB, patch)
2006-01-15 20:30 UTC, kfm
no flags Details | Diff
fix-double-decrement-in-sys_mq_open.patch (inc. git header) (fix-double-decrement-in-sys_mq_open.patch,3.71 KB, patch)
2006-01-15 20:35 UTC, kfm
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2006-01-15 06:24:20 UTC
From: Alexander Viro <aviro@redhat.com>
Date: Sat, 14 Jan 2006 20:29:55 +0000 (-0500)
Subject: [PATCH] Fix double decrement of mqueue_mnt->mnt_count in sys_mq_open
X-Git-Url: http://kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=7c7dce9209161eb260cdf9e9172f72c3a02379e6

[PATCH] Fix double decrement of mqueue_mnt->mnt_count in sys_mq_open

Fixed the refcounting on failure exits in sys_mq_open() and
cleaned the logics up.  Rules are actually pretty simple - dentry_open()
expects vfsmount and dentry to be pinned down and it either transfers
them into created struct file or drops them.  Old code had been very
confused in that area - if dentry_open() had failed either in do_open()
or do_create(), we ended up dentry and mqueue_mnt dropped twice, once
by dentry_open() cleanup and then by sys_mq_open().

Fix consists of making the rules for do_create() and do_open()
same as for dentry_open() and updating the sys_mq_open() accordingly;
that actually leads to more straightforward code and less work on
normal path.

Signed-off-by: Al Viro <aviro@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Comment 1 Tim Yamin (RETIRED) gentoo-dev 2006-01-15 06:57:41 UTC
CCing maintainers:

ck-sources-2.6: marineam
gentoo-sources-2.6: dsd
hardened-sources-2.6: kerframil/hardened
hppa-sources-2.6: GMSoft
mips-sources-2.6: Kumba
rsbac-sources-2.6: kang
suspend2-sources-2.6: brix
xbox-sources-2.6: gimli
Comment 2 kfm 2006-01-15 20:30:06 UTC
Created attachment 77224 [details, diff]
fix-double-decrement-in-sys_mq_open.patch

Patch. Applies against 2.6.14 and 2.6.15 (not sure about earlier versions).
Comment 3 kfm 2006-01-15 20:35:07 UTC
Created attachment 77226 [details, diff]
fix-double-decrement-in-sys_mq_open.patch (inc. git header)

Revision. Exactly the same, just added the git header stuff and commit message at the top.
Comment 4 Guy Martin (RETIRED) gentoo-dev 2006-01-16 08:16:49 UTC
hppa-sources-2.6.15.1_p4 in CVS.
Comment 5 Daniel Drake (RETIRED) gentoo-dev 2006-01-31 15:49:58 UTC
Fixed in gentoo-sources-2.6.15-r2 (genpatches-2.6.15-4) and Linux 2.6.15.2
Comment 6 kfm 2006-02-01 10:23:43 UTC
Fixed in hardened-sources-2.6.15-r5 and genpatches-2.6.14-10.
Comment 7 Henrik Brix Andersen 2006-02-02 04:34:18 UTC
Fixed in suspend2-sources-2.6.15-r5.
Comment 8 Tim Yamin (RETIRED) gentoo-dev 2006-04-20 10:54:56 UTC
All fixed now, thanks!