Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring: check for user passing 0 nr_submit

io_submit_sqes() shouldn't be stepping into its main loop when there is
nothing to submit, i.e. nr=0. Fix 0 submission queue entries checks,
which should follow after all user input truncations.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Pavel Begunkov and committed by
Jens Axboe
dde92a50 1cba30bf

+3 -2
+3 -2
io_uring/io_uring.c
··· 2453 2453 unsigned int left; 2454 2454 int ret; 2455 2455 2456 + entries = min(nr, entries); 2456 2457 if (unlikely(!entries)) 2457 2458 return 0; 2458 - /* make sure SQ entry isn't read before tail */ 2459 - ret = left = min(nr, entries); 2459 + 2460 + ret = left = entries; 2460 2461 io_get_task_refs(left); 2461 2462 io_submit_state_start(&ctx->submit_state, left); 2462 2463