mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 5.10 1/6] efi: runtime: Fix potential overflow of soft-reserved region size
@ 2024-02-13  0:24 Sasha Levin
  2024-02-13  0:24 ` [PATCH AUTOSEL 5.10 2/6] efi: Don't add memblocks for soft-reserved memory Sasha Levin
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Sasha Levin @ 2024-02-13  0:24 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Andrew Bresticker, Ard Biesheuvel, Sasha Levin, paul.walmsley,
	palmer, aou, linux-efi, linux-riscv

From: Andrew Bresticker <abrestic@rivosinc.com>

[ Upstream commit de1034b38a346ef6be25fe8792f5d1e0684d5ff4 ]

md_size will have been narrowed if we have >= 4GB worth of pages in a
soft-reserved region.

Signed-off-by: Andrew Bresticker <abrestic@rivosinc.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/firmware/efi/arm-runtime.c   | 2 +-
 drivers/firmware/efi/riscv-runtime.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/firmware/efi/arm-runtime.c b/drivers/firmware/efi/arm-runtime.c
index 3359ae2adf24..9054c2852580 100644
--- a/drivers/firmware/efi/arm-runtime.c
+++ b/drivers/firmware/efi/arm-runtime.c
@@ -107,7 +107,7 @@ static int __init arm_enable_runtime_services(void)
 		efi_memory_desc_t *md;
 
 		for_each_efi_memory_desc(md) {
-			int md_size = md->num_pages << EFI_PAGE_SHIFT;
+			u64 md_size = md->num_pages << EFI_PAGE_SHIFT;
 			struct resource *res;
 
 			if (!(md->attribute & EFI_MEMORY_SP))
diff --git a/drivers/firmware/efi/riscv-runtime.c b/drivers/firmware/efi/riscv-runtime.c
index d28e715d2bcc..6711e64eb0b1 100644
--- a/drivers/firmware/efi/riscv-runtime.c
+++ b/drivers/firmware/efi/riscv-runtime.c
@@ -85,7 +85,7 @@ static int __init riscv_enable_runtime_services(void)
 		efi_memory_desc_t *md;
 
 		for_each_efi_memory_desc(md) {
-			int md_size = md->num_pages << EFI_PAGE_SHIFT;
+			u64 md_size = md->num_pages << EFI_PAGE_SHIFT;
 			struct resource *res;
 
 			if (!(md->attribute & EFI_MEMORY_SP))
-- 
2.43.0


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

end of thread, other threads:[~2024-02-13  0:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-13  0:24 [PATCH AUTOSEL 5.10 1/6] efi: runtime: Fix potential overflow of soft-reserved region size Sasha Levin
2024-02-13  0:24 ` [PATCH AUTOSEL 5.10 2/6] efi: Don't add memblocks for soft-reserved memory Sasha Levin
2024-02-13  0:24 ` [PATCH AUTOSEL 5.10 3/6] hwmon: (coretemp) Enlarge per package core count limit Sasha Levin
2024-02-13  0:24 ` [PATCH AUTOSEL 5.10 4/6] scsi: lpfc: Use unsigned type for num_sge Sasha Levin
2024-02-13  0:24 ` [PATCH AUTOSEL 5.10 5/6] firewire: core: send bus reset promptly on gap count error Sasha Levin
2024-02-13  0:24 ` [PATCH AUTOSEL 5.10 6/6] virtio-blk: Ensure no requests in virtqueues before deleting vqs Sasha Levin

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

all inboxes | Powered by JetHome®