Received: by 10.213.65.68 with SMTP id h4csp3280507imn; Mon, 9 Apr 2018 18:09:21 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/aYomIpTx44YLeQ160Z/ajmb9J7mMOA+AHQ/FimUIjk2MxZWbwGQjDmGs1cydDJ96s6ImF X-Received: by 10.99.100.196 with SMTP id y187mr26086118pgb.83.1523322561179; Mon, 09 Apr 2018 18:09:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523322561; cv=none; d=google.com; s=arc-20160816; b=DvzCt3TP9W7lyZEyTYGDWOidjfs0UtlFpw3+Z9CQatAehVPCLsIKYrFt4h1XW0bSfy FcKAEFItL/ltWvzXsPCRK9lZxT6WdetQgd+RR73NZLpkNEinr44tYjQULRK3I0L+fF0H OB05XYmeL2+9lWf+NE8vcL+VO7WpJP14F2j2xX1olOs0Br7iuKQP7KMQbuvlDipDeDVR cEv8hROaC7mJ73HzYJbhsRMfZ9LgAw44h0uUqqFB74LPh0aPkFptzTiK1QOYGIBXwCG5 EX3WY+l5Hd03xEWKeRbaMHVmY4adRiv7w+4/y02AihgTlNElxRuQgd9kpnBYiFqHYYCI Uhkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=lRHMfBnCE4+Rbsb1V3n2QTkZ2DBsxkfIRRCx/bJF9TY=; b=nT3MQVeh/YPNKidDJlqWZjCp87bec8G+SHJ6s6HzgfP8pFVw7k6PxUMidMZM59+cXu /JEeFU/J3CII7QRq0+g6a1dZaXbuwmRkQvpt7nhsi87aGCq1gc200d0yMf65Cpr+hSNq yNww1UwaxyOtpKZBNotDvqQ6z7bfisny+s6CVHoMkBF+ln8tjoxXHivMwIqm06YOkpKe tkh6jiZ+wleo52yno5+aGidmHTX1ejYo13Gj52l4l8RDTUlIWVC3XgohIWThpA+NjDz2 9O42N/G0fSx05mbioIBlgAIAAPOzv7IVV+VKIsN3GZgKsZFgG+POkvl/iXs9BZlrkpai L2qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LgUDmL8E; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si1423727plj.510.2018.04.09.18.08.44; Mon, 09 Apr 2018 18:09: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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LgUDmL8E; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752140AbeDJBFP (ORCPT + 99 others); Mon, 9 Apr 2018 21:05:15 -0400 Received: from mail-wm0-f41.google.com ([74.125.82.41]:52135 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751526AbeDJBFN (ORCPT ); Mon, 9 Apr 2018 21:05:13 -0400 Received: by mail-wm0-f41.google.com with SMTP id u189so22595906wmd.1; Mon, 09 Apr 2018 18:05:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=lRHMfBnCE4+Rbsb1V3n2QTkZ2DBsxkfIRRCx/bJF9TY=; b=LgUDmL8Evs/9SiCUUZqd1UrxWtp7Ql9DRppQNwoNeZoGnYyGS3bB5vzD1jsTZ6aP96 O2xt2Eh5mQD4ZWmpYPyAsM2jn3YyPO4w6HOH4EAqK+yfoxOQxK50YQfQzBrXxGqZhJRj GmbbNqSAuQk1dVhKRDI1gLEaCaAiskNp4GPyA30WWjFAhfJIviVTVHQaRrkcPOEl9kUj pTGHfS758kK7/XU3bWtZf2aMyaKfyT6YUNusVULYJVunK77gxBfUgp+FejaeJgNBB1WR 2YNBdAq3XnrKrnmJuxt6YS2oz+Qj/LfVgKw+MgU52RqykSyMZuYlcF18LhHbOIH+8OtU qU/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=lRHMfBnCE4+Rbsb1V3n2QTkZ2DBsxkfIRRCx/bJF9TY=; b=XoaxFTAN3JR5Tqeh/bUsZmuc6JhkEx8NjkZ2XzErgSJJcQloKLdteWD3DRyyYeqz1/ CfbQAsgMZG6x3edjPVULlyTcnbXUIGZh19EP0hgYoTG6GHb5SECPsgHmivrQvDK2yVNm 0KF/NuwXcyW+MXOuk5gD4KuhVPIay+O1rULUuiwGmmrCDDpVqR0oI9zCqEI303HXo4XU KXyS22e+KS+7rzjTlOaAo2/BLmyAb40WPEG1NQuSGgv/FmNW3Ap+NhRKQsrH9xQNdbOd JHT/RQt3n1n0T4QR8WnGZ/17obG7v+gFa7Trh4MMKzVeIyLuMagIaT8WlIlW4XoQoVaL WUWw== X-Gm-Message-State: ALQs6tAtTKHbERmPkZoEXpVqSOuoJg73UWVi5sZiNHmwSAHV6o62YCWo SA97KoBi6jHNloyhnkeft3XhE6QT7ggDko6Pwm+aUw== X-Received: by 10.28.13.205 with SMTP id 196mr62933wmn.73.1523322311818; Mon, 09 Apr 2018 18:05:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.219.139 with HTTP; Mon, 9 Apr 2018 18:05:11 -0700 (PDT) In-Reply-To: <20180409174731-mutt-send-email-mst@kernel.org> References: <20180409131021.5132-1-stefanha@redhat.com> <20180409174731-mutt-send-email-mst@kernel.org> From: Stefan Hajnoczi Date: Tue, 10 Apr 2018 09:05:11 +0800 Message-ID: Subject: Re: [PATCH RESEND net] vhost: fix vhost_vq_access_ok() log check To: "Michael S. Tsirkin" Cc: David Miller , netdev@vger.kernel.org, Linux Virtualization , kvm , syzkaller-bugs@googlegroups.com, linux-kernel , Stefan Hajnoczi Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 10, 2018 at 3:40 AM, Michael S. Tsirkin wrote: > From: Stefan Hajnoczi > > Commit d65026c6c62e7d9616c8ceb5a53b68bcdc050525 ("vhost: validate log > when IOTLB is enabled") introduced a regression. The logic was > originally: > > if (vq->iotlb) > return 1; > return A && B; > > After the patch the short-circuit logic for A was inverted: > > if (A || vq->iotlb) > return A; > return B; > > The correct logic is: > > if (!A || vq->iotlb) > return A; > return B; > > Reported-by: syzbot+65a84dde0214b0387ccd@syzkaller.appspotmail.com > Cc: Jason Wang > Signed-off-by: Stefan Hajnoczi > Acked-by: Michael S. Tsirkin > > --- > drivers/vhost/vhost.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) NACK I will send a v2 with cleaner logic as suggested by Linus. Stefan