grub2/0287-term-ns8250-return-in-case-of-a-null-SPCR-base-addre.patch
Leo Sandoval b9f070c2f2 Add Several CVE fixes
Resolves: CVE-2024-45781 CVE-2024-45783 CVE-2024-45778
Resolves: CVE-2024-45775 CVE-2024-45780 CVE-2024-45774
Resolves: CVE-2025-0690 CVE-2025-1118 CVE-2024-45782
Resolves: CVE-2025-0624 CVE-2024-45779 CVE-2024-45776
Resolves: CVE-2025-0622 CVE-2025-0677
Resolves: #RHEL-80691
Resolves: #RHEL-80690
Resolves: #RHEL-80689
Resolves: #RHEL-80687
Resolves: #RHEL-80686

Signed-off-by: Leo Sandoval <lsandova@redhat.com>
Signed-off-by: Nicolas Frayer <nfrayer@redhat.com>
2025-02-25 11:59:31 -06:00

30 lines
1018 B
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Leo Sandoval <lsandova@redhat.com>
Date: Wed, 8 Jan 2025 10:24:26 -0600
Subject: [PATCH] term/ns8250: return in case of a null SPCR base addresses
Serial SPCR MMIO null address are invalid, so return from function, otherwise
invalid 'mmio,0' port names are generated halting the system when running
terminal_input|output commands.
Resolves: #RHEL-68622
Signed-off-by: Leo Sandoval <lsandova@redhat.com>
---
grub-core/term/ns8250.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/grub-core/term/ns8250.c b/grub-core/term/ns8250.c
index 23e8e0904..4ac0bc06a 100644
--- a/grub-core/term/ns8250.c
+++ b/grub-core/term/ns8250.c
@@ -407,6 +407,9 @@ grub_serial_ns8250_add_mmio (grub_addr_t addr, unsigned int acc_size,
struct grub_serial_port *p;
unsigned i;
+ if (addr == NULL)
+ return NULL;
+
for (i = 0; i < GRUB_SERIAL_PORT_NUM; i++)
if (com_ports[i].use_mmio == true && com_ports[i].mmio.base == addr)
{