]> git.hungrycats.org Git - linux/commit
io_uring: Fix race for sqes with userspace
authorPavel Begunkov <asml.silence@gmail.com>
Fri, 25 Oct 2019 09:31:31 +0000 (12:31 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Oct 2019 08:22:29 +0000 (09:22 +0100)
commit2da5af411f84fe26fd787202d3fe6e0423fc4216
treee8da0d4248f9524f3c17071893d2b63eba5a569e
parent2df35e87786952031ffdbd5e22828c7790102c7b
io_uring: Fix race for sqes with userspace

[ Upstream commit 935d1e45908afb8853c497f2c2bbbb685dec51dc ]

io_ring_submit() finalises with
1. io_commit_sqring(), which releases sqes to the userspace
2. Then calls to io_queue_link_head(), accessing released head's sqe

Reorder them.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/io_uring.c