android_kernel_oneplus_msm8998/drivers/scsi
Kees Cook 81ff3e2f64 scsi: csiostor: Avoid content leaks and casts
commit 42c335f7e67029d2e01711f2f2bc6252277c8993 upstream.

When copying attributes, the len argument was padded out and the
resulting memcpy() would copy beyond the end of the source buffer.
Avoid this, and use size_t for val_len to avoid all the casts.
Similarly, avoid source buffer casts and use void *.

Additionally enforces val_len can be represented by u16 and that the DMA
buffer was not overflowed. Fixes the size of mfa, which is not
FC_FDMI_PORT_ATTR_MAXFRAMESIZE_LEN (but it will be padded up to 4). This
was noticed by the future CONFIG_FORTIFY_SOURCE checks.

Cc: Daniel Micay <danielmicay@gmail.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-13 09:21:30 +01:00
..
aacraid scsi: aacraid: Fix typo in blink status 2018-11-10 07:41:40 -08:00
aic7xxx aic7xxx: Fix queue depth handling 2016-04-12 09:08:39 -07:00
aic94xx scsi: aic94xx: fix an error code in aic94xx_init() 2018-09-15 09:40:39 +02:00
arcmsr scsi: arcmsr: Send SYNCHRONIZE_CACHE command to firmware 2016-11-10 16:36:35 +01:00
arm scsi: fas216: fix sense buffer initialization 2018-05-30 07:48:54 +02:00
be2iscsi be2iscsi: set the boot_kset pointer to NULL in case of failure 2016-04-12 09:08:39 -07:00
bfa scsi: bfa: convert to strlcpy/strlcat 2018-12-13 09:21:29 +01:00
bnx2fc scsi: bnx2fc: Fix check in SCSI completion handler for timed out request 2018-05-30 07:48:57 +02:00
bnx2i scsi: bnx2i: add error handling for ioremap_nocache 2018-10-10 08:52:06 +02:00
csiostor scsi: csiostor: Avoid content leaks and casts 2018-12-13 09:21:30 +01:00
cxgbi scsi: cxgb4i: fix Tx skb leak 2017-12-25 14:22:14 +01:00
cxlflash scsi: cxlflash: Improve EEH recovery time 2017-05-08 07:46:02 +02:00
device_handler scsi: scsi_dh_emc: return success in clariion_std_inquiry() 2017-10-21 17:09:05 +02:00
dpt
esas2r scsi: use host wide tags by default 2015-11-09 17:11:57 -08:00
fcoe scsi: fcoe: drop frames in ELS LOGO error path 2018-09-05 09:18:36 +02:00
fnic scsi: fnic: Avoid sending reset to firmware when another reset is in progress 2017-08-06 19:19:47 -07:00
ibmvscsi scsi: ibmvscsi: Improve strings handling 2018-10-10 08:52:05 +02:00
isci scsi: isci: avoid array subscript warning 2017-09-02 07:06:50 +02:00
libfc libfc: Use the correct function name in kernel-doc comment. 2015-11-09 17:15:52 -08:00
libsas scsi: libsas: defer ata device eh commands to libata 2018-05-26 08:48:59 +02:00
lpfc scsi: lpfc: Correct soft lockup when running mds diagnostics 2018-11-21 09:27:33 +01:00
megaraid scsi: megaraid_sas: fix a missing-check bug 2018-11-21 09:27:32 +01:00
mpt3sas scsi: mpt3sas: Do not mark fw_event workqueue as WQ_MEM_RECLAIM 2018-05-30 07:49:03 +02:00
mvsas mvsas: fix misleading indentation 2017-03-18 19:09:58 +08:00
osd Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2015-04-14 09:50:27 -07:00
pcmcia scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
pm8001 SCSI queue for 4.4. 2015-11-12 07:06:18 -05:00
qla2xxx scsi: qla2xxx: do not queue commands when unloading 2018-12-01 09:46:40 +01:00
qla4xxx scsi: qla4xxx: skip error recovery in case of register disconnect. 2018-05-30 07:48:58 +02:00
snic scsi: snic: Return error code on memory allocation failure 2017-08-06 19:19:47 -07:00
sym53c8xx_2 scsi: sym53c8xx_2: iterator underflow in sym_getsync() 2018-05-30 07:48:57 +02:00
ufs scsi: ufshcd: release resources if probe fails 2018-12-01 09:46:40 +01:00
.gitignore
3w-9xxx.c scsi: 3ware: fix return 0 on the error path of probe 2018-09-19 22:48:58 +02:00
3w-9xxx.h 3w-9xxx: fix command completion race 2015-04-27 10:10:19 -07:00
3w-sas.c scsi: 3ware: fix return 0 on the error path of probe 2018-09-19 22:48:58 +02:00
3w-sas.h 3w-sas: fix command completion race 2015-04-27 10:04:39 -07:00
3w-xxxx.c scsi: 3ware: fix return 0 on the error path of probe 2018-09-19 22:48:58 +02:00
3w-xxxx.h 3w-xxxx: fix command completion race 2015-04-27 10:05:55 -07:00
53c700.c 53c700: fix BUG on untagged commands 2016-07-27 09:47:39 -07:00
53c700.h
53c700.scr
53c700_d.h_shipped
a100u2w.c scsi: a100u2w: trivial typo in printk 2015-08-07 15:03:42 +02:00
a100u2w.h
a2091.c zorro: ZTWO_VADDR() should return "void __iomem *" 2013-11-26 11:09:07 +01:00
a2091.h
a3000.c scsi: drop owner assignment from platform_drivers 2014-10-20 16:21:33 +02:00
a3000.h
a4000t.c scsi: drop owner assignment from platform_drivers 2014-10-20 16:21:33 +02:00
advansys.c scsi: advansys: fix uninitialized data access 2018-02-25 11:03:43 +01:00
aha152x.c scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
aha152x.h
aha1542.c scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
aha1542.h aha1542: fix include guard and remove useless changelog 2015-04-09 18:08:31 -07:00
aha1740.c scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
aha1740.h scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
am53c974.c am53c974: Fix crash during modprobe 2015-04-17 10:13:56 -07:00
atari_NCR5380.c ncr5380: Harmonize jiffies conversion with msecs_to_jiffies 2015-03-09 10:45:26 -04:00
atari_scsi.c ncr5380: Drop owner assignment from platform_drivers 2015-03-09 07:18:14 -04:00
atp870u.c scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
atp870u.h scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
BusLogic.c scsi: replace seq_printf with seq_puts 2015-02-02 09:57:45 -08:00
BusLogic.h
bvme6000_scsi.c scsi: drop owner assignment from platform_drivers 2014-10-20 16:21:33 +02:00
ch.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2015-04-14 09:50:27 -07:00
constants.c scsi: fix upper bounds check of sense key in scsi_sense_key_string() 2016-09-15 08:27:54 +02:00
dc395x.c scsi: print single-character strings with seq_putc 2015-02-02 09:57:46 -08:00
dc395x.h
dmx3191d.c dmx3191d: Use NO_IRQ 2014-11-20 09:11:11 +01:00
dpt_i2o.c dpt_i2o: fix build warning 2018-02-25 11:03:44 +01:00
dpti.h scsi: use 64-bit LUNs 2014-07-17 22:07:37 +02:00
dtc.c ncr5380: Drop legacy scsi.h include 2014-11-20 09:11:10 +01:00
dtc.h ncr5380: Remove *_RELEASE macros 2014-11-20 09:11:10 +01:00
eata.c scsi: drop reason argument from ->change_queue_depth 2014-11-24 14:45:27 +01:00
eata_generic.h
eata_pio.c scsi: replace seq_printf with seq_puts 2015-02-02 09:57:45 -08:00
eata_pio.h
esp_scsi.c scsi: esp_scsi: Track residual for PIO transfers 2018-11-21 09:27:32 +01:00
esp_scsi.h scsi: esp_scsi: Track residual for PIO transfers 2018-11-21 09:27:32 +01:00
fdomain.c scsi: fdomain: drop fdomain_pci_tbl when built-in 2018-02-25 11:03:45 +01:00
fdomain.h
FlashPoint.c FlashPoint: fix build warning 2015-11-09 16:32:14 -08:00
g_NCR5380.c ncr5380: shut up gcc indentation warning 2018-02-25 11:03:51 +01:00
g_NCR5380.h ncr5380: Remove *_RELEASE macros 2014-11-20 09:11:10 +01:00
g_NCR5380_mmio.c
gdth.c scsi: rename SERVICE_ACTION_IN to SERVICE_ACTION_IN_16 2014-11-24 20:01:40 +01:00
gdth.h
gdth_ioctl.h
gdth_proc.c scsi: replace seq_printf with seq_puts 2015-02-02 09:57:45 -08:00
gdth_proc.h
gvp11.c zorro: ZTWO_VADDR() should return "void __iomem *" 2013-11-26 11:09:07 +01:00
gvp11.h
hosts.c Merge branch 'mkp-fixes' into fixes 2015-12-03 09:32:33 -08:00
hpsa.c scsi: hpsa: fix volume offline state 2018-01-23 19:50:15 +01:00
hpsa.h scsi: hpsa: limit outstanding rescans 2017-12-20 10:04:55 +01:00
hpsa_cmd.h scsi: hpsa: update check for logical volume status 2017-12-20 10:04:54 +01:00
hptiop.c hptiop: Support HighPoint RR36xx HBAs and Support SAS tape and SAS media changer 2015-08-12 13:14:57 -07:00
hptiop.h hptiop: Support HighPoint RR36xx HBAs and Support SAS tape and SAS media changer 2015-08-12 13:14:57 -07:00
imm.c scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
imm.h
in2000.c scsi: print single-character strings with seq_putc 2015-02-02 09:57:46 -08:00
in2000.h
initio.c SCSI: initio: remove duplicate module device table 2018-02-25 11:03:45 +01:00
initio.h
ipr.c scsi: ipr: Fix missed EH wakeup 2018-03-22 09:23:21 +01:00
ipr.h ipr: Driver version 2.6.3. 2015-11-09 19:32:41 -05:00
ips.c ips: remove pointless #warning 2015-06-02 17:24:54 -07:00
ips.h
iscsi_boot_sysfs.c [SCSI] iscsi_boot_sysfs: Fix a memory leak in iscsi_boot_destroy_kset() 2014-03-15 10:19:19 -07:00
iscsi_tcp.c scsi: drop reason argument from ->change_queue_depth 2014-11-24 14:45:27 +01:00
iscsi_tcp.h net: Fix use after free by removing length arg from sk_data_ready callbacks. 2014-04-11 16:15:36 -04:00
jazz_esp.c scsi: drop owner assignment from platform_drivers 2014-10-20 16:21:33 +02:00
Kconfig scsi: mac_scsi: Fix MAC_SCSI=m option when SCSI=m 2017-05-14 13:32:57 +02:00
lasi700.c
libiscsi.c scsi: libiscsi: fix possible NULL pointer dereference in case of TMF 2018-09-05 09:18:34 +02:00
libiscsi_tcp.c [SCSI] libiscsi: Reduce locking contention in fast path 2014-03-15 10:19:18 -07:00
mac53c94.c scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
mac53c94.h
mac_esp.c scsi: esp_scsi: Track residual for PIO transfers 2018-11-21 09:27:32 +01:00
mac_scsi.c ncr5380: Drop owner assignment from platform_drivers 2015-03-09 07:18:14 -04:00
Makefile mpt3sas: Single driver module which supports both SAS 2.0 & SAS 3.0 HBAs 2015-11-11 19:50:11 -05:00
megaraid.c scsi: megaraid: silence a static checker bug 2018-08-06 16:24:37 +02:00
megaraid.h [SCSI] megaraid: simplify internal command handling 2014-03-27 08:26:31 -07:00
mesh.c powerpc: Move Power Macintosh drivers to generic byteswappers 2015-03-23 14:29:40 +11:00
mesh.h
mvme16x_scsi.c scsi: drop owner assignment from platform_drivers 2014-10-20 16:21:33 +02:00
mvme147.c
mvme147.h
mvumi.c scsi: mvumi: use __maybe_unused to hide pm functions 2018-02-25 11:03:45 +01:00
mvumi.h
ncr53c8xx.c scsi: drop reason argument from ->change_queue_depth 2014-11-24 14:45:27 +01:00
ncr53c8xx.h scsi: Remove CONFIG_SCSI_MULTI_LUN 2014-07-17 22:07:35 +02:00
NCR53c406a.c scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
NCR5380.c ncr5380: Harmonize jiffies conversion with msecs_to_jiffies 2015-03-09 10:45:26 -04:00
NCR5380.h atari_NCR5380: Move static co-routine variables to host data 2014-11-20 09:11:20 +01:00
NCR_D700.c
NCR_D700.h
NCR_Q720.c
NCR_Q720.h
nsp32.c scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
nsp32.h
nsp32_debug.c
nsp32_io.h
osst.c scsi: remove scsi_driver owner field 2014-11-24 20:01:28 +01:00
osst.h
osst_detect.h
osst_options.h
pas16.c ncr5380: Drop legacy scsi.h include 2014-11-20 09:11:10 +01:00
pas16.h ncr5380: Remove *_RELEASE macros 2014-11-20 09:11:10 +01:00
pmcraid.c SCSI queue for 4.4. 2015-11-12 07:06:18 -05:00
pmcraid.h
ppa.c scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
ppa.h
ps3rom.c scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
qla1280.c qla1280: Don't allocate 512kb of host tags 2016-05-18 17:06:52 -07:00
qla1280.h
qlogicfas.c scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
qlogicfas408.c
qlogicfas408.h
qlogicpti.c scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
qlogicpti.h
raid_class.c
script_asm.pl
scsi.c scsi: use host wide tags by default 2015-11-09 17:11:57 -08:00
scsi.h
scsi_common.c scsi_common: do not clobber fixed sense information 2016-04-12 09:09:05 -07:00
scsi_debug.c scsi: scsi_debug: Fix memory leak if LBP enabled and module is unloaded 2016-11-10 16:36:35 +01:00
scsi_devinfo.c scsi: scsi_devinfo: cleanly zero-pad devinfo strings 2018-12-13 09:21:30 +01:00
scsi_dh.c scsi: scsi_dh: replace too broad "TP9" string with the exact models 2018-08-06 16:24:39 +02:00
scsi_error.c scsi: fix race between simultaneous decrements of ->host_failed 2016-07-27 09:47:39 -07:00
scsi_ioctl.c scsi: return EAGAIN when resetting a device under EH 2014-11-12 11:16:12 +01:00
scsi_lib.c scsi: use 'scsi_device_from_queue()' for scsi_dh 2017-03-12 06:37:26 +01:00
scsi_lib_dma.c
scsi_logging.c scsi_logging: return void for dev_printk() functions 2015-02-04 08:00:24 -08:00
scsi_logging.h scsi: simplify scsi_log_(send|completion) 2014-11-12 11:16:05 +01:00
scsi_module.c
scsi_netlink.c net: Use netlink_ns_capable to verify the permisions of netlink messages 2014-04-24 13:44:54 -04:00
scsi_pm.c Revert "SCSI: Fix NULL pointer dereference in runtime PM" 2015-12-10 12:24:44 -05:00
scsi_priv.h scsi_dh: fix use-after-free when removing scsi device 2015-10-27 11:22:37 +09:00
scsi_proc.c scsi: print single-character strings with seq_putc 2015-02-02 09:57:46 -08:00
scsi_sas_internal.h
scsi_scan.c scsi: Add STARGET_CREATED_REMOVE state to scsi_target_state 2018-11-10 07:41:37 -08:00
scsi_sysctl.c scsi: convert use of typedef ctl_table to struct ctl_table 2014-06-06 16:08:16 -07:00
scsi_sysfs.c scsi: Add STARGET_CREATED_REMOVE state to scsi_target_state 2018-11-10 07:41:37 -08:00
scsi_trace.c scsi: print single-character strings with seq_putc 2015-02-02 09:57:46 -08:00
scsi_transport_api.h
scsi_transport_fc.c scsi_transport_fc: Add support for 25Gbit speed 2015-04-10 07:40:32 -07:00
scsi_transport_iscsi.c scsi: scsi_transport_iscsi: fix the issue that iscsi_if_rx doesn't parse nlmsg properly 2017-10-05 09:41:44 +02:00
scsi_transport_sas.c scsi_transport_sas: Remove check for SAS expander when querying bay/enclosure IDs. 2015-09-06 11:13:41 -07:00
scsi_transport_spi.c [SCSI] Fix printk typos in drivers/scsi 2015-08-07 14:28:45 +02:00
scsi_transport_srp.c scsi: scsi_transport_srp: Fix shost to rport translation 2018-06-06 16:46:23 +02:00
scsi_typedefs.h
scsicam.c scsi: PC partition tables are little endian 2014-11-12 11:15:54 +01:00
sd.c scsi: sd: Keep disk read-only when re-reading partition 2018-05-30 07:49:04 +02:00
sd.h sd: Fix rw_max for devices that report an optimal xfer size 2016-10-28 03:01:33 -04:00
sd_dif.c block: Consolidate static integrity profile properties 2015-10-21 14:42:38 -06:00
ses.c scsi: ses: don't get power status of SES device slot on probe 2018-03-22 09:23:24 +01:00
sg.c scsi: sg: fix minor memory leak in error path 2018-08-06 16:24:42 +02:00
sgiwd93.c scsi: drop owner assignment from platform_drivers 2014-10-20 16:21:33 +02:00
sim710.c scsi: sim710: fix build warning 2018-02-25 11:03:44 +01:00
sni_53c710.c scsi: drop owner assignment from platform_drivers 2014-10-20 16:21:33 +02:00
sr.c scsi: sr: Avoid that opening a CD-ROM hangs with runtime power management enabled 2018-08-15 17:42:05 +02:00
sr.h scsi: introduce sdev_prefix_printk() 2014-11-12 11:15:57 +01:00
sr_ioctl.c sr: reduce debug noise in sr_do_ioctl 2015-01-20 19:43:24 +01:00
sr_vendor.c scsi: Implement sr_printk() 2014-07-17 22:07:39 +02:00
st.c Merge branch 'mkp-fixes' into fixes 2015-12-03 09:32:33 -08:00
st.h st: implement tape statistics 2015-06-02 08:03:25 -07:00
st_options.h
stex.c stex: Remove use of struct timeval 2015-11-09 17:42:19 -08:00
storvsc_drv.c scsi: storvsc: Increase cmd_per_lun for higher speed devices 2018-05-30 07:48:58 +02:00
sun3_scsi.c ncr5380: Drop owner assignment from platform_drivers 2015-03-09 07:18:14 -04:00
sun3_scsi.h sun3_scsi: Move macro definitions 2014-11-20 09:11:15 +01:00
sun3_scsi_vme.c scsi/NCR5380: merge sun3_scsi_vme.c into sun3_scsi.c 2014-05-28 12:16:28 +02:00
sun3x_esp.c arch, drivers: don't include <asm/io.h> directly, use <linux/io.h> instead 2015-08-10 23:07:05 -04:00
sun_esp.c scsi: drop owner assignment from platform_drivers 2014-10-20 16:21:33 +02:00
sym53c416.c scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
sym53c416.h
t128.c ncr5380: Drop legacy scsi.h include 2014-11-20 09:11:10 +01:00
t128.h ncr5380: Remove *_RELEASE macros 2014-11-20 09:11:10 +01:00
u14-34f.c scsi: drop reason argument from ->change_queue_depth 2014-11-24 14:45:27 +01:00
ultrastor.c
ultrastor.h
virtio_scsi.c scsi: virtio_scsi: always read VPD pages for multiqueue too 2018-04-08 11:51:59 +02:00
vmw_pvscsi.c scsi: vmw_pvscsi: Return DID_RESET for status SAM_STAT_COMMAND_TERMINATED 2018-09-05 09:18:36 +02:00
vmw_pvscsi.h PCI: Move PCI_VENDOR_ID_VMWARE to pci_ids.h 2014-09-24 11:52:09 -06:00
wd33c93.c scsi: print single-character strings with seq_putc 2015-02-02 09:57:46 -08:00
wd33c93.h
wd719x.c [SCSI] Fix printk typos in drivers/scsi 2015-08-07 14:28:45 +02:00
wd719x.h scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
wd7000.c scsi: replace seq_printf with seq_puts 2015-02-02 09:57:45 -08:00
xen-scsifront.c scsi: xen-scsifront: add error handling for xenbus_printf 2018-08-24 13:26:54 +02:00
zalon.c
zorro7xx.c zorro: ZTWO_VADDR() should return "void __iomem *" 2013-11-26 11:09:07 +01:00