• J
    eventfd: track eventfd_signal() recursion depth · c1910c45
    Jens Axboe 提交于
    stable inclusion
    from linux-4.19.103
    commit eaef83c4c0cb8c82ab7cea99479d49d35a5cd25d
    
    --------------------------------
    
    commit b5e683d5 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: NJens Axboe <axboe@kernel.dk>
    Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
    c1910c45
eventfd.h 2.0 KB