scsi: storvsc: Add validation for untrusted Hyper-V values
authorAndres Beltran <lkmlabelt@gmail.com>
Mon, 6 Jul 2020 16:09:28 +0000 (12:09 -0400)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 8 Jul 2020 05:34:08 +0000 (01:34 -0400)
commit0a76566595bfb242a7f4bedc77233e9194831ba3
treef318acab28cedd0c68609e192d784b74f3fad747
parent3010dfb0b77cc6f413dbfdc01cb1592adcf42873
scsi: storvsc: Add validation for untrusted Hyper-V values

For additional robustness in the face of Hyper-V errors or malicious
behavior, validate all values that originate from packets that Hyper-V has
sent to the guest. Ensure that invalid values cannot cause data being
copied out of the bounds of the source buffer when calling memcpy. Ensure
that outgoing packets do not have any leftover guest memory that has not
been zeroed out.

Link: https://lore.kernel.org/r/20200706160928.53049-1-lkmlabelt@gmail.com
Cc: James E.J. Bottomley <jejb@linux.ibm.com>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Signed-off-by: Andres Beltran <lkmlabelt@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/storvsc_drv.c