Searched hist:b13015af94cf405f73ff64ce0797269554020c37 (Results 1 – 1 of 1) sorted by relevance
/linux/drivers/md/ |
H A D | raid5-cache.c | diff b13015af94cf405f73ff64ce0797269554020c37 Wed Jun 08 18:27:52 CEST 2022 Logan Gunthorpe <logang@deltatee.com> md/raid5-cache: Clear conf->log after finishing work
A NULL pointer dereferlence on conf->log is seen randomly with the mdadm test 21raid5cache. Kasan reporst:
BUG: KASAN: null-ptr-deref in r5l_reclaimable_space+0xf5/0x140 Read of size 8 at addr 0000000000000860 by task md0_reclaim/3086
Call Trace: dump_stack_lvl+0x5a/0x74 kasan_report.cold+0x5f/0x1a9 __asan_load8+0x69/0x90 r5l_reclaimable_space+0xf5/0x140 r5l_do_reclaim+0xf4/0x5e0 r5l_reclaim_thread+0x69/0x3b0 md_thread+0x1a2/0x2c0 kthread+0x177/0x1b0 ret_from_fork+0x22/0x30
This is caused by conf->log being cleared in r5l_exit_log() before stopping the reclaim thread.
To fix this, clear conf->log after the reclaim_thread is unregistered and after flushing disable_writeback_work.
Signed-off-by: Logan Gunthorpe <logang@deltatee.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Song Liu <song@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
|