io_uring: fix sq array offset calculation
authorDmitry Vyukov <dvyukov@google.com>
Sat, 11 Jul 2020 09:31:11 +0000 (11:31 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:23:31 +0000 (08:23 +0200)
commite5b6175966e754ed66bfb52fa42ec5f53708734d
treedb957c2d778bbed8a30f04f373572efa93dc1fb4
parentcfd61b6121f9a9f5be53b7365c182bfc36296dcd
io_uring: fix sq array offset calculation

[ Upstream commit b36200f543ff07a1cb346aa582349141df2c8068 ]

rings_size() sets sq_offset to the total size of the rings (the returned
value which is used for memory allocation). This is wrong: sq array should
be located within the rings, not after them. Set sq_offset to where it
should be.

Fixes: 75b28affdd6a ("io_uring: allocate the two rings together")
Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
Acked-by: Hristo Venev <hristo@venev.name>
Cc: io-uring@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/io_uring.c