summaryrefslogtreecommitdiff
path: root/drivers/scsi/megaraid/megaraid_sas.h
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2020-10-30 17:44:21 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2020-11-04 21:56:17 -0500
commitbba84aeccafb57f3f175bbab0658a7facd611d18 (patch)
tree2098b42207d478584b8b17d04fe2f87c6fe592ab /drivers/scsi/megaraid/megaraid_sas.h
parent381d34e376e3d9d27730fda8a0e870600e6c8196 (diff)
downloadlwn-bba84aeccafb57f3f175bbab0658a7facd611d18.tar.gz
lwn-bba84aeccafb57f3f175bbab0658a7facd611d18.zip
scsi: megaraid_sas: Simplify compat_ioctl handling
There have been several attempts to fix serious problems in the compat handling in megasas_mgmt_compat_ioctl_fw(), and it also uses the compat_alloc_user_space() function. Folding the compat handling into the regular ioctl function with in_compat_syscall() simplifies it a lot and avoids some of the remaining problems: - missing handling of unaligned pointers - overflowing the ioc->frame.raw array from invalid input - compat_alloc_user_space() Link: https://lore.kernel.org/r/20201030164450.1253641-3-arnd@kernel.org 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>
Diffstat (limited to 'drivers/scsi/megaraid/megaraid_sas.h')
-rw-r--r--drivers/scsi/megaraid/megaraid_sas.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h
index 5e4137f10e0e..0f808d63580e 100644
--- a/drivers/scsi/megaraid/megaraid_sas.h
+++ b/drivers/scsi/megaraid/megaraid_sas.h
@@ -2605,7 +2605,6 @@ struct megasas_aen {
u32 class_locale_word;
} __attribute__ ((packed));
-#ifdef CONFIG_COMPAT
struct compat_megasas_iocpacket {
u16 host_no;
u16 __pad1;
@@ -2621,7 +2620,6 @@ struct compat_megasas_iocpacket {
} __attribute__ ((packed));
#define MEGASAS_IOC_FIRMWARE32 _IOWR('M', 1, struct compat_megasas_iocpacket)
-#endif
#define MEGASAS_IOC_FIRMWARE _IOWR('M', 1, struct megasas_iocpacket)
#define MEGASAS_IOC_GET_AEN _IOW('M', 3, struct megasas_aen)