]> www.infradead.org Git - users/dwmw2/linux.git/commit
vhost: scsi: add weight support
authorJason Wang <jasowang@redhat.com>
Fri, 17 May 2019 04:29:52 +0000 (00:29 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 13 Aug 2019 11:39:24 +0000 (12:39 +0100)
commit6c74f68cf3ca570f39ff8a9e3b0ae357839c4560
treee7f41faefab3c2fb27cc9f53915c95c05417b2ff
parentf3a64b1071c414e59233b769110872a026f8d254
vhost: scsi: add weight support

commit c1ea02f15ab5efb3e93fc3144d895410bf79fcf2 upstream.

This patch will check the weight and exit the loop if we exceeds the
weight. This is useful for preventing scsi kthread from hogging cpu
which is guest triggerable.

This addresses CVE-2019-3900.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Fixes: 057cbf49a1f0 ("tcm_vhost: Initial merge for vhost level target fabric driver")
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
[bwh: Backported to 3.16:
 - Drop changes in vhost_scsi_ctl_handle_vq()
 - Adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/vhost/scsi.c