aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorSasha Levin <sasha.levin@oracle.com>2013-11-19 17:33:02 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-08 07:29:16 -0800
commitf50db974cb75e31d98b176c3c9ea92e57aa97a1b (patch)
treef981c68850a5389e4c8f735a4111e1e1f675c496 /fs
parent603f89ac73b7f286d3fdbc26db0ada25b06bd333 (diff)
aio: prevent double free in ioctx_alloc
commit d558023207e008a4476a3b7bb8706b2a2bf5d84f upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/aio.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/fs/aio.c b/fs/aio.c
index fff5db091e7..f4103b3634c 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -661,7 +661,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);