From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E0C0C433ED for ; Mon, 10 May 2021 06:13:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DE64E60241 for ; Mon, 10 May 2021 06:13:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230030AbhEJGOE (ORCPT ); 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: kvm@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. >= ?