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/query: prevent infinite loops

If the query chain forms a cycle, the interface will loop indefinitely.
Make sure it handles fatal signals, so the user can kill the process and
hence break out of the infinite loop.

Fixes: c265ae75f900 ("io_uring: introduce io_uring querying")
Reported-by: Jens Axboe <axboe@kernel.dk>
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
2408d178 31bf77dc

+4
+4
io_uring/query.c
··· 88 88 if (ret) 89 89 return ret; 90 90 uhdr = u64_to_user_ptr(next_hdr); 91 + 92 + if (fatal_signal_pending(current)) 93 + return -EINTR; 94 + cond_resched(); 91 95 } 92 96 return 0; 93 97 }