提交 ddb8c45b 编写于 作者: S Sasha Levin 提交者: Benjamin LaHaise

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: NSasha Levin <sasha.levin@oracle.com>
Signed-off-by: NBenjamin LaHaise <bcrl@kvack.org>
上级 d5580232
...@@ -196,8 +196,10 @@ static void aio_free_ring(struct kioctx *ctx) ...@@ -196,8 +196,10 @@ static void aio_free_ring(struct kioctx *ctx)
put_aio_ring_file(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); kfree(ctx->ring_pages);
ctx->ring_pages = NULL;
}
} }
static int aio_ring_mmap(struct file *file, struct vm_area_struct *vma) static int aio_ring_mmap(struct file *file, struct vm_area_struct *vma)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册