Re: BUG: NULL pointer dereferenced within __blk_rq_map_sg

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

 



On Thu, Feb 13, 2025 at 07:32:14AM +0100, Christoph Hellwig wrote:
> On Thu, Feb 13, 2025 at 09:29:53AM +0800, Ming Lei wrote:
> > Yeah, turns out oops is triggered in initializing req_iterator for
> > discard req, and the following patch should be enough:
> 
> How do we end up in blk_rq_map_sg for a discard request here?
> dma-mapping doesn't make sense for a non-special pyaload discard
> as used by xxen-blkfront, and xen-blkfront also only calls
> blk_rq_map_sg from blkif_queue_rw_req and not blkif_queue_discard_req.

I think we're probably dealing with a flush command, as that's the
only request that doesn't have a bio except for empty passthrough
commands.  xen-blkfront is a bit weird in calling into these data
transfer helpers despite not having data to transfer, but I guess
something like your patch to safeguard against it should be fine.
But add a comment as well please.




[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