Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2317856pxj; Sun, 9 May 2021 23:14:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2At3iolOmxjf/1MK1BKSM2WNUO0f9wJDO4x4/jYHyasaX10eayCidA1XF8b3DxJl8K9AD X-Received: by 2002:a05:6e02:1ba3:: with SMTP id n3mr13586124ili.20.1620627262599; Sun, 09 May 2021 23:14:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620627262; cv=none; d=google.com; s=arc-20160816; b=q2VB2hu1IEZKG+25BU3D9Ps3Q2m4A42GEiX+yKdP1UuSvhEex8dyrxhxjKCh/r9DBD 3KGMOeOK6GWOx5RFxp9PJVd5IrtKrgaF9o2ZGWR4u+DI/UUAC3GNJAMOPVFMALPvv4EM RwP/AhC81aBZWkzJYpNF0GQm8jZMOxLXZ1/ydxdVjcFKTiaHLUZMXdew//4rjgDNZPt8 vePiGiq1pAMr7XDvfid+i4qcpMe8eE/K4jbiyGyHNK3bFfjH3cqxOdFpBD1ulBeMetne uJ/CMiw+mJb9xXHVrGtkGDqfi+ollUAUpVrrRNBtPZP2gIY5EgluleTRBLSDC4zHfQtp o1UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=P+kqNKNxvPn+WQsUe5wG5zKQfBTbs5EJcqRgrHP9ME0=; b=SuEYdm2V/ZC9zlOAj2q+xz9Wo1cKG0+O9YkzDnnIYGQBRr0d121LQxMrSpbyK/TnrV VXDNcBOquBtt5ZfJM5A6PoUUKUe1r3veUR6IZVZqn2xnp02dK+HnekyokI/G29ASxl0z nGY2E+lnlnPVJdiHQ3sRwTz2OXUO7PdFh8wbr+hB0otRkS1R/j7NxkzGkga0UNyKnYCA 2vClowDfBNPrxsxmg1prIBfbhI5iXqLDLSKzg4/v5QJodhmOMkbHHuT0hxRgpV8V4yvU relCf/vc8lJYmkB3Fneb1ckMF4W1DecCzNqghxB+Dxsxp/gHSd0RYAFNP2j2w+TAu0FV Q/hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=dNGYaNsI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s17si1536310jat.9.2021.05.09.23.14.08; Sun, 09 May 2021 23:14:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=dNGYaNsI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230031AbhEJGOE (ORCPT + 99 others); Mon, 10 May 2021 02:14:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229608AbhEJGOE (ORCPT ); Mon, 10 May 2021 02:14:04 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57E39C061573; Sun, 9 May 2021 23:13:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=P+kqNKNxvPn+WQsUe5wG5zKQfBTbs5EJcqRgrHP9ME0=; b=dNGYaNsIcZd9E+MQZ3SmcZ17xa Ehrbo+Xv2Hw2kBNS2yk5pUL2c0vHN7W3u36TfFocvfUIaO4kEqHccpqWrZ2YqHOhEcpWp6xzUyEpy 9QPviiTgwn40yKHOZrQekbCAKuFR7Bon5h0LA7EhOS163tpMBmp5fD+h6pyJJ065i4GYGlwZC9miy 5OgYbAUFaNU2QEzmcPfBNe8YZWyDcKd9fzN/HIFxPkbZPEI3EFQ5rBPG3diF+MVi47whLZDKlffTs DeN9IIXGRey3NGZa5852S337GbhGHC1XwxhpH1NP/XkgF/6BDOkeOY2g/uco2HR9l9d8zedKLpyYi M3QAWiJw==; Received: from hch by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lfz9q-005lOi-3j; Mon, 10 May 2021 06:12:47 +0000 Date: Mon, 10 May 2021 07:12:46 +0100 From: Christoph Hellwig To: Alex Williamson Cc: tkffaul@outlook.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] vfio/pci: Sanity check IGD OpRegion Size Message-ID: References: <162041357421.21800.16214130780777455390.stgit@omen> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <162041357421.21800.16214130780777455390.stgit@omen> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 07, 2021 at 12:53:17PM -0600, Alex Williamson wrote: > + /* > + * The OpRegion size field is specified as size in KB, but there have been > + * user reports where this field appears to report size in bytes. If we > + * read 8192, assume this is the case. > + */ Please avoid pointlesly spilling the comment line over 80 chars. > + if (size == OPREGION_SIZE) Shouldn't this be a range tests, i.e. >= ?