Re: [PATCH backport 5.10] io_uring: close a small race gap for files cancel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Dec 29, 2020 at 04:35:49AM +0000, Pavel Begunkov wrote:
> commit dfea9fce29fda6f2f91161677e0e0d9b671bc099 upstream.
> 
> The purpose of io_uring_cancel_files() is to wait for all requests
> matching ->files to go/be cancelled. We should first drop files of a
> request in io_req_drop_files() and only then make it undiscoverable for
> io_uring_cancel_files.
> 
> First drop, then delete from list. It's ok to leave req->id->files
> dangling, because it's not dereferenced by cancellation code, only
> compared against. It would potentially go to sleep and be awaken by
> following in io_req_drop_files() wake_up().
> 
> Fixes: 0f2122045b946 ("io_uring: don't rely on weak ->files references")
> Cc: <stable@xxxxxxxxxxxxxxx> # 5.5+
> Signed-off-by: Pavel Begunkov <asml.silence@xxxxxxxxx>
> Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
> ---
>  fs/io_uring.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Now applied, thanks.

greg k-h



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux