public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Leif Lindholm" <quic_llindhol@quicinc.com>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: <devel@edk2.groups.io>, Sami Mujawar <sami.mujawar@arm.com>,
	Sumit Garg <sumit.garg@linaro.org>
Subject: Re: [PATCH 3/3] ArmPkg/OpteeLib: Map shared communication buffer non-executable
Date: Mon, 26 Jun 2023 18:46:40 +0100	[thread overview]
Message-ID: <ZJnPAEyT5cYsZnPX@qc-i7.hemma.eciton.net> (raw)
In-Reply-To: <20230626083644.1011698-4-ardb@kernel.org>

On Mon, Jun 26, 2023 at 10:36:44 +0200, Ard Biesheuvel wrote:
> The OP-TEE secure OS exposes a non-secure memory region for
> communication between the secure OS itself and any clients in the
> non-secure firmware. This memory is writable by non-secure and is not
> used for code only data, and so it should be mapped non-executable.
> 
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>

This looks straightforward enough (and an important safety
improvement), but adding Sumit on cc as original author.

>From my side, for the series:
Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>

> ---
>  ArmPkg/Library/OpteeLib/Optee.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/ArmPkg/Library/OpteeLib/Optee.c b/ArmPkg/Library/OpteeLib/Optee.c
> index 46464f17ef06653e..3acf172b68a2d34c 100644
> --- a/ArmPkg/Library/OpteeLib/Optee.c
> +++ b/ArmPkg/Library/OpteeLib/Optee.c
> @@ -86,7 +86,12 @@ OpteeSharedMemoryRemap (
>      return EFI_BUFFER_TOO_SMALL;
>    }
>  
> -  Status = ArmSetMemoryAttributes (PhysicalAddress, Size, EFI_MEMORY_WB, 0);
> +  Status = ArmSetMemoryAttributes (
> +             PhysicalAddress,
> +             Size,
> +             EFI_MEMORY_WB | EFI_MEMORY_XP,
> +             0
> +             );
>    if (EFI_ERROR (Status)) {
>      return Status;
>    }
> -- 
> 2.39.2
> 

      reply	other threads:[~2023-06-26 17:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-26  8:36 [PATCH 0/3] ArmPkg: some memory attribute lib followup changes Ard Biesheuvel
2023-06-26  8:36 ` [PATCH 1/3] StandaloneMmPkg: Include correct MmuLib header Ard Biesheuvel
2023-06-26  8:36 ` [PATCH 2/3] ArmPkg: Drop individual memory permission helpers Ard Biesheuvel
2023-06-26  8:36 ` [PATCH 3/3] ArmPkg/OpteeLib: Map shared communication buffer non-executable Ard Biesheuvel
2023-06-26 17:46   ` Leif Lindholm [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZJnPAEyT5cYsZnPX@qc-i7.hemma.eciton.net \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox