diff options
author | 2020-02-04 19:54:55 -0700 | |
---|---|---|
committer | 2020-02-04 20:04:18 -0700 | |
commit | 2faf852d1be8a4960d328492298da6448cca0279 (patch) | |
tree | ebbae989219154e27a95c4558f201202a5fe0681 /drivers/media/common/videobuf2/videobuf2-dma-sg.c | |
parent | io_uring: spin for sq thread to idle on shutdown (diff) | |
download | linux-dev-2faf852d1be8a4960d328492298da6448cca0279.tar.xz linux-dev-2faf852d1be8a4960d328492298da6448cca0279.zip |
io_uring: cleanup fixed file data table references
syzbot reports a use-after-free in io_ring_file_ref_switch() when it
tries to switch back to percpu mode. When we put the final reference to
the table by calling percpu_ref_kill_and_confirm(), we don't want the
zero reference to queue async work for flushing the potentially queued
up items. We currently do a few flush_work(), but they merely paper
around the issue, since the work item may not have been queued yet
depending on the when the percpu-ref callback gets run.
Coming into the file unregister, we know we have the ring quiesced.
io_ring_file_ref_switch() can check for whether or not the ref is dying
or not, and not queue anything async at that point. Once the ref has
been confirmed killed, flush any potential items manually.
Reported-by: syzbot+7caeaea49c2c8a591e3d@syzkaller.appspotmail.com
Fixes: 05f3fb3c5397 ("io_uring: avoid ring quiesce for fixed file set unregister and update")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/media/common/videobuf2/videobuf2-dma-sg.c')
0 files changed, 0 insertions, 0 deletions