]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: don't touch ctx in setup after ring fd install
authorJens Axboe <axboe@kernel.dk>
Mon, 28 Oct 2019 15:15:33 +0000 (09:15 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 28 Oct 2019 15:15:33 +0000 (09:15 -0600)
commit98262e4c7bf5891763c5bd8812b6578e7a2d52c5
tree25b1ccdca5d8d48a99f2370144f797f56754866a
parent45679d12ab9b58bd2b0f03813fceea5daa0ebe8c
io_uring: don't touch ctx in setup after ring fd install

syzkaller reported an issue where it looks like a malicious app can
trigger a use-after-free of reading the ctx ->sq_array and ->rings
value right after having installed the ring fd in the process file
table.

Defer ring fd installation until after we're done reading those
values.

Fixes: e520227a8307 ("io_uring: allocate the two rings together")
Reported-by: syzbot+6f03d895a6cd0d06187f@syzkaller.appspotmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c