Re: [PATCH v2 0/3] blk-cgroup: some cleanup

From: Bart Van Assche
Date: Fri Apr 07 2023 - 15:45:55 EST


On 4/7/23 11:44, Jens Axboe wrote:
On 4/7/23 12:41 PM, Bart Van Assche wrote:
On 4/6/23 07:50, Chengming Zhou wrote:
These are some cleanup patches of blk-cgroup. Thanks for review.

With these patches applied, my kernel test VM crashes during boot. The following crash disappears if I revert these patches:

BUG: KASAN: null-ptr-deref in bio_associate_blkg_from_css+0x83/0x240

Would be useful in the report to know where that is, as it doesn't include
the code output.

Hi Jens,

This is what gdb tells me about the crash address:

$ gdb vmlinux
(gdb) list *(bio_associate_blkg_from_css+0x83)
0xffffffff81856923 is in bio_associate_blkg_from_css (./include/linux/blkdev.h:865).
860 int iocb_bio_iopoll(struct kiocb *kiocb, struct io_comp_batch *iob,
861 unsigned int flags);
862
863 static inline struct request_queue *bdev_get_queue(struct block_device *bdev)
864 {
865 return bdev->bd_queue; /* this is never NULL */
866 }
867
868 /* Helper to convert BLK_ZONE_ZONE_XXX to its string format XXX */
869 const char *blk_zone_cond_str(enum blk_zone_cond zone_cond);

Thanks,

Bart.