android_kernel_google_msm/drivers/scsi
James Bottomley 10c6ff6e59 ses: Fix problems with simple enclosures
commit 3417c1b5cb1fdc10261dbed42b05cc93166a78fd upstream.

Simple enclosure implementations (mostly USB) are allowed to return only
page 8 to every diagnostic query.  That really confuses our
implementation because we assume the return is the page we asked for and
end up doing incorrect offsets based on bogus information leading to
accesses outside of allocated ranges.  Fix that by checking the page
code of the return and giving an error if it isn't the one we asked for.
This should fix reported bugs with USB storage by simply refusing to
attach to enclosures that behave like this.  It's also good defensive
practise now that we're starting to see more USB enclosures.

Reported-by: Andrea Gelmini <andrea.gelmini@gelma.net>
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Zefan Li <lizefan@huawei.com>
2016-10-26 23:15:36 +08:00
..
aacraid aacraid: prevent invalid pointer dereference 2013-11-29 10:50:30 -08:00
aic7xxx Documentation: remove references to /etc/modprobe.conf 2012-03-30 16:03:15 -07:00
aic7xxx_old
aic94xx SCSI: libsas: fix taskfile corruption in sas_ata_qc_fill_rtf 2012-07-16 09:04:37 -07:00
arcmsr SCSI: arcmsr: upper 32 of dma address lost 2014-05-06 07:51:43 -07:00
arm Disintegrate and delete asm/system.h 2012-03-28 15:58:21 -07:00
be2iscsi be2iscsi: Fix kernel panic when device initialization fails 2015-06-19 11:40:31 +08:00
bfa SCSI: bfa: Chinook quad port 16G FC HBA claim issue 2014-02-06 11:05:48 -08:00
bnx2fc bnx2fc: do not add shared skbs to the fcoe_rx_list 2015-04-14 17:33:37 +08:00
bnx2i SCSI: bnx2i: Fixed NULL ptr deference for 1G bnx2 Linux iSCSI offload 2012-10-02 10:30:07 -07:00
cxgbi SCSI updates on 20120319 2012-03-22 12:55:29 -07:00
device_handler SCSI: scsi_dh_alua: Enable STPG for unavailable ports 2012-10-07 08:32:29 -07:00
dpt
fcoe SCSI updates on 20120331 2012-03-31 13:31:23 -07:00
fnic
ibmvscsi ibmvscsi: Abort init sequence during error recovery 2014-07-09 10:51:19 -07:00
isci isci: Fix a race condition in the SSP task management path 2014-06-11 12:04:20 -07:00
libfc libfc: Fix fc_fcp_cleanup_each_cmd() 2016-03-21 09:17:52 +08:00
libsas libsas: Fix Kernel Crash in smp_execute_task 2015-06-19 11:40:23 +08:00
lpfc SCSI: lpfc: fix problems with -Werror 2012-10-02 10:30:07 -07:00
megaraid megaraid_sas : SMAP restriction--do not access user memory from IOCTL code 2016-10-26 23:15:27 +08:00
mpt2sas mpt2sas: Fix for issue Missing delay not getting set during system bootup 2014-06-11 12:04:20 -07:00
mvsas mvsas: Fix NULL pointer dereference in mvs_slot_task_free 2016-04-27 18:55:29 +08:00
osd block: do not pass disk names as format strings 2013-07-13 11:03:41 -07:00
pcmcia module_param: make bool parameters really bool (drivers & misc) 2012-01-13 09:32:20 +10:30
pm8001 SCSI updates on 20120331 2012-03-31 13:31:23 -07:00
qla2xxx SCSI: qla2xxx: Poll during initialization for ISP25xx and ISP83xx 2014-03-23 21:37:07 -07:00
qla4xxx SCSI updates on 20120331 2012-03-31 13:31:23 -07:00
sym53c8xx_2 PCI: Convert pcibios_resource_to_bus() to take a pci_bus, not a pci_dev 2015-06-19 11:40:34 +08:00
ufs [SCSI] ufshcd: UFS Host controller driver 2012-03-27 08:26:28 +01:00
.gitignore
3w-9xxx.c 3w-9xxx: fix command completion race 2015-09-18 09:20:34 +08:00
3w-9xxx.h 3w-9xxx: fix command completion race 2015-09-18 09:20:34 +08:00
3w-sas.c 3w-sas: fix command completion race 2015-09-18 09:20:33 +08:00
3w-sas.h 3w-sas: fix command completion race 2015-09-18 09:20:33 +08:00
3w-xxxx.c 3w-xxxx: fix command completion race 2015-09-18 09:20:34 +08:00
3w-xxxx.h 3w-xxxx: fix command completion race 2015-09-18 09:20:34 +08:00
53c700.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
53c700.h
53c700.scr
53c700_d.h_shipped
a100u2w.c
a100u2w.h
a2091.c scsi: Fix up files implicitly depending on module.h inclusion 2011-10-31 19:31:24 -04:00
a2091.h
a3000.c scsi: Fix up files implicitly depending on module.h inclusion 2011-10-31 19:31:24 -04:00
a3000.h
a4000t.c
advansys.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
aha152x.c scsi: aha152x: Fix sparse warning and make printing pointer address more portable. 2012-12-03 11:46:37 -08:00
aha152x.h
aha1542.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
aha1542.h
aha1740.c scsi: correct return values for .eh_abort_handler implementations 2015-04-14 17:33:42 +08:00
aha1740.h
aic7xxx_old.c
atari_NCR5380.c scsi: correct return values for .eh_abort_handler implementations 2015-04-14 17:33:42 +08:00
atari_scsi.c
atari_scsi.h
atp870u.c drivers/scsi/atp870u.c: fix bad use of udelay 2012-10-13 05:38:38 +09:00
atp870u.h
BusLogic.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
BusLogic.h
bvme6000_scsi.c
ch.c
constants.c
dc395x.c SCSI: dc395x: uninitialized variable in device_alloc() 2013-03-14 11:29:41 -07:00
dc395x.h
dmx3191d.c
dpt_i2o.c
dpti.h
dtc.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
dtc.h
eata.c
eata_generic.h
eata_pio.c
eata_pio.h
esp_scsi.c esp_scsi: Fix tag state corruption when autosensing. 2013-10-13 15:42:49 -07:00
esp_scsi.h esp_scsi: Fix tag state corruption when autosensing. 2013-10-13 15:42:49 -07:00
fd_mcs.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
fdomain.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
fdomain.h
FlashPoint.c
g_NCR5380.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
g_NCR5380.h
g_NCR5380_mmio.c
gdth.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
gdth.h treewide: Fix comment and string typo 'bufer' 2011-12-06 09:53:40 +01:00
gdth_ioctl.h
gdth_proc.c
gdth_proc.h
gvp11.c scsi: Fix up files implicitly depending on module.h inclusion 2011-10-31 19:31:24 -04:00
gvp11.h
hosts.c SCSI: Fix device removal NULL pointer dereference 2012-08-09 08:31:28 -07:00
hpsa.c hpsa: fix memory leak in kdump hard reset 2015-06-19 11:40:33 +08:00
hpsa.h SCSI: hpsa: dial down lockup detection during firmware flash 2012-10-21 09:27:58 -07:00
hpsa_cmd.h SCSI: hpsa: dial down lockup detection during firmware flash 2012-10-21 09:27:58 -07:00
hptiop.c
hptiop.h
ibmmca.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
imm.c
imm.h
in2000.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
in2000.h
initio.c
initio.h
ipr.c [SCSI] libsas, libata: fix start of life for a sas ata_port 2012-04-23 12:11:47 +01:00
ipr.h ipr: Increase default adapter init stage change timeout 2015-10-22 09:20:03 +08:00
ips.c scsi: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:19 +08:00
ips.h
iscsi_boot_sysfs.c switch ->is_visible() to returning umode_t 2012-01-03 22:54:55 -05:00
iscsi_tcp.c [SCSI] libiscsi_tcp: fix max_r2t manipulation 2012-02-19 08:09:00 -06:00
iscsi_tcp.h
jazz_esp.c misc latin1 to utf8 conversions 2012-01-02 13:04:55 +01:00
Kconfig SCSI updates on 20120331 2012-03-31 13:31:23 -07:00
lasi700.c
libiscsi.c libiscsi: Fix host busy blocking during connection teardown 2016-03-21 09:17:52 +08:00
libiscsi_tcp.c SCSI updates on 20120319 2012-03-22 12:55:29 -07:00
libsrp.c scsi: Fix up files implicitly depending on module.h inclusion 2011-10-31 19:31:24 -04:00
mac53c94.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
mac53c94.h
mac_esp.c mac_esp: rename irq 2012-01-22 14:50:03 +01:00
mac_scsi.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
mac_scsi.h
Makefile SCSI updates on 20120331 2012-03-31 13:31:23 -07:00
megaraid.c scsi: correct return values for .eh_abort_handler implementations 2015-04-14 17:33:42 +08:00
megaraid.h
mesh.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
mesh.h
mvme16x_scsi.c
mvme147.c
mvme147.h
mvumi.c
mvumi.h
ncr53c8xx.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
ncr53c8xx.h
NCR53c406a.c
NCR5380.c scsi: correct return values for .eh_abort_handler implementations 2015-04-14 17:33:42 +08:00
NCR5380.h
NCR_D700.c
NCR_D700.h
NCR_Q720.c
NCR_Q720.h
nsp32.c SCSI: nsp32: use mdelay instead of large udelay constants 2013-08-14 22:57:08 -07:00
nsp32.h
nsp32_debug.c
nsp32_io.h
osst.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
osst.h
osst_detect.h
osst_options.h
pas16.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
pas16.h
pmcraid.c SCSI, pmcraid: Fix spelling error in a pmcraid_err() call 2011-12-15 16:35:38 +01:00
pmcraid.h scsi: Fix typo in pmcraid.h 2012-02-21 11:40:37 +01:00
ppa.c
ppa.h
ps3rom.c scsi: Fix up files implicitly depending on module.h inclusion 2011-10-31 19:31:24 -04:00
qla1280.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
qla1280.h
qlogicfas.c
qlogicfas408.c
qlogicfas408.h
qlogicpti.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
qlogicpti.h
raid_class.c
script_asm.pl
scsi.c SCSI: Don't attempt to send extended INQUIRY command if skip_vpd_pages is set 2013-08-14 22:57:05 -07:00
scsi.h
scsi_debug.c SCSI: scsi_debug: Fix off-by-one bug when unmapping region 2012-10-21 09:27:58 -07:00
scsi_devinfo.c SCSI: add 1024 max sectors black list flag 2015-09-18 09:20:33 +08:00
scsi_error.c scsi: only re-lock door after EH on devices that were reset 2015-02-02 17:05:19 +08:00
scsi_ioctl.c
scsi_lib.c Defer processing of REQ_PREEMPT requests for blocked devices 2015-06-19 11:40:31 +08:00
scsi_lib_dma.c scsi: Add export.h for EXPORT_SYMBOL/THIS_MODULE as required 2011-10-31 19:31:23 -04:00
scsi_logging.h
scsi_module.c
scsi_netlink.c Merge branch 'for-linus' of git://selinuxproject.org/~jmorris/linux-security 2012-01-14 18:36:33 -08:00
scsi_pm.c [SCSI] scsi_pm: Fix bug in the SCSI power management handler 2012-02-18 08:54:19 -06:00
scsi_priv.h SCSI: Fix device removal NULL pointer dereference 2012-08-09 08:31:28 -07:00
scsi_proc.c
scsi_sas_internal.h
scsi_scan.c SCSI: add 1024 max sectors black list flag 2015-09-18 09:20:33 +08:00
scsi_sysctl.c
scsi_sysfs.c scsi_sysfs: Fix queue_ramp_up_period return code 2016-10-26 23:15:28 +08:00
scsi_tgt_if.c scsi: Add export.h for EXPORT_SYMBOL/THIS_MODULE as required 2011-10-31 19:31:23 -04:00
scsi_tgt_lib.c
scsi_tgt_priv.h
scsi_trace.c
scsi_transport_api.h
scsi_transport_fc.c [SCSI] scsi_transport_fc: Add FDMI host attributes 2012-02-19 08:08:57 -06:00
scsi_transport_fc_internal.h
scsi_transport_iscsi.c [SCSI] iscsi class: fix gfp use in ping compl and host event 2012-03-27 08:26:36 +01:00
scsi_transport_sas.c [SCSI] scsi_transport_sas: 'enable' phys on reset 2012-02-29 15:43:54 -06:00
scsi_transport_spi.c switch ->is_visible() to returning umode_t 2012-01-03 22:54:55 -05:00
scsi_transport_srp.c
scsi_transport_srp_internal.h
scsi_typedefs.h
scsi_wait_scan.c SCSI: fix scsi_wait_scan 2012-06-10 00:36:05 +09:00
scsicam.c fs: move code out of buffer.c 2012-01-03 22:54:07 -05:00
sd.c sd: Disable support for 256 byte/sector disks 2015-09-18 09:20:42 +08:00
sd.h SCSI: sd: fix array cache flushing bug causing performance problems 2013-05-19 10:54:39 -07:00
sd_dif.c scsi: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:19 +08:00
ses.c ses: Fix problems with simple enclosures 2016-10-26 23:15:36 +08:00
sg.c sg_start_req(): make sure that there's not too many elements in iovec 2016-03-21 09:17:54 +08:00
sgiwd93.c
sim710.c
sni_53c710.c misc latin1 to utf8 conversions 2012-01-02 13:04:55 +01:00
sr.c
sr.h
sr_ioctl.c scsi: Fix up files implicitly depending on module.h inclusion 2011-10-31 19:31:24 -04:00
sr_vendor.c
st.c st: null pointer dereference panic caused by use after kref_put by st_open 2016-03-21 09:17:44 +08:00
st.h [SCSI] st: expand ability to write immediate filemarks 2012-03-27 08:26:34 +01:00
st_options.h
stex.c
storvsc_drv.c scsi: storvsc: Fix a bug in copy_from_bounce_buffer() 2015-09-18 09:20:28 +08:00
sun3_NCR5380.c scsi: correct return values for .eh_abort_handler implementations 2015-04-14 17:33:42 +08:00
sun3_scsi.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
sun3_scsi.h
sun3_scsi_vme.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
sun3x_esp.c
sun_esp.c
sym53c416.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
sym53c416.h
t128.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
t128.h
tmscsim.c
tmscsim.h
u14-34f.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
ultrastor.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
ultrastor.h
virtio_scsi.c SCSI: scsi: virtio-scsi: Fix address translation failure of HighMem pages used by sg list 2012-10-02 10:30:08 -07:00
vmw_pvscsi.c [SCSI] vmw_pvscsi: Try setting host->max_id as suggested by the device. 2012-03-27 08:26:36 +01:00
vmw_pvscsi.h [SCSI] vmw_pvscsi: Try setting host->max_id as suggested by the device. 2012-03-27 08:26:36 +01:00
wd33c93.c
wd33c93.h
wd7000.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
zalon.c
zorro7xx.c