From patchwork Fri Jul 7 18:30:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 9830997 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DC34D602BD for ; Fri, 7 Jul 2017 18:53:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7629286CC for ; Fri, 7 Jul 2017 18:53:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA818286F5; Fri, 7 Jul 2017 18:53:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3B947286CC for ; Fri, 7 Jul 2017 18:53:09 +0000 (UTC) Received: from localhost ([::1]:58384 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dTYNI-0001Yi-4w for patchwork-qemu-devel@patchwork.kernel.org; Fri, 07 Jul 2017 14:53:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52310) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dTY18-00024O-77 for qemu-devel@nongnu.org; Fri, 07 Jul 2017 14:30:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dTY15-0006m0-Fz for qemu-devel@nongnu.org; Fri, 07 Jul 2017 14:30:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:36994) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dTY15-0006lL-AG for qemu-devel@nongnu.org; Fri, 07 Jul 2017 14:30:11 -0400 Received: from localhost.localdomain (162-198-228-33.lightspeed.wlfrct.sbcglobal.net [162.198.228.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 20BBA22BE3; Fri, 7 Jul 2017 18:30:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 20BBA22BE3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=sstabellini@kernel.org From: Stefano Stabellini To: peter.maydell@linaro.org, stefanha@gmail.com Date: Fri, 7 Jul 2017 11:30:04 -0700 Message-Id: <1499452204-20769-3-git-send-email-sstabellini@kernel.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1499452204-20769-1-git-send-email-sstabellini@kernel.org> References: <1499452204-20769-1-git-send-email-sstabellini@kernel.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 198.145.29.99 Subject: [Qemu-devel] [PULL 3/3] xen/pt: Fixup addr validation in xen_pt_pci_config_access_check X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sstabellini@kernel.org, qemu-devel@nongnu.org, stefanha@redhat.com, Anoob Soman , anthony.perard@citrix.com, xen-devel@lists.xenproject.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Anoob Soman xen_pt_pci_config_access_check checks if addr >= 0xFF. 0xFF is a valid address and should not be ignored. Signed-off-by: Anoob Soman Acked-by: Anthony PERARD Signed-off-by: Stefano Stabellini --- hw/xen/xen_pt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c index b6d71bb..375efa6 100644 --- a/hw/xen/xen_pt.c +++ b/hw/xen/xen_pt.c @@ -85,7 +85,7 @@ void xen_pt_log(const PCIDevice *d, const char *f, ...) static int xen_pt_pci_config_access_check(PCIDevice *d, uint32_t addr, int len) { /* check offset range */ - if (addr >= 0xFF) { + if (addr > 0xFF) { XEN_PT_ERR(d, "Failed to access register with offset exceeding 0xFF. " "(addr: 0x%02x, len: %d)\n", addr, len); return -1;