Message ID | 20210923134631.105719-5-yukuai3@huawei.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | fix uaf in rq_qos_done_io() | expand |
diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c index c0545f9da549..f3b8848e6a46 100644 --- a/block/blk-iolatency.c +++ b/block/blk-iolatency.c @@ -648,10 +648,18 @@ static void blkcg_iolatency_exit(struct rq_qos *rqos) kfree(blkiolat); } +static void blkcg_iolatency_free(struct rq_qos *rqos) +{ + struct blk_iolatency *blkiolat = BLKIOLATENCY(rqos); + + kfree(blkiolat); +} + static struct rq_qos_ops blkcg_iolatency_ops = { .throttle = blkcg_iolatency_throttle, .done_bio = blkcg_iolatency_done_bio, .exit = blkcg_iolatency_exit, + .free = blkcg_iolatency_free, }; static void blkiolatency_timer_fn(struct timer_list *t)
Prepare to split 'kfree(blkiolat)' from blkcg_iolatency_exit(), no functional changes. Signed-off-by: Yu Kuai <yukuai3@huawei.com> --- block/blk-iolatency.c | 8 ++++++++ 1 file changed, 8 insertions(+)