Received: by 10.192.165.156 with SMTP id m28csp194463imm; Tue, 10 Apr 2018 19:39:18 -0700 (PDT) X-Google-Smtp-Source: AIpwx49b14Z/M/kOkl8QA045Px3SI6pKBTOWfKHsyI9u4q/0Z2Pxfo66OB79PVlIXCVc1uzC90HO X-Received: by 2002:a17:902:7185:: with SMTP id b5-v6mr2968034pll.221.1523414358944; Tue, 10 Apr 2018 19:39:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523414358; cv=none; d=google.com; s=arc-20160816; b=do0yYX4R/TNh3hW29MIMbx5VJvYTOdCwWVpPhDZtDwVgRKIit9kFthz1DO1xlGNEhW 8wz42XR1M1dGkv0CYufxxqs18A35l/OXzNDQLDQlrf5z4YbGnIcsSWH1AdJgUVvxvLCU ChTrk83tPaoGBHlKE2LZnTP/tu1NTV9pf1wZmtJhHv3n40VvlWMeLiYgTxYj8Q1XpYVo ItDgBDhx8/2O/yhisD1kVLMqRCiwmOtMc7WJfVWWiUHM2j8kRkA9XApb80d31qj3v66O Y7qBILcGq3m5p4s318TvJ7NKcBQyv588V2jYZB/0lbY6++EPrTCTgZtWucg08ykCNdut uijQ== 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 :arc-authentication-results; bh=A2iNZuK1jqCPedJcYD3uH4uacQiFbi9+znDbR/kd96A=; b=y8mzvhJQ581w3C1OK2HSWxG18gwBYZh3NEo3yM3v8TrFnZETty10VoOUBwb5H+Kj6v l7mE91aMbWqYwKZiF5718BbtC9QXvDByvzeUTNrcKaQc48zbm9Xny8yDlc0jxpg/WqNo EV1cR4PhVmKaPSWTYZ/1dyyl8afaF07fRJdjg+U626IzErwcAkCY6s7OGF157X2QZ4O+ fs6kSb1Fz/EyydMtCieU8asHeLbPGvQSdQZuUSDB/h5Cmv5F6wRJRGCCVXCitM/ip4X2 Rt9Ff1HaY+WtlAwjshm9YjR0Acc9/1m5mUC64GjsTYZgGkN9t9FqjntJ1L3g5AJwB4b3 eu8g== 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 a12si94281pfd.235.2018.04.10.19.38.42; Tue, 10 Apr 2018 19:39:18 -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 S1752831AbeDKCfr (ORCPT + 99 others); Tue, 10 Apr 2018 22:35:47 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:54824 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752298AbeDKCfq (ORCPT ); Tue, 10 Apr 2018 22:35:46 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0DFDF4072CC4; Wed, 11 Apr 2018 02:35:46 +0000 (UTC) Received: from localhost (ovpn-116-59.ams2.redhat.com [10.36.116.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1A031215CDAF; Wed, 11 Apr 2018 02:35:44 +0000 (UTC) From: Stefan Hajnoczi To: virtualization@lists.linux-foundation.org Cc: Linus Torvalds , jasowang@redhat.com, mst@redhat.com, netdev@vger.kernel.org, syzkaller-bugs@googlegroups.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Stefan Hajnoczi Subject: [PATCH v3 0/2] vhost: fix vhost_vq_access_ok() log check Date: Wed, 11 Apr 2018 10:35:39 +0800 Message-Id: <20180411023541.15776-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 11 Apr 2018 02:35:46 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 11 Apr 2018 02:35:46 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'stefanha@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org v3: * Rebased onto net/master and resolved conflict [DaveM] v2: * Rewrote the conditional to make the vq access check clearer [Linus] * Added Patch 2 to make the return type consistent and harder to misuse [Linus] The first patch fixes the vhost virtqueue access check which was recently broken. The second patch replaces the int return type with bool to prevent future bugs. Stefan Hajnoczi (2): vhost: fix vhost_vq_access_ok() log check vhost: return bool from *_access_ok() functions drivers/vhost/vhost.h | 4 +-- drivers/vhost/vhost.c | 70 ++++++++++++++++++++++++++------------------------- 2 files changed, 38 insertions(+), 36 deletions(-) -- 2.14.3