src/setup: fix io_uring_alloc_huge() underestimating required memory

It doesn't factor in the indexes themselves, so depending on the ring
sizes, we may end up undershooting slightly. This can cause the
returned value to be 64 bytes less than what is required. If an
application is packing things in tight, then that in turn can cause the
assumed ring memory to spill into the next part of that memory, causing
corruption of anything stored there.

We may overshoot with the current code depending on ring sizes, but
at least that's better then undershooting and causing corruption...

Link: https://github.com/axboe/liburing/issues/1151
Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 file changed