1
0
Fork 0
alistair23-linux/drivers/scsi/megaraid
Arnd Bergmann 381d34e376 scsi: megaraid_sas: Check user-provided offsets
It sounds unwise to let user space pass an unchecked 32-bit offset into a
kernel structure in an ioctl. This is an unsigned variable, so checking the
upper bound for the size of the structure it points into is sufficient to
avoid data corruption, but as the pointer might also be unaligned, it has
to be written carefully as well.

While I stumbled over this problem by reading the code, I did not continue
checking the function for further problems like it.

Link: https://lore.kernel.org/r/20201030164450.1253641-2-arnd@kernel.org
Fixes: c4a3e0a529 ("[SCSI] MegaRAID SAS RAID: new driver")
Cc: <stable@vger.kernel.org> # v2.6.15+
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-11-04 21:56:17 -05:00
..
Kconfig.megaraid SCSI misc on 20190709 2019-07-11 15:14:01 -07:00
Makefile scsi: megaraid_sas: Export RAID map through debugfs 2019-06-18 19:46:20 -04:00
mbox_defs.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
mega_common.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
megaraid_ioctl.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
megaraid_mbox.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
megaraid_mbox.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
megaraid_mm.c scsi: megaraid: Fix kdoc comments format 2020-07-08 01:00:30 -04:00
megaraid_mm.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
megaraid_sas.h scsi: megaraid: Fix compilation warnings 2020-07-08 01:01:30 -04:00
megaraid_sas_base.c scsi: megaraid_sas: Check user-provided offsets 2020-11-04 21:56:17 -05:00
megaraid_sas_debugfs.c scsi: megaraid_sas: Remove unused including <linux/version.h> 2019-06-18 19:46:25 -04:00
megaraid_sas_fp.c scsi: megaraid: Remove set but unused variable 2020-07-08 01:02:11 -04:00
megaraid_sas_fusion.c scsi: megaraid_sas: Added support for shared host tagset for cpuhotplug 2020-10-06 08:33:44 -06:00
megaraid_sas_fusion.h scsi: megaraid_sas: Replace undefined MFI_BIG_ENDIAN macro with __BIG_ENDIAN_BITFIELD macro 2020-05-11 23:06:24 -04:00