linux/include/scsi
Krishnasamy, Somasundaram 4000177363 ses: Avoid kernel panic when lun 0 is not mapped
commit d1e12de804 upstream.

During device discovery, scsi mid layer sends INQUIRY command to LUN
0. If the LUN 0 is not mapped to host, it creates a temporary
scsi_device with LUN id 0 and sends REPORT_LUNS command to it. After
the REPORT_LUNS succeeds, it walks through the LUN table and adds each
LUN found to sysfs. At the end of REPORT_LUNS lun table scan, it will
delete the temporary scsi_device of LUN 0.

When scsi devices are added to sysfs, it calls add_dev function of all
the registered class interfaces. If ses driver has been registered,
ses_intf_add() of ses module will be called. This function calls
scsi_device_enclosure() to check the inquiry data for EncServ
bit. Since inquiry was not allocated for temporary LUN 0 scsi_device,
it will cause NULL pointer exception.

To fix the problem, sdev->inquiry is checked for NULL before reading it.

Signed-off-by: Somasundaram Krishnasamy <Somasundaram.Krishnasamy@lsi.com>
Signed-off-by: Babu Moger <babu.moger@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-14 16:53:20 -07:00
..
fc trivial: remove unnecessary semicolons 2009-09-21 15:14:58 +02:00
fc_encode.h [SCSI] libfc: send GPN_ID in reaction to single-port RSCNs. 2009-09-10 12:08:03 -05:00
fc_frame.h libfc: Fix frags in frame exceeding SKB_MAX_FRAGS in fc_fcp_send_data 2010-01-28 15:01:36 -08:00
iscsi_if.h [SCSI] iscsi_tcp: add new conn error to indicate tcp conn closed 2009-09-05 09:42:47 -05:00
iscsi_proto.h
Kbuild
libfc.h libfc: fix free of fc_rport_priv with timer pending 2010-01-28 15:01:38 -08:00
libfcoe.h
libiscsi_tcp.h
libiscsi.h [SCSI] libiscsi: iscsi_session_setup to allow for private space 2009-10-02 14:01:39 -05:00
libsas.h
libsrp.h
osd_attributes.h
osd_initiator.h
osd_protocol.h SCSI: osd_protocol.h: Add missing #include 2009-12-14 09:44:45 -08:00
osd_sec.h
osd_sense.h
osd_types.h
sas_ata.h
sas.h
scsi_bsg_fc.h SCSI: fc-transport: Use packed modifier for fc_bsg_request structure. 2010-04-26 07:41:30 -07:00
scsi_cmnd.h [SCSI] Deprecate SCSI_PROT_*_CONVERT operations 2009-10-02 09:46:25 -05:00
scsi_dbg.h
scsi_device.h ses: Avoid kernel panic when lun 0 is not mapped 2011-04-14 16:53:20 -07:00
scsi_devinfo.h
scsi_dh.h [SCSI] scsi_dh: add the interface scsi_dh_set_params() 2009-08-22 17:52:14 -05:00
scsi_driver.h sd, sr: fix Driver 'sd' needs updating message 2009-06-21 12:01:27 -05:00
scsi_eh.h
scsi_host.h SCSI: scsi_lib_dma: fix bug with dma maps on nested scsi objects 2009-12-14 09:44:44 -08:00
scsi_ioctl.h
scsi_netlink_fc.h
scsi_netlink.h
scsi_scan.h
scsi_tcq.h
scsi_tgt_if.h
scsi_tgt.h
scsi_transport_fc.h
scsi_transport_iscsi.h
scsi_transport_sas.h
scsi_transport_spi.h
scsi_transport_srp.h
scsi_transport.h
scsi.h [SCSI] sd: Support disks formatted with DIF Type 2 2009-10-02 09:47:04 -05:00
scsicam.h
sg.h
srp.h