]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
[PATCH] Fix double decrement of mqueue_mnt->mnt_count in sys_mq_open (CVE-2005-3356)
authorAlexander Viro <aviro@redhat.com>
Sat, 14 Jan 2006 20:29:55 +0000 (15:29 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 31 Jan 2006 06:13:17 +0000 (22:13 -0800)
commit1518d0b7a1ab6465487491c374bd18df6a4c036b
tree164ce6aca1622cd7761e8c964b5a89f5b1516384
parentad9ed6ca1b9f075a668a54c85ca5e706c19427a1
[PATCH] Fix double decrement of mqueue_mnt->mnt_count in sys_mq_open (CVE-2005-3356)

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>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
ipc/mqueue.c