Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp308430yba; Thu, 16 May 2019 00:50:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqwj5hpQzYPOd+tAjcWavAiEHfm+jj8PrBPnMdLAIl8psIRf0R4+ekd6UoHb9cUaLga5EeeM X-Received: by 2002:a62:7995:: with SMTP id u143mr52095155pfc.61.1557993021261; Thu, 16 May 2019 00:50:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557993021; cv=none; d=google.com; s=arc-20160816; b=zSQcup0oFMjQ9rmnavL/NMJEO4DYJntHV8fcMQPCurUR5adwI+ZnjJa80t6gUPi2SO XOrZ0M8oFoY+rr0+KktIBkIWjHdEKg1ZnakQvKoObn4+igLbOmrlS021rpfybdxwbKIJ dy2lM7qBDR4pjhpN8F47ILBPBh8lh11kF7rIlyykDfhilRtHx4cNkZMkoOFXTtjhyR4+ PsEi0gho3/S5BRRGlzf9m/uYavjOpixjFn/zdekmknKA8F5aoJOOJjVO6pmjDVXnlQ6l MhUKyuhApJTnJH3tTDCQiKUjm176GZzsbIa7vnvvZz1r8xvfmSR6g+UCbZOYbfhtPF2E 2DbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=Wq1nL20ZddZGEm7SYmEqpcJZMZvtKpIF2tBE5TrcCpE=; b=CrD0HtYN7jBeocReP9CUxOYzQvptbpTvo+YUglB8Jf1Z+2V6XUlXLEvV5guNMR67n4 pAVIBvn8YvqNzDdPs+htp8URMs6iHXp3GG4sg7dA+rrTiZvT0YiluJW1zTJPXhRTRJ/I qSd3HIA5ZIWS7sS2fAvoxrJWRUJSH37XieCDLzrLJO4Hrjiwp8odF891JFKoGBKpP4o8 xmEOOj1XU+i+mW6hj824K4DNEiU6K8FNB0h8mLmqhZJsnBJ/DXkJU6HEaE6od6vw76lm TGmDSva4FiroGMs8RCopzYky5Hw2gDvtWnG1P3fuWWUAF4kn1Ltggmknr9x4QSBpsKaN GYkw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k1si3977348pll.317.2019.05.16.00.50.06; Thu, 16 May 2019 00:50:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726723AbfEPHrw (ORCPT + 99 others); Thu, 16 May 2019 03:47:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57004 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726363AbfEPHrw (ORCPT ); Thu, 16 May 2019 03:47:52 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DFD143082B6B; Thu, 16 May 2019 07:47:51 +0000 (UTC) Received: from hp-dl380pg8-02.lab.eng.pek2.redhat.com (hp-dl380pg8-02.lab.eng.pek2.redhat.com [10.73.8.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 10A8998BB; Thu, 16 May 2019 07:47:44 +0000 (UTC) From: Jason Wang To: mst@redhat.com, jasowang@redhat.com, virtualization@lists.linux-foundation.org, kvm@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: pbonzini@redhat.com, stefanha@redhat.com Subject: [PATCH net 0/4] Prevent vhost kthread from hogging CPU Date: Thu, 16 May 2019 03:47:38 -0400 Message-Id: <1557992862-27320-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Thu, 16 May 2019 07:47:51 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi: This series try to prvernt a guest triggerable CPU hogging through vhost kthread. This is done by introducing and checking the weight after each requrest. The patch has been tested with reproducer of vsock and virtio-net. Only compile test is done for vhost-scsi. Please review. This addresses CVE-2019-3900. Jason Wang (4): vhost: introduce vhost_exceeds_weight() vhost_net: fix possible infinite loop vhost: vsock: add weight support vhost: scsi: add weight support drivers/vhost/net.c | 41 ++++++++++++++--------------------------- drivers/vhost/scsi.c | 21 ++++++++++++++------- drivers/vhost/vhost.c | 20 +++++++++++++++++++- drivers/vhost/vhost.h | 5 ++++- drivers/vhost/vsock.c | 28 +++++++++++++++++++++------- 5 files changed, 72 insertions(+), 43 deletions(-) -- 1.8.3.1