Yu Kuai
0d0bd28c50
md/raid5-cache: fix null-ptr-deref for r5l_flush_stripe_to_raid()
...
r5l_flush_stripe_to_raid() will check if the list 'flushing_ios' is
empty, and then submit 'flush_bio', however, r5l_log_flush_endio()
is clearing the list first and then clear the bio, which will cause
null-ptr-deref:
T1: submit flush io
raid5d
handle_active_stripes
r5l_flush_stripe_to_raid
// list is empty
// add 'io_end_ios' to the list
bio_init
submit_bio
// io1
T2: io1 is done
r5l_log_flush_endio
list_splice_tail_init
// clear the list
T3: submit new flush io
...
r5l_flush_stripe_to_raid
// list is empty
// add 'io_end_ios' to the list
bio_init
bio_uninit
// clear bio->bi_blkg
submit_bio
// null-ptr-deref
Fix this problem by clearing bio before clearing the list in
r5l_log_flush_endio().
Fixes: 0dd00cba99 ("raid5-cache: fully initialize flush_bio when needed")
Reported-and-tested-by: Corey Hickey <bugfood-ml@fatooh.org >
Closes: https://lore.kernel.org/all/cddd7213-3dfd-4ab7-a3ac-edd54d74a626@fatooh.org/
Signed-off-by: Yu Kuai <yukuai3@huawei.com >
Reviewed-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Song Liu <song@kernel.org >
2023-08-15 09:40:27 -07:00
..
2023-06-28 16:08:19 -06:00
2023-06-16 18:24:13 -04:00
2023-02-14 14:23:06 -05:00
2021-10-27 16:53:47 -04:00
2023-03-30 15:57:51 -04:00
2023-03-30 15:57:51 -04:00
2023-02-14 14:23:06 -05:00
2023-02-14 14:23:06 -05:00
2023-02-14 14:23:06 -05:00
2023-06-27 16:06:54 -04:00
2023-02-14 14:23:07 -05:00
2023-02-14 14:23:06 -05:00
2023-02-14 14:23:06 -05:00
2023-02-14 14:23:06 -05:00
2023-06-19 13:19:33 -07:00
2023-02-14 14:23:06 -05:00
2023-02-14 14:23:06 -05:00
2023-02-14 14:23:06 -05:00
2023-02-14 14:23:06 -05:00
2023-02-14 14:23:06 -05:00
2023-06-12 08:04:05 -06:00
2021-04-19 13:20:31 -04:00
2020-03-27 14:42:51 -04:00
2023-06-12 08:04:05 -06:00
2023-06-16 18:24:13 -04:00
2023-08-09 16:05:35 -06:00
2023-04-11 12:09:08 -04:00
2023-04-11 12:09:08 -04:00
2023-04-11 12:09:08 -04:00
2023-06-12 08:04:05 -06:00
2023-02-14 14:23:06 -05:00
2023-02-14 14:23:06 -05:00
2023-06-16 18:24:13 -04:00
2023-02-14 14:23:07 -05:00
2023-02-14 14:23:07 -05:00
2023-06-05 10:57:40 -06:00
2023-06-30 12:16:00 -07:00
2023-02-14 14:23:07 -05:00
2023-02-14 14:23:06 -05:00
2023-04-11 12:01:01 -04:00
2023-06-30 12:16:00 -07:00
2023-04-11 12:01:01 -04:00
2023-04-11 12:01:01 -04:00
2023-02-14 14:23:07 -05:00
2023-02-14 14:23:07 -05:00
2023-02-14 14:23:06 -05:00
2023-04-11 12:09:08 -04:00
2023-04-11 12:01:01 -04:00
2023-04-11 12:01:01 -04:00
2023-02-14 14:23:06 -05:00
2023-02-14 14:23:07 -05:00
2023-02-14 14:23:06 -05:00
2023-02-14 14:23:06 -05:00
2023-02-14 14:23:06 -05:00
2023-02-14 14:23:06 -05:00
2023-02-14 14:23:06 -05:00
2023-02-14 14:23:06 -05:00
2023-04-11 12:01:01 -04:00
2023-07-27 00:13:28 -07:00
2023-02-14 14:23:06 -05:00
2023-02-14 14:23:07 -05:00
2023-02-14 14:23:06 -05:00
2023-04-11 12:01:01 -04:00
2023-02-14 14:23:07 -05:00
2023-06-12 08:04:05 -06:00
2023-03-16 13:37:06 -04:00
2023-03-16 13:37:06 -04:00
2023-04-11 12:01:01 -04:00
2023-04-11 12:09:08 -04:00
2023-02-14 14:23:08 -05:00
2023-06-12 08:04:05 -06:00
2023-04-11 12:01:01 -04:00
2023-06-30 12:16:00 -07:00
2023-02-14 14:23:06 -05:00
2023-06-30 12:16:00 -07:00
2023-02-14 14:23:06 -05:00
2023-02-14 14:23:06 -05:00
2023-04-11 12:09:08 -04:00
2023-06-12 08:04:05 -06:00
2023-02-14 14:23:06 -05:00
2023-06-28 10:43:04 -07:00
2023-06-12 08:04:05 -06:00
2023-02-14 14:23:06 -05:00
2023-02-14 14:23:06 -05:00
2023-02-14 14:23:06 -05:00
2023-04-11 12:09:08 -04:00
2023-04-11 12:09:08 -04:00
2023-06-16 18:24:13 -04:00
2023-05-31 09:50:02 -06:00
2021-06-04 12:07:24 -04:00
2023-04-11 12:09:08 -04:00
2022-07-14 12:14:31 -06:00
2023-06-30 12:16:00 -07:00
2023-06-16 18:24:14 -04:00
2023-08-02 09:13:09 -06:00
2022-08-02 14:38:59 -07:00
2023-06-05 10:56:46 -06:00
2023-07-27 00:13:30 -07:00
2023-07-27 00:13:29 -07:00
2023-08-15 09:40:26 -07:00
2023-07-27 00:13:30 -07:00
2023-07-27 00:13:30 -07:00
2020-05-13 12:02:23 -07:00
2023-07-27 00:13:29 -07:00
2023-08-15 09:40:26 -07:00
2023-08-15 09:40:26 -07:00
2023-07-27 00:13:29 -07:00
2023-06-30 15:43:50 -07:00
2023-06-23 09:33:16 -07:00
2023-08-15 09:40:26 -07:00
2023-07-27 00:13:29 -07:00
2023-08-15 09:40:27 -07:00
2022-08-02 17:14:31 -06:00
2023-05-31 09:50:02 -06:00
2023-08-15 09:40:26 -07:00
2023-06-27 21:24:18 -07:00
2023-08-15 09:40:26 -07:00
2023-07-27 00:13:29 -07:00