]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
vhost: vsock: add weight support
authorJason Wang <jasowang@redhat.com>
Fri, 17 May 2019 04:29:51 +0000 (00:29 -0400)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit67b8b619b5d46332f68a80ebe6ab855098fdf2b0
tree913ae5d56c4150df9d3ff4e36bccaa1373471376
parent7a1100572a3a9fd13af317b2edc2151f7adba9db
vhost: vsock: add weight support

BugLink: https://bugs.launchpad.net/bugs/1838824
commit e79b431fb901ba1106670bcc80b9b617b25def7d upstream.

This patch will check the weight and exit the loop if we exceeds the
weight. This is useful for preventing vsock kthread from hogging cpu
which is guest triggerable. The weight can help to avoid starving the
request from on direction while another direction is being processed.

The value of weight is picked from vhost-net.

This addresses CVE-2019-3900.

Cc: Stefan Hajnoczi <stefanha@redhat.com>
Fixes: 433fc58e6bf2 ("VSOCK: Introduce vhost_vsock.ko")
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Balbir Singh <sblbir@amzn.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/vhost/vsock.c