Re: [Patch v3 01/14] x86/ioremap: Fix page aligned size calculation in __ioremap_caller()

From
Dave Hansen <hidden>
Date
2022-11-21 18:16:20
Also in
linux-arch, linux-iommu, linux-pci, lkml, netdev
Reply to
Michael Kelley, 2022-11-16
On 11/16/22 10:41, Michael Kelley wrote:
Current code re-calculates the size after aligning the starting and
ending physical addresses on a page boundary. But the re-calculation
also embeds the masking of high order bits that exceed the size of
the physical address space (via PHYSICAL_PAGE_MASK). If the masking
removes any high order bits, the size calculation results in a huge
value that is likely to immediately fail.

Fix this by re-calculating the page-aligned size first. Then mask any
high order bits using PHYSICAL_PAGE_MASK.

Signed-off-by: Michael Kelley <redacted>
Looks good:

Acked-by: Dave Hansen <dave.hansen@linux.intel.com>

Although I do agree with Boris that this superficially looks like
something that's important to backport.  It would be best to either beef
up the changelog to explain why that's not the case, or to treat this as
an actual fix and submit separately.
Thread (66 messages) 66 messages, 10 authors, last reply 2022-11-30
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help