Re: [edk2] [PATCH] ArmPkg/ArmMmuLib ARM: disregard high memory when setting permissions

2019-01-14 Thread Ard Biesheuvel
On Mon, 14 Jan 2019 at 12:43, Leif Lindholm  wrote:
>
> On Mon, Jan 07, 2019 at 07:56:49AM +0100, Ard Biesheuvel wrote:
> > Ignore calls to ArmSetMemoryAttributes () when the region described
> > is outside of the 32-bit addressable range. This memory is not
> > mapped in the first place, and the current code does not deal with
> > the high bits correctly, resulting in hangs.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Ard Biesheuvel 
>
> Reviewed-by: Leif Lindholm 
>

Thanks

Pushed as e695e44545b4..d08575759e5a

> > ---
> >  ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c | 4 
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c 
> > b/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c
> > index 3b3b20aa9b78..bffab83d4fd0 100644
> > --- a/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c
> > +++ b/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c
> > @@ -744,6 +744,10 @@ ArmSetMemoryAttributes (
> >UINT64ChunkLength;
> >BOOLEAN   FlushTlbs;
> >
> > +  if (BaseAddress > (UINT64)MAX_ADDRESS - Length + 1) {
> > +return EFI_UNSUPPORTED;
> > +  }
> > +
> >if (Length == 0) {
> >  return EFI_SUCCESS;
> >}
> > --
> > 2.20.1
> >
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ArmPkg/ArmMmuLib ARM: disregard high memory when setting permissions

2019-01-14 Thread Leif Lindholm
On Mon, Jan 07, 2019 at 07:56:49AM +0100, Ard Biesheuvel wrote:
> Ignore calls to ArmSetMemoryAttributes () when the region described
> is outside of the 32-bit addressable range. This memory is not
> mapped in the first place, and the current code does not deal with
> the high bits correctly, resulting in hangs.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel 

Reviewed-by: Leif Lindholm 

> ---
>  ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c 
> b/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c
> index 3b3b20aa9b78..bffab83d4fd0 100644
> --- a/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c
> +++ b/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c
> @@ -744,6 +744,10 @@ ArmSetMemoryAttributes (
>UINT64ChunkLength;
>BOOLEAN   FlushTlbs;
>  
> +  if (BaseAddress > (UINT64)MAX_ADDRESS - Length + 1) {
> +return EFI_UNSUPPORTED;
> +  }
> +
>if (Length == 0) {
>  return EFI_SUCCESS;
>}
> -- 
> 2.20.1
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH] ArmPkg/ArmMmuLib ARM: disregard high memory when setting permissions

2019-01-06 Thread Ard Biesheuvel
Ignore calls to ArmSetMemoryAttributes () when the region described
is outside of the 32-bit addressable range. This memory is not
mapped in the first place, and the current code does not deal with
the high bits correctly, resulting in hangs.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel 
---
 ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c 
b/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c
index 3b3b20aa9b78..bffab83d4fd0 100644
--- a/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c
+++ b/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c
@@ -744,6 +744,10 @@ ArmSetMemoryAttributes (
   UINT64ChunkLength;
   BOOLEAN   FlushTlbs;
 
+  if (BaseAddress > (UINT64)MAX_ADDRESS - Length + 1) {
+return EFI_UNSUPPORTED;
+  }
+
   if (Length == 0) {
 return EFI_SUCCESS;
   }
-- 
2.20.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel