linux/drivers/scsi/ufs
Bart Van Assche d3d9c45702 scsi: ufs: Fix memory corruption by ufshcd_read_desc_param()
If param_offset > buff_len then the memcpy() statement in
ufshcd_read_desc_param() corrupts memory since it copies 256 + buff_len -
param_offset bytes into a buffer with size buff_len.  Since param_offset <
256 this results in writing past the bound of the output buffer.

Link: https://lore.kernel.org/r/20210722033439.26550-2-bvanassche@acm.org
Fixes: cbe193f6f0 ("scsi: ufs: Fix potential NULL pointer access during memcpy")
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Daejun Park <daejun7.park@samsung.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-08-02 21:43:57 -04:00
..
cdns-pltfrm.c scsi: ufs: core: Enable power management for wlun 2021-05-10 22:28:20 -04:00
Kconfig scsi: ufs: ufshpb: Introduce Host Performance Buffer feature 2021-08-01 16:04:23 -04:00
Makefile scsi: ufs: ufshpb: Introduce Host Performance Buffer feature 2021-08-01 16:04:23 -04:00
tc-dwc-g210-pci.c scsi: ufs: core: Enable power management for wlun 2021-05-10 22:28:20 -04:00
tc-dwc-g210-pltfrm.c
tc-dwc-g210.c
tc-dwc-g210.h
ti-j721e-ufs.c scsi: ufs: ti-j721e-ufs: Fix error return in ti_j721e_ufs_probe() 2020-08-17 21:48:45 -04:00
ufs_bsg.c scsi: ufs: core: Enable power management for wlun 2021-05-10 22:28:20 -04:00
ufs_bsg.h
ufs_quirks.h scsi: ufs: Introduce device quirk "DELAY_AFTER_LPM" 2020-07-30 21:10:29 -04:00
ufs-debugfs.c scsi: ufs: core: Enable power management for wlun 2021-05-10 22:28:20 -04:00
ufs-debugfs.h scsi: ufs: core: Enable power management for wlun 2021-05-10 22:28:20 -04:00
ufs-exynos.c scsi: ufs: ufs-exynos: Make a const array static, makes object smaller 2021-05-21 22:50:22 -04:00
ufs-exynos.h scsi: ufs: ufs-exynos: Move definitions from .h to .c 2021-05-21 16:07:23 -04:00
ufs-hisi.c SCSI misc on 20210702 2021-07-02 15:14:36 -07:00
ufs-hisi.h scsi: ufs: ufs-hisi: Use device parameter initialization function 2020-11-17 01:03:18 -05:00
ufs-mediatek-trace.h scsi: ufs-mediatek: Use correct path to fix compile error 2020-12-09 12:00:26 -05:00
ufs-mediatek.c SCSI misc on 20210702 2021-07-02 15:14:36 -07:00
ufs-mediatek.h scsi: ufs-mediatek: Keep VCC always-on for specific devices 2020-12-09 11:34:20 -05:00
ufs-qcom-ice.c scsi: ufs-qcom: Add Inline Crypto Engine support 2020-07-24 22:09:54 -04:00
ufs-qcom.c scsi: ufs: core: Enable power management for wlun 2021-05-10 22:28:20 -04:00
ufs-qcom.h scsi: ufs: ufs-qcom: Use device parameter initialization function 2020-11-17 01:03:18 -05:00
ufs-sysfs.c scsi: ufs: ufshpb: Add HPB 2.0 support 2021-08-01 16:05:07 -04:00
ufs-sysfs.h
ufs.h scsi: ufs: ufshpb: Add HPB 2.0 support 2021-08-01 16:05:07 -04:00
ufshcd-crypto.c SCSI misc on 20210219 2021-02-22 10:24:58 -08:00
ufshcd-crypto.h scsi: ufs: use devm_blk_ksm_init() 2021-02-01 12:01:56 +01:00
ufshcd-dwc.c scsi: ufs-dwc: Use phy_initialization helper 2020-12-07 18:00:06 -05:00
ufshcd-dwc.h
ufshcd-pci.c scsi: ufs: core: Enable power management for wlun 2021-05-10 22:28:20 -04:00
ufshcd-pltfrm.c scsi: ufs: ufshcd-pltfrm: Fix deferred probing 2021-04-13 00:14:34 -04:00
ufshcd-pltfrm.h scsi: ufs: Introduce device parameter initialization function 2020-11-17 01:03:18 -05:00
ufshcd.c scsi: ufs: Fix memory corruption by ufshcd_read_desc_param() 2021-08-02 21:43:57 -04:00
ufshcd.h scsi: ufs: ufshpb: Cache HPB Control mode on init 2021-08-01 16:05:14 -04:00
ufshci-dwc.h
ufshci.h scsi: ufs: Utilize Transfer Request List Completion Notification Register 2021-06-07 22:18:03 -04:00
ufshpb.c scsi: ufs: ufshpb: Make host mode parameters configurable 2021-08-01 16:05:15 -04:00
ufshpb.h scsi: ufs: ufshpb: Make host mode parameters configurable 2021-08-01 16:05:15 -04:00
unipro.h scsi: ufs: Add enums for UniPro version higher than 1.6 2020-11-10 23:03:18 -05:00