OSDN Git Service

io_uring: convert io_buffer_idr to XArray
authorJens Axboe <axboe@kernel.dk>
Sat, 13 Mar 2021 19:29:43 +0000 (12:29 -0700)
committerJens Axboe <axboe@kernel.dk>
Sun, 14 Mar 2021 15:56:14 +0000 (09:56 -0600)
commit9e15c3a0ced5a61f320b989072c24983cb1620c1
tree940ba0a8d0f7ea70dcbc5ee89e5f591cace325da
parent16efa4fce3b7af17bb45d635c3e89992d721e0f3
io_uring: convert io_buffer_idr to XArray

Like we did for the personality idr, convert the IO buffer idr to use
XArray. This avoids a use-after-free on removal of entries, since idr
doesn't like doing so from inside an iterator, and it nicely reduces
the amount of code we need to support this feature.

Fixes: 5a2e745d4d43 ("io_uring: buffer registration infrastructure")
Cc: stable@vger.kernel.org
Cc: Matthew Wilcox <willy@infradead.org>
Cc: yangerkun <yangerkun@huawei.com>
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c