Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ovl: fix use after free in struct ovl_aio_req
Example for triggering use after free in a overlay on ext4 setup: aio_read ovl_read_iter vfs_iter_read ext4_file_read_iter ext4_dio_read_iter iomap_dio_rw -> -EIOCBQUEUED /* * Here IO is completed in a separate thread, * ovl_aio_cleanup_handler() frees aio_req which has iocb embedded */ file_accessed(iocb->ki_filp); /**BOOM**/ Fix by introducing a refcount in ovl_aio_req similarly to aio_kiocb. This guarantees that iocb is only freed after vfs_read/write_iter() returns on underlying fs. Fixes: 2406a30 ("ovl: implement async IO routines") Signed-off-by: yangerkun <[email protected]> Link: https://lore.kernel.org/r/[email protected]/ Cc: <[email protected]> # v5.6 Signed-off-by: Miklos Szeredi <[email protected]>
- Loading branch information