Re: [PATCH] scsi_dh: only attach to SCSI devices

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

 



On 02/16/2017 03:38 PM, hch@xxxxxx wrote:
> On Thu, Feb 16, 2017 at 02:30:34PM +0000, Bart Van Assche wrote:
>>>  	sdev = q->queuedata;
>>> -	if (!sdev || !get_device(&sdev->sdev_gendev))
>>> +	if (!sdev ||
>>> +	    !scsi_is_sdev_device(&sdev->sdev_gendev) ||
>>> +	    !get_device(&sdev->sdev_gendev))
>>>  		sdev = NULL;
>>>  	spin_unlock_irqrestore(q->queue_lock, flags);
>>
>> Hello Hannes,
>>
>> Sorry but this approach looks wrong to me. A block driver can store any data
>> in .queuedata, even data that would cause the scsi_is_sdev_device() function
>> to crash.
> 
> Yes, I fear you're right.  I guess we need to call into the scsi_dh_*
> functions through an indirection mediated by the block layer.
> 
Okay, will be tooling it up.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@xxxxxxx			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux