Received: by 10.213.65.68 with SMTP id h4csp3466015imn; Mon, 9 Apr 2018 22:30:26 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+klp9oJzzDIVFkG5sfyHnjr/lbQVfwiJ1cJFuKlo8U4oP1LtK3h24l7iZLigW0lAn7lP38 X-Received: by 2002:a17:902:8e83:: with SMTP id bg3-v6mr42548371plb.144.1523338226362; Mon, 09 Apr 2018 22:30:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523338226; cv=none; d=google.com; s=arc-20160816; b=O0/oicdrx/5w2k5G3hvr7gH7kClPvHRfuQNomUoYMIpYhiW10xDhpY20vFyn7A30r0 zCz2Sdl7SpQIk5mbNvIVCNrB3x35hebXDaTbNOIX0FFh35qhzmTr6YfELLzW+qDHB4CR 26V5DpIrjVFa5EUZGkAaavJyApMLL/m+ybd6xukIQG8qgeNtpGFFlqmn4Huuj4jL0MRA 164/+TOPUUAp+JsxJSc2ukhl5fLT3HB7u0vwInPI4INhMOzrVSmV/Mx2FI4cZ3TSrW3J bW44q63+qZWKtMeC4+WzUkrtMZ2yLkjAuGEIx3F2uTytOmdNNu+pQNjqYwPleRYISPcN FnSQ== 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=UfYxk1YsWpFulQQkT8ShqJGb8TJwHhjkD0T6AvfEROo=; b=LiVpfa8I1D+XOGr8CoJiwACman5GlFmN1LjpLNyQ5uXBBSRmZRB4PbJFf+cMrm7igp OYmQGkgJw4KFIKse9+JcmnedAd3ZyOv97/mBPk72TvlsNb9UOzyDV1hwiULxQsYMse7A xigUkOxqAh9jALCCbkZk0f9VxjTqZGa7mtkMup+yH7j6rth2dXMK70WZDfnVk5aXL2/V UGjhyNue3V8O5jm1OW9AZW2SfjWz2h5HD30XG7Ch2eZBzYPTrxN64wPz4n7UzPWRCsDj HkxzJTtvVEx4K/emW7ISOzyb41Hu8I+i9szET8tsvDpyKsSYp5yEejG1hVwW1CnDCiC8 dULw== 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 h3si1468159pfn.158.2018.04.09.22.29.49; Mon, 09 Apr 2018 22:30:26 -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 S1752041AbeDJF1F (ORCPT + 99 others); Tue, 10 Apr 2018 01:27:05 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:50612 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751595AbeDJF1E (ORCPT ); Tue, 10 Apr 2018 01:27:04 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5DD1DA2C76; Tue, 10 Apr 2018 05:27:03 +0000 (UTC) Received: from localhost (ovpn-116-126.ams2.redhat.com [10.36.116.126]) by smtp.corp.redhat.com (Postfix) with ESMTP id 82DDC2026DFD; Tue, 10 Apr 2018 05:27:02 +0000 (UTC) From: Stefan Hajnoczi To: virtualization@lists.linux-foundation.org Cc: syzkaller-bugs@googlegroups.com, mst@redhat.com, Linus Torvalds , kvm@vger.kernel.org, jasowang@redhat.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Stefan Hajnoczi Subject: [PATCH v2 0/2] vhost: fix vhost_vq_access_ok() log check Date: Tue, 10 Apr 2018 13:26:28 +0800 Message-Id: <20180410052630.11270-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 10 Apr 2018 05:27:03 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 10 Apr 2018 05:27:03 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.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 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