summaryrefslogtreecommitdiff
path: root/src/boot
diff options
context:
space:
mode:
authorJan Janssen <medhefgo@web.de>2023-05-02 19:41:58 +0200
committerLuca Boccassi <luca.boccassi@gmail.com>2023-05-02 22:38:15 +0100
commitec232e4abd7aebfec06b4814b30129532b2bcefd (patch)
tree004039e5e0a9b15ec70ee498782f99c17e303aca /src/boot
parent845824acddf2e7e08c94afe7cfee6e50a682c947 (diff)
downloadsystemd-ec232e4abd7aebfec06b4814b30129532b2bcefd.tar.gz
boot: Use correct memory type for allocations
We were using the wrong memory type when allocating pool memory. This does not seem to cause a problem on x86, but the kernel will fail to boot at least on ARM in QEMU. This is caused by mixing different allocation types which ended up breaking the kernel or EDK2 during boot services exit. Commit 2f3c3b0bee5534f2338439f04b0aa517479f8b76 appears to fix this boot failure because it was replacing the gnu-efi xpool_print with xasprintf thereby unifying the allocation type. But this same issue can also happen without this fix somehow when the random-seed logic is in use. Fixes: #27371
Diffstat (limited to 'src/boot')
-rw-r--r--src/boot/efi/util.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/boot/efi/util.h b/src/boot/efi/util.h
index 9df7b4a2d4..9058918a93 100644
--- a/src/boot/efi/util.h
+++ b/src/boot/efi/util.h
@@ -28,7 +28,7 @@ static inline void freep(void *p) {
_malloc_ _alloc_(1) _returns_nonnull_ _warn_unused_result_
static inline void *xmalloc(size_t size) {
void *p;
- assert_se(BS->AllocatePool(EfiBootServicesData, size, &p) == EFI_SUCCESS);
+ assert_se(BS->AllocatePool(EfiLoaderData, size, &p) == EFI_SUCCESS);
return p;
}