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

Re: [PATCH 1/2] vtd: Drop dead check for permissions in lookup_page


  • To: "Jan Beulich" <jbeulich@xxxxxxxx>
  • From: "Teddy Astie" <teddy.astie@xxxxxxxxxx>
  • Date: Thu, 16 Apr 2026 09:15:29 +0000
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=mte1 header.d=mandrillapp.com header.i="@mandrillapp.com" header.h="From:Subject:Message-Id:To:Cc:References:In-Reply-To:Feedback-ID:Date:MIME-Version:Content-Type:Content-Transfer-Encoding"; dkim=pass header.s=mte1 header.d=vates.tech header.i="teddy.astie@xxxxxxxxxx" header.h="From:Subject:Message-Id:To:Cc:References:In-Reply-To:Feedback-ID:Date:MIME-Version:Content-Type:Content-Transfer-Encoding"
  • Cc: "Andrew Cooper" <andrew.cooper3@xxxxxxxxxx>, "Roger Pau Monné" <roger.pau@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 16 Apr 2026 09:15:38 +0000
  • Feedback-id: 30504962:30504962.20260416:md
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Le 16/04/2026 à 10:23, Jan Beulich a écrit :
> On 10.04.2026 12:09, Teddy Astie wrote:
>> `val` comes from `addr_to_dma_page_maddr()` which is a pagetable
>> paddr and doesn't leak the PTE flags in it.
>
> Did you read the comment ahead of the function, in particular the part about
> the caller passing 0 for "target"?
>

Ah ok, the "full PTE contents below PADDR_BITS limit" also includes the
R/W flags, but only in that case.

While I'm on it, there is a corner case here where "full PTE content" is
also at the same time a error condition of this function (if PTE mfn ==
0, we have val < PAGE_SIZE; yet the mapping exists), but that's not the
problem this patch is fixing.

>> Rather than returning entries without any permissions, assume they
>> are always r/w.
>
> This wouldn't be any better.
>

Not having any permission could confuse the caller that there are no
mappings. But it depends mostly on the callers which don't exist yet.

> Jan
>

Teddy


--
Teddy Astie | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech





 


Rackspace

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