summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSasha Levin <sasha.levin@oracle.com>2013-11-19 23:33:03 +0100
committerBenjamin LaHaise <bcrl@kvack.org>2013-11-19 23:40:48 +0100
commitddb8c45ba15149ebd41d7586261c05f7ca37f9a1 (patch)
tree2dace4cd25760745f94767308f8f846a702f828b /fs
parentaio: prevent double free in ioctx_alloc (diff)
downloadlinux-ddb8c45ba15149ebd41d7586261c05f7ca37f9a1.tar.xz
linux-ddb8c45ba15149ebd41d7586261c05f7ca37f9a1.zip
aio: nullify aio->ring_pages after freeing it
After freeing ring_pages we leave it as is causing a dangling pointer. This has already caused an issue so to help catching any issues in the future NULL it out. Signed-off-by: Sasha Levin <sasha.levin@oracle.com> Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/aio.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/aio.c b/fs/aio.c
index 63135331cec2..ad460d78d6c5 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -196,8 +196,10 @@ static void aio_free_ring(struct kioctx *ctx)
put_aio_ring_file(ctx);
- if (ctx->ring_pages && ctx->ring_pages != ctx->internal_pages)
+ if (ctx->ring_pages && ctx->ring_pages != ctx->internal_pages) {
kfree(ctx->ring_pages);
+ ctx->ring_pages = NULL;
+ }
}
static int aio_ring_mmap(struct file *file, struct vm_area_struct *vma)