mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] efi: payload: entry-single: memory need to be alloccated as data.
@ 2025-09-14 19:25 chalianis1
  2025-09-15  8:39 ` Ahmad Fatoum
  2025-09-15  8:47 ` Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: chalianis1 @ 2025-09-14 19:25 UTC (permalink / raw)
  To: s.hauer; +Cc: barebox, Chali Anis

From: Chali Anis <chalianis1@gmail.com>

The entry single is used in x86, this memory allocation need to be set to
data since it is used to initialise the malloc memory. set all this region
to loader code could represent a security issue since we autorise memory
execution.

Fixes: 7497c86c5032 ("efi: payload: early-mem: add memory type on early mem allocation")
Signed-off-by: Chali Anis <chalianis1@gmail.com>
---
 efi/payload/entry-single.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/efi/payload/entry-single.c b/efi/payload/entry-single.c
index b7171bb24bfa..8600bd845c49 100644
--- a/efi/payload/entry-single.c
+++ b/efi/payload/entry-single.c
@@ -37,7 +37,7 @@ void efi_main(efi_handle_t image, struct efi_system_table *sys_table)
 		BS->handle_protocol(efi_loaded_image->device_handle,
 				&efi_device_path_protocol_guid, (void **)&efi_device_path);
 
-	mem = efi_earlymem_alloc(sys_table, &memsize, EFI_LOADER_CODE);
+	mem = efi_earlymem_alloc(sys_table, &memsize, EFI_LOADER_DATA);
 
 	mem_malloc_init(mem, mem + memsize - 1);
 
-- 
2.34.1




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

* Re: [PATCH] efi: payload: entry-single: memory need to be alloccated as data.
  2025-09-14 19:25 [PATCH] efi: payload: entry-single: memory need to be alloccated as data chalianis1
@ 2025-09-15  8:39 ` Ahmad Fatoum
  2025-09-15  8:47 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2025-09-15  8:39 UTC (permalink / raw)
  To: chalianis1, s.hauer; +Cc: barebox

Hi,

On 9/14/25 9:25 PM, chalianis1@gmail.com wrote:
> From: Chali Anis <chalianis1@gmail.com>
> 
> The entry single is used in x86, this memory allocation need to be set to
> data since it is used to initialise the malloc memory. set all this region
> to loader code could represent a security issue since we autorise memory
> execution.
> 
> Fixes: 7497c86c5032 ("efi: payload: early-mem: add memory type on early mem allocation")
> Signed-off-by: Chali Anis <chalianis1@gmail.com>

Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

Thanks,
Ahmad

> ---
>  efi/payload/entry-single.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/efi/payload/entry-single.c b/efi/payload/entry-single.c
> index b7171bb24bfa..8600bd845c49 100644
> --- a/efi/payload/entry-single.c
> +++ b/efi/payload/entry-single.c
> @@ -37,7 +37,7 @@ void efi_main(efi_handle_t image, struct efi_system_table *sys_table)
>  		BS->handle_protocol(efi_loaded_image->device_handle,
>  				&efi_device_path_protocol_guid, (void **)&efi_device_path);
>  
> -	mem = efi_earlymem_alloc(sys_table, &memsize, EFI_LOADER_CODE);
> +	mem = efi_earlymem_alloc(sys_table, &memsize, EFI_LOADER_DATA);
>  
>  	mem_malloc_init(mem, mem + memsize - 1);
>  

-- 
Pengutronix e.K.                  |                             |
Steuerwalder Str. 21              | http://www.pengutronix.de/  |
31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |




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

* Re: [PATCH] efi: payload: entry-single: memory need to be alloccated as data.
  2025-09-14 19:25 [PATCH] efi: payload: entry-single: memory need to be alloccated as data chalianis1
  2025-09-15  8:39 ` Ahmad Fatoum
@ 2025-09-15  8:47 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2025-09-15  8:47 UTC (permalink / raw)
  To: chalianis1; +Cc: barebox


On Sun, 14 Sep 2025 15:25:31 -0400, chalianis1@gmail.com wrote:
> The entry single is used in x86, this memory allocation need to be set to
> data since it is used to initialise the malloc memory. set all this region
> to loader code could represent a security issue since we autorise memory
> execution.
> 
> 

Applied, thanks!

[1/1] efi: payload: entry-single: memory need to be alloccated as data.
      https://git.pengutronix.de/cgit/barebox/commit/?id=3366e9e04a28 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




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

end of thread, other threads:[~2025-09-15  8:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-14 19:25 [PATCH] efi: payload: entry-single: memory need to be alloccated as data chalianis1
2025-09-15  8:39 ` Ahmad Fatoum
2025-09-15  8:47 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox