This is a note to let you know that I've just added the patch titled

    aio: nullify aio->ring_pages after freeing it

to the 3.12-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     aio-nullify-aio-ring_pages-after-freeing-it.patch
and it can be found in the queue-3.12 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From ddb8c45ba15149ebd41d7586261c05f7ca37f9a1 Mon Sep 17 00:00:00 2001
From: Sasha Levin <[email protected]>
Date: Tue, 19 Nov 2013 17:33:03 -0500
Subject: aio: nullify aio->ring_pages after freeing it

From: Sasha Levin <[email protected]>

commit ddb8c45ba15149ebd41d7586261c05f7ca37f9a1 upstream.

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 <[email protected]>
Signed-off-by: Benjamin LaHaise <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 fs/aio.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/fs/aio.c
+++ b/fs/aio.c
@@ -251,8 +251,10 @@ static void aio_free_ring(struct kioctx
 
        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)


Patches currently in stable-queue which might be from [email protected] are

queue-3.12/aio-prevent-double-free-in-ioctx_alloc.patch
queue-3.12/aio-nullify-aio-ring_pages-after-freeing-it.patch
queue-3.12/video-kyro-fix-incorrect-sizes-when-copying-to-userspace.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to