summaryrefslogtreecommitdiff
path: root/ipc
diff options
context:
space:
mode:
authorAndré Goddard Rosa <andre.goddard@gmail.com>2010-02-23 04:04:28 -0300
committerGreg Kroah-Hartman <gregkh@suse.de>2010-04-01 15:58:18 -0700
commitcdaab88937d2dbbeb27e4b837abf5d3206ddc1ec (patch)
treec9e3518af41a78411ff598d452c8a4efc4e63939 /ipc
parent0dcc9985f34aef3c60bffab3dfc7f7ba3748f35a (diff)
mqueue: fix mq_open() file descriptor leak on user-space processes
commit 4294a8eedb17bbc45e1e7447c2a4d05332943248 upstream. We leak fd on lookup_one_len() failure Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'ipc')
-rw-r--r--ipc/mqueue.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index ee9d69707c0a..d01bc14a9b37 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -706,7 +706,7 @@ SYSCALL_DEFINE4(mq_open, const char __user *, u_name, int, oflag, mode_t, mode,
dentry = lookup_one_len(name, ipc_ns->mq_mnt->mnt_root, strlen(name));
if (IS_ERR(dentry)) {
error = PTR_ERR(dentry);
- goto out_err;
+ goto out_putfd;
}
mntget(ipc_ns->mq_mnt);
@@ -744,7 +744,6 @@ out:
mntput(ipc_ns->mq_mnt);
out_putfd:
put_unused_fd(fd);
-out_err:
fd = error;
out_upsem:
mutex_unlock(&ipc_ns->mq_mnt->mnt_root->d_inode->i_mutex);