+9
−4
Loading
stable inclusion from stable-v6.6.72 commit 8efff2aa2d95dc437ab67c5b4a9f1d3f367baa10 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IBQN9L Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=8efff2aa2d95dc437ab67c5b4a9f1d3f367baa10 -------------------------------- Commit c9a40292a44e78f71258b8522655bffaf5753bdb upstream. io_eventfd_do_signal() is invoked from an RCU callback, but when dropping the reference to the io_ev_fd, it calls io_eventfd_free() directly if the refcount drops to zero. This isn't correct, as any potential freeing of the io_ev_fd should be deferred another RCU grace period. Just call io_eventfd_put() rather than open-code the dec-and-test and free, which will correctly defer it another RCU grace period. Fixes: 21a091b9 ("io_uring: signal registered eventfd to process deferred task work") Reported-by:Jann Horn <jannh@google.com> Cc: stable@vger.kernel.org Signed-off-by:
Jens Axboe <axboe@kernel.dk> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Wen Zhiwei <wenzhiwei@kylinos.cn>