xen/scsifront: harden driver against malicious backend
authorJuergen Gross <jgross@suse.com>
Thu, 28 Apr 2022 07:53:23 +0000 (09:53 +0200)
committerJuergen Gross <jgross@suse.com>
Thu, 19 May 2022 12:02:49 +0000 (14:02 +0200)
commit6d1c2f48f3fcf5f42967938c8ba6b42ac6b44b43
tree5eb2c927019c1208c8cccc97d9f2c2aeb7c2ad98
parenta2f6751d5af44d8c1cab93c2c410fd334c460339
xen/scsifront: harden driver against malicious backend

Instead of relying on a well behaved PV scsi backend verify all meta
data received from the backend and avoid multiple reads of the same
data from the shared ring page.

In case any illegal data from the backend is detected switch the
PV device to a new "error" state and deactivate it for further use.

Use the "lateeoi" variant for the event channel in order to avoid
event storms blocking the guest.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Link: https://lore.kernel.org/r/20220428075323.12853-5-jgross@suse.com
Signed-off-by: Juergen Gross <jgross@suse.com>
drivers/scsi/xen-scsifront.c