Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1485803yba; Thu, 16 May 2019 23:19:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqxiE8IeWp916WRsTbAsfYIVFwWhFs5iIhDmAQESp8W6ZZGCzYV7OBv8rC7shZtgizmurqRa X-Received: by 2002:a17:902:b489:: with SMTP id y9mr53212922plr.70.1558073968453; Thu, 16 May 2019 23:19:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558073968; cv=none; d=google.com; s=arc-20160816; b=F77H/6hFF1/2wpLmUva1EWdWcQkpGe9/Gzp3eFijmARMlk+8/g7TYtkdObdfqJKEjI H2CyDxz/bZZEIgyxgX2cqB6CsqLHCEQTM2sz9/d/7a13puipX3B0Qi0HCCUnWE25k5fd l4cQY4zu3NJsJat9qoLMFQ23z/qfP9NIFLwmDFM2DKUJTdxUnbh8w8Z3NqyYs698Nid1 Lad5t1dXYSTCo7zC2e8CrXy8TxlilD/wbxMFybbBwvIX4USpbKyJBSWMTT9pXU5KRO2Z Lv0yowC8otAQVGUIzPPL2BPwmSJT3jcI9TDztPXtquS2UpI2YrC95vL6ECTBRliDyhaV EKPQ== 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=soi18dFVVNQXHXKZv2csOePd1hzYWcSOUzbdL5RJXzw=; b=dSUtfJt8IoTbsehs0X1sDj9I5me3EkE+H8aTCIqVYO3/riFqibGX3DfHxhpIojJ4zu bxrhocAd+HSLV9lZQsrqbRxSK8hzMe0wE0tE201WJM9ZaP/8Lgme7YIgeM9yz/fKuf9X d5Lfm3wYrQIMHqWoTfl52r+0ovdFkTU5eerqMZcK1UGlV52XLJCiSezBLHtEoAFlpJd9 ZuSWbZ4au0u0etwapDHKSfFg9S2xMLJQuoW0I7NPDp1Y1BUchlpoj7fyC3hQob38vFz0 9Br/O7aY8FQ6+XNQbIhTecmDpMW7lVMbueILvS/GSiq8wV+kAU2asRFgpd+uZvgqeAP4 Yg0Q== 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 f9si7251581pgp.391.2019.05.16.23.19.12; Thu, 16 May 2019 23:19:28 -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 S1727602AbfEQEaF (ORCPT + 99 others); Fri, 17 May 2019 00:30:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34698 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726078AbfEQEaF (ORCPT ); Fri, 17 May 2019 00:30:05 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 79B3630821AE; Fri, 17 May 2019 04:30:02 +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 37C901001E78; Fri, 17 May 2019 04:29:54 +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 V2 0/4] Prevent vhost kthread from hogging CPU Date: Fri, 17 May 2019 00:29:48 -0400 Message-Id: <1558067392-11740-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Fri, 17 May 2019 04:30:05 +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 prevent 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. Changs from V1: - fix user-ater-free in vosck patch 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