On Wed, 2015-03-04 at 16:00 +0100, Olaf Hering wrote:
> On Fri, Feb 27, Nicholas A. Bellinger wrote:
> 
> > On Thu, 2015-02-26 at 10:26 +0100, Olaf Hering wrote:
> 
> > > [  145.661468] IP: [<ffffffffa024f17b>] pscsi_get_device_type+0xb/0x20 
> > > [target_core_pscsi]
> > Looks like a PSCSI specific NULL pointer dereference when reading the
> > dev_type attribute if a backend device was not able to be successfully
> > configured -> enabled.
> > 
> > Here's a quick patch to address this case.  Please confirm on your end.
> 
> Unfortunately I can not reproduce it anymore. Maybe it depends on the .config?
> 

So the way to reproduce is to read the scsi_lu/dev_type configfs
attribute when a PSCSI backend device has not yet been configured ->
enabled.  Eg:

root@scsi-mq:/usr/src/target-pending.git# modprobe target_core_mod
root@scsi-mq:/usr/src/target-pending.git# mkdir -p 
/sys/kernel/config/target/core/pscsi_0/foo/
root@scsi-mq:/usr/src/target-pending.git# cat 
/sys/kernel/config/target/core/pscsi_0/foo/statistics/scsi_lu/dev_type 
Killed

I've confirmed the previous patch addresses this case, which now returns
TYPE_NO_LUN. (0x7f)

root@scsi-mq:/usr/src/target-pending.git# modprobe target_core_mod
root@scsi-mq:/usr/src/target-pending.git# mkdir -p 
/sys/kernel/config/target/core/pscsi_0/foo
root@scsi-mq:/usr/src/target-pending.git# cat 
/sys/kernel/config/target/core/pscsi_0/foo/statistics/scsi_lu/dev_type 
127

Queuing up this patch to target-pending/master now, and including a CC'
to stable as well.

Thank you,

--nab

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to