]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: prevent potential eventfd recursion on poll
authorJens Axboe <axboe@kernel.dk>
Sun, 2 Feb 2020 04:30:11 +0000 (21:30 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 4 Feb 2020 00:27:47 +0000 (17:27 -0700)
commit955b3d00c9c0f30a5bf908f04bf4dba3cf952140
treee1b2bdd95a1b37cb4563a798a18ace70a2a1cd80
parent606654d54a2cc543248878fa42c0877eeffec234
io_uring: prevent potential eventfd recursion on poll

If we have nested or circular eventfd wakeups, then we can deadlock if
we run them inline from our poll waitqueue wakeup handler. It's also
possible to have very long chains of notifications, to the extent where
we could risk blowing the stack.

Check the eventfd recursion count before calling eventfd_signal(). If
it's non-zero, then punt the signaling to async context. This is always
safe, as it takes us out-of-line in terms of stack and locking context.

Cc: stable@vger.kernel.org # 5.1+
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c