diff options
author | Chengming Zhou <[email protected]> | 2023-09-08 08:57:02 +0800 |
---|---|---|
committer | Jens Axboe <[email protected]> | 2023-09-11 16:17:34 -0600 |
commit | 6be6d112419713334ddd9c01f219ca16adaa4c76 (patch) | |
tree | 18d2b39d8bd624ce27fa3779e95860aed42db0b0 /lib/test_fortify/write_overflow-strncpy-src.c | |
parent | 0bb80ecc33a8fb5a682236443c1e740d5c917d1d (diff) |
blk-mq: fix tags UAF when shrinking q->nr_hw_queues
When nr_hw_queues shrink, we free the excess tags before realloc'ing
hw_ctxs for each queue. During that resize, we may need to access those
tags, like blk_mq_tag_idle(hctx) will access queue shared tags.
This can cause a slab use-after-free, as reported by KASAN. Fix it by
moving the releasing of excess tags to the end.
Fixes: e1dd7bc93029 ("blk-mq: fix tags leak when shrink nr_hw_queues")
Reported-by: Yi Zhang <[email protected]>
Closes: https://lore.kernel.org/all/CAHj4cs_CK63uoDpGBGZ6DN4OCTpzkR3UaVgK=LX8Owr8ej2ieQ@mail.gmail.com/
Cc: Ming Lei <[email protected]>
Signed-off-by: Chengming Zhou <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strncpy-src.c')
0 files changed, 0 insertions, 0 deletions