[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Arm: relax iomem_access_permitted() check


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 18 Aug 2021 09:52:51 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XCRmyBrdX7/L7yqddJOH3Y19YjXBN0ue5Y0rNRPoqFQ=; b=DsS7beM1/PCJuoZbopEkcQWducrCKbR3RYmtP19id8CXocGocP023zHHt1IWUrOneLibMJCmpIjFnlxZq24Hc6zeoTD7nsYXbs1bnAPTidpMRymZwy6uZEyJor2ayoIdCdpQbXQWFso5VCeBgvVQIxEqbaFW7+TwvMu3tctKJtUTeBcnxYYxFcqeqTO8ulBtG8GyW5QM6yC0rFqy8WPnaZEgoHpoO0UeMeGlaqda3cWu/NJGSh1jDK7lJ/MZOV+cWccICbcyjuJlkTL0dYyBwqxuM+oIq5vl6wjFCvwI44B7ovywsNYjobgaeHiF6m9LjSze+Cfjs7Qm2ejc1jv2Lw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dNGdzk6JItRR7j5v2qs3//QnQM/x6soZxWDj/nze+0IZfRVqSPrzwILMFz08+cG0wnVOfOYgi/o/oQzOyHsElPXnhFzgx7MpqTgrkVCYcGxfzf7GlSQM13/LsCtQaZrOWgQoAMDC3hLcivHMYW3BOcRg7EpmM06gsYOG8FSfltOhXQJ4RQnqIWdrVPKEMMW0du+gNKXms1FiFfSUZbF7jenbS2qvXjZ4X0FsJjxdKgPSYkGqRcr55VI1lrTIcOWZUJVy+U+6xAwf/UjsLHro98HM9HkCVBGz07mXQqpWhhYgZzFCHrjMA36rM4hb/MGS/m3pk/k9gK+790jDAMjaxA==
  • Authentication-results: epam.com; dkim=none (message not signed) header.d=none;epam.com; dmarc=none action=none header.from=suse.com;
  • Cc: Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>
  • Delivery-date: Wed, 18 Aug 2021 07:53:05 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Ranges checked by iomem_access_permitted() are inclusive; to permit a
mapping there's no need for access to also have been granted for the
subsequent page.

Fixes: 80f9c3167084 ("xen/arm: acpi: Map MMIO on fault in stage-2 page table 
for the hardware domain")
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -1893,7 +1893,7 @@ static bool try_map_mmio(gfn_t gfn)
         return false;
 
     /* The hardware domain can only map permitted MMIO regions */
-    if ( !iomem_access_permitted(d, mfn_x(mfn), mfn_x(mfn) + 1) )
+    if ( !iomem_access_permitted(d, mfn_x(mfn), mfn_x(mfn)) )
         return false;
 
     return !map_regions_p2mt(d, gfn, 1, mfn, p2m_mmio_direct_c);




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.