summaryrefslogtreecommitdiffstats
path: root/fs/aio.c
diff options
context:
space:
mode:
authorSasha Levin2013-11-19 23:33:02 +0100
committerBenjamin LaHaise2013-11-19 23:40:48 +0100
commitd558023207e008a4476a3b7bb8706b2a2bf5d84f (patch)
tree3099defaf443113295568a51fe6bbab72b34542c /fs/aio.c
parentMerge branch 'aio-fix' of http://evilpiepirate.org/git/linux-bcache (diff)
downloadkernel-qcow2-linux-d558023207e008a4476a3b7bb8706b2a2bf5d84f.tar.gz
kernel-qcow2-linux-d558023207e008a4476a3b7bb8706b2a2bf5d84f.tar.xz
kernel-qcow2-linux-d558023207e008a4476a3b7bb8706b2a2bf5d84f.zip
aio: prevent double free in ioctx_alloc
ioctx_alloc() calls aio_setup_ring() to allocate a ring. If aio_setup_ring() fails to do so it would call aio_free_ring() before returning, but ioctx_alloc() would call aio_free_ring() again causing a double free of the ring. This is easily reproducible from userspace. Signed-off-by: Sasha Levin <sasha.levin@oracle.com> Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>
Diffstat (limited to 'fs/aio.c')
-rw-r--r--fs/aio.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/fs/aio.c b/fs/aio.c
index ee77dc13d5b2..63135331cec2 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -610,7 +610,6 @@ static struct kioctx *ioctx_alloc(unsigned nr_events)
err_cleanup:
aio_nr_sub(ctx->max_reqs);
err:
- aio_free_ring(ctx);
free_percpu(ctx->cpu);
free_percpu(ctx->reqs.pcpu_count);
free_percpu(ctx->users.pcpu_count);