]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: megaraid_sas: Simplify compat_ioctl handling
authorArnd Bergmann <arnd@arndb.de>
Fri, 30 Oct 2020 16:44:21 +0000 (17:44 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 5 Nov 2020 02:56:17 +0000 (21:56 -0500)
commite10e6e1ceffcc3584620020fd9e2fdd238b7a8ba
tree2098b42207d478584b8b17d04fe2f87c6fe592ab
parent3e19d16ad1cbb29a9364604571e8242ba935435b
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>
drivers/scsi/megaraid/megaraid_sas.h
drivers/scsi/megaraid/megaraid_sas_base.c