Jens Axboe eaef83c4c0 eventfd: track eventfd_signal() recursion depth
commit b5e683d5cab8cd433b06ae178621f083cabd4f63 upstream.

eventfd use cases from aio and io_uring can deadlock due to circular
or resursive calling, when eventfd_signal() tries to grab the waitqueue
lock. On top of that, it's also possible to construct notification
chains that are deep enough that we could blow the stack.

Add a percpu counter that tracks the percpu recursion depth, warn if we
exceed it. The counter is also exposed so that users of eventfd_signal()
can do the right thing if it's non-zero in the context where it is
called.

Cc: stable@vger.kernel.org # 4.19+
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-11 04:34:08 -08:00
..
2019-08-06 19:06:51 +02:00
2019-12-13 08:52:23 +01:00
2019-12-17 20:35:18 +01:00
2019-12-13 08:52:36 +01:00
2020-02-11 04:34:07 -08:00
2018-08-17 16:20:28 -07:00
2019-12-13 08:51:59 +01:00
2020-01-09 10:19:03 +01:00
2018-08-17 16:20:27 -07:00
2018-08-18 11:44:53 -07:00
2019-05-02 09:58:59 +02:00
2018-07-03 16:44:45 -04:00
2018-08-21 18:19:09 -07:00
2020-02-05 14:43:31 +00:00