Re: [PATCH linux-4.19.y] blk-mq: fix divide by zero crash in tg_may_dispatch()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2021/09/15 19:27, Greg KH wrote:
On Tue, Sep 14, 2021 at 08:54:02PM +0800, Yu Kuai wrote:
If blk-throttle is enabled and io is issued before
blk_throtl_register_queue() is done. Divide by zero crash will be
triggered in tg_may_dispatch() because 'throtl_slice' is uninitialized.

The problem is fixed in commit 75f4dca59694 ("block: call
blk_register_queue earlier in device_add_disk") from mainline, however
it's too hard to backport this patch due to lots of refactoring.

Thus introduce a new flag QUEUE_FLAG_THROTL_INIT_DONE. It will be set
after blk_throtl_register_queue() is done, and will be checked before
applying any config.

Signed-off-by: Yu Kuai <yukuai3@xxxxxxxxxx>
---
  block/blk-sysfs.c      |  2 ++
  block/blk-throttle.c   | 41 +++++++++++++++++++++++++++++++++++++++--
  include/linux/blkdev.h |  1 +
  3 files changed, 42 insertions(+), 2 deletions(-)


The commit you reference above is in 5.15-rc1.  What about all of the
other stable kernel releases newer than 4.19.y?  You do not want to move
to a newer release and have a regression.

All other kernel releases without this patch have the same issure,
including v5.14.

And I would _REALLY_ like to take the identical commits that are
upstream if at all possible.  What is needed to backport instead of
doing this one-off patch instead?

The function __device_add_disk() is quite different compared from
4.19.y to mainline, I haven't finish to collect that how many patches is
needed yet, which is not easy to do...

When we take changes that are not upstream, almost always they are
broken so we almost never want to do that.

I understand that, more proper fix should be calling blk_register_queue
earlier in device_add_disk like the commit did. I'll try to do that and
hope conflicts are not too much...

Thanks,
Kuai

thanks,

greg k-h
.




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux