]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: fix use-after-free of shadow_req
authorJackie Liu <liuyun01@kylinos.cn>
Wed, 18 Sep 2019 02:37:53 +0000 (10:37 +0800)
committerJens Axboe <axboe@kernel.dk>
Wed, 18 Sep 2019 17:19:06 +0000 (11:19 -0600)
commite331cfc5a61bd1512b599fd7c47adb82d41203d3
tree61705cf47d7f410ec0ef56c550c12462e92a9d60
parent9426b3efe20767dfa8aa723c1e060f1fe825ae10
io_uring: fix use-after-free of shadow_req

There is a potential dangling pointer problem. we never clean
shadow_req, if there are multiple link lists in this series of
sqes, then the shadow_req will not reallocate, and continue to
use the last one. but in the previous, his memory has been
released, thus forming a dangling pointer. let's clean up him
and make sure that every new link list can reapply for a new
shadow_req.

Fixes: c3e32a449b8c ("io_uring: add support for link with drain")
Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c