]> git.baikalelectronics.ru Git - kernel.git/commit
aio: prevent double free in ioctx_alloc
authorSasha Levin <sasha.levin@oracle.com>
Tue, 19 Nov 2013 22:33:02 +0000 (17:33 -0500)
committerBenjamin LaHaise <bcrl@kvack.org>
Tue, 19 Nov 2013 22:40:48 +0000 (17:40 -0500)
commit53d3c125c05bf2aac4e9e3969e5e329a31d064a2
tree3099defaf443113295568a51fe6bbab72b34542c
parent238bf21049caab019e12e8bb17da1871c27b1ef9
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>
fs/aio.c