lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ad661a4a-0078-49f6-b999-19c2ed76389b@linux.intel.com>
Date: Mon, 1 Sep 2025 13:55:46 +0800
From: Baolu Lu <baolu.lu@...ux.intel.com>
To: Eugene Koira <eugkoira@...zon.com>, iommu@...ts.linux.dev,
 linux-kernel@...r.kernel.org
Cc: dwmw2@...radead.org, joro@...tes.org, will@...nel.org,
 robin.murphy@....com, longpeng2@...wei.com, graf@...zon.de,
 nsaenz@...zon.com, nh-open-source@...zon.com, stable@...r.kernel.org
Subject: Re: [PATCH] iommu/intel: Fix __domain_mapping()'s usage of
 switch_to_super_page()

On 8/26/25 22:38, Eugene Koira wrote:
> switch_to_super_page() assumes the memory range it's working on is aligned
> to the target large page level. Unfortunately, __domain_mapping() doesn't
> take this into account when using it, and will pass unaligned ranges
> ultimately freeing a PTE range larger than expected.
> 
> Take for example a mapping with the following iov_pfn range [0x3fe400,
> 0x4c0600], which should be backed by the following mappings:
> 
>     iov_pfn [0x3fe400, 0x3fffff] covered by 2MiB pages
>     iov_pfn [0x400000, 0x4bffff] covered by 1GiB pages
>     iov_pfn [0x4c0000, 0x4c05ff] covered by 2MiB pages
> 
> Under this circumstance, __domain_mapping() will pass [0x400000, 0x4c05ff]
> to switch_to_super_page() at a 1 GiB granularity, which will in turn
> free PTEs all the way to iov_pfn 0x4fffff.
> 
> Mitigate this by rounding down the iov_pfn range passed to
> switch_to_super_page() in __domain_mapping()
> to the target large page level.
> 
> Additionally add range alignment checks to switch_to_super_page.
> 
> Fixes: 9906b9352a35 ("iommu/vt-d: Avoid duplicate removing in __domain_mapping()")
> Signed-off-by: Eugene Koira<eugkoira@...zon.com>
> Cc:stable@...r.kernel.org
> ---
>   drivers/iommu/intel/iommu.c | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)

Queued for v6.17-rc. Thank you!

Thanks,
baolu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ