mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: chalianis1@gmail.com
To: s.hauer@pengutronix.de
Cc: barebox@lists.infradead.org, Chali Anis <chalianis1@gmail.com>
Subject: [PATCH] efi: payload: entry-single: memory need to be alloccated as data.
Date: Sun, 14 Sep 2025 15:25:31 -0400	[thread overview]
Message-ID: <20250914192531.14494-1-chalianis1@gmail.com> (raw)

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




             reply	other threads:[~2025-09-14 19:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-14 19:25 chalianis1 [this message]
2025-09-15  8:39 ` Ahmad Fatoum
2025-09-15  8:47 ` Sascha Hauer

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-all 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=20250914192531.14494-1-chalianis1@gmail.com \
    --to=chalianis1@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /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