All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen/arm/acpi: Crash when unmapping from the ACPI fixmap area
@ 2026-12-02 10:05 Hirokazu Takahashi
  2026-12-03 11:29 ` Orzel, Michal
  0 siblings, 1 reply; 3+ messages in thread
From: Hirokazu Takahashi @ 2026-12-02 10:05 UTC (permalink / raw)
  To: xen-devel
  Cc: michal.orzel, jbeulich, Hirokazu Takahashi, Stefano Stabellini,
	Julien Grall, Bertrand Marquis, Volodymyr Babchuk

Mapping a very large ACPI table may trigger an ASSERT crash in
__acpi_unmap_table().
This happens because the boundary condition used to validate the
region to be unmapped from the ACPI fixmap area is off by one byte.

Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
---
 xen/arch/arm/acpi/lib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/acpi/lib.c b/xen/arch/arm/acpi/lib.c
index 736cf09eca..026bce9b73 100644
--- a/xen/arch/arm/acpi/lib.c
+++ b/xen/arch/arm/acpi/lib.c
@@ -84,7 +84,7 @@ bool __acpi_unmap_table(const void *ptr, unsigned long size)
     ASSERT((vaddr & PAGE_MASK) == FIXMAP_ADDR(FIX_ACPI_BEGIN));
 
     /* The region allocated fit in the ACPI fixmap region. */
-    ASSERT(size < (FIXMAP_ADDR(FIX_ACPI_END) + PAGE_SIZE - vaddr));
+    ASSERT(size <= (FIXMAP_ADDR(FIX_ACPI_END) + PAGE_SIZE - vaddr));
     ASSERT(fixmap_inuse);
 
     fixmap_inuse = false;
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] xen/arm/acpi: Crash when unmapping from the ACPI fixmap area
  2026-12-02 10:05 [PATCH] xen/arm/acpi: Crash when unmapping from the ACPI fixmap area Hirokazu Takahashi
@ 2026-12-03 11:29 ` Orzel, Michal
  2026-12-04  3:48   ` Hirokazu Takahashi
  0 siblings, 1 reply; 3+ messages in thread
From: Orzel, Michal @ 2026-12-03 11:29 UTC (permalink / raw)
  To: Hirokazu Takahashi, xen-devel
  Cc: jbeulich, Stefano Stabellini, Julien Grall, Bertrand Marquis,
	Volodymyr Babchuk

Title should say what the patch does, so for example:
"xen/arm: acpi: Fix off-by-one in __acpi_unmap_table() ASSERT"

On 02-Dec-26 11:05, Hirokazu Takahashi wrote:
> Mapping a very large ACPI table may trigger an ASSERT crash in
what's a very large table? Please specify the exact condition that ASSERT describes.

> __acpi_unmap_table().
> This happens because the boundary condition used to validate the
> region to be unmapped from the ACPI fixmap area is off by one byte.
> 
> Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
> ---
>  xen/arch/arm/acpi/lib.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/arch/arm/acpi/lib.c b/xen/arch/arm/acpi/lib.c
> index 736cf09eca..026bce9b73 100644
> --- a/xen/arch/arm/acpi/lib.c
> +++ b/xen/arch/arm/acpi/lib.c
> @@ -84,7 +84,7 @@ bool __acpi_unmap_table(const void *ptr, unsigned long size)
>      ASSERT((vaddr & PAGE_MASK) == FIXMAP_ADDR(FIX_ACPI_BEGIN));
>  
>      /* The region allocated fit in the ACPI fixmap region. */
> -    ASSERT(size < (FIXMAP_ADDR(FIX_ACPI_END) + PAGE_SIZE - vaddr));
> +    ASSERT(size <= (FIXMAP_ADDR(FIX_ACPI_END) + PAGE_SIZE - vaddr));
>      ASSERT(fixmap_inuse);
>  
>      fixmap_inuse = false;


Please also add:
Fixes: 4d625ff3c3a9 ("xen/arm: acpi: The fixmap area should always be cleared
during failure/unmap")

With that addressed:
Reviewed-by: Michal Orzel <michal.orzel@amd.com>

~Michal



^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] xen/arm/acpi: Crash when unmapping from the ACPI fixmap area
  2026-12-03 11:29 ` Orzel, Michal
@ 2026-12-04  3:48   ` Hirokazu Takahashi
  0 siblings, 0 replies; 3+ messages in thread
From: Hirokazu Takahashi @ 2026-12-04  3:48 UTC (permalink / raw)
  To: Orzel, Michal, xen-devel@lists.xenproject.org
  Cc: jbeulich@suse.com, Stefano Stabellini, Julien Grall,
	Bertrand Marquis, Volodymyr Babchuk

Hi Michal,

> Subject: Re: [PATCH] xen/arm/acpi: Crash when unmapping from the ACPI
> fixmap area
> 
> Title should say what the patch does, so for example:
> "xen/arm: acpi: Fix off-by-one in __acpi_unmap_table() ASSERT"

Okay.

> On 02-Dec-26 11:05, Hirokazu Takahashi wrote:
> > Mapping a very large ACPI table may trigger an ASSERT crash in
> what's a very large table? Please specify the exact condition that ASSERT
> describes.

An ASSERT is triggered when mapping and unmapping a table large enough
to reach the very end of the ACPI fixmap area.

> > __acpi_unmap_table().
> > This happens because the boundary condition used to validate the
> > region to be unmapped from the ACPI fixmap area is off by one byte.
> >
> > Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
> > ---
> >  xen/arch/arm/acpi/lib.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/xen/arch/arm/acpi/lib.c b/xen/arch/arm/acpi/lib.c
> > index 736cf09eca..026bce9b73 100644
> > --- a/xen/arch/arm/acpi/lib.c
> > +++ b/xen/arch/arm/acpi/lib.c
> > @@ -84,7 +84,7 @@ bool __acpi_unmap_table(const void *ptr, unsigned long
> size)
> >      ASSERT((vaddr & PAGE_MASK) == FIXMAP_ADDR(FIX_ACPI_BEGIN));
> >
> >      /* The region allocated fit in the ACPI fixmap region. */
> > -    ASSERT(size < (FIXMAP_ADDR(FIX_ACPI_END) + PAGE_SIZE - vaddr));
> > +    ASSERT(size <= (FIXMAP_ADDR(FIX_ACPI_END) + PAGE_SIZE - vaddr));
> >      ASSERT(fixmap_inuse);
> >
> >      fixmap_inuse = false;
> 
> 
> Please also add:
> Fixes: 4d625ff3c3a9 ("xen/arm: acpi: The fixmap area should always be cleared
> during failure/unmap")

Okay.

> With that addressed:
> Reviewed-by: Michal Orzel <michal.orzel@amd.com>
> 
> ~Michal

Thank you,
Hirokazu Takahashi.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-12-04  3:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02 10:05 [PATCH] xen/arm/acpi: Crash when unmapping from the ACPI fixmap area Hirokazu Takahashi
2026-12-03 11:29 ` Orzel, Michal
2026-12-04  3:48   ` Hirokazu Takahashi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.