freeipmi: patch CVE-2026-50031

Backport patches fixing bugs[1][2] associated with the CVE.

Details:
https://nvd.nist.gov/vuln/detail/cve-2026-50031

[1] https://savannah.gnu.org/bugs/index.php?68363
[2] https://savannah.gnu.org/bugs/index.php?68364

Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com>
Signed-off-by: Anuj Mittal <anuj.mittal@oss.qualcomm.com>
This commit is contained in:
Ankur Tyagi
2026-09-15 07:51:58 +05:30
committed by Anuj Mittal
parent 34d752b5d7
commit 7dcff13591
3 changed files with 70 additions and 1 deletions
@@ -0,0 +1,33 @@
From 651119e671c7a64e72a79218f87b9f397037383b Mon Sep 17 00:00:00 2001
From: Albert Chu <chu11@llnl.gov>
Date: Tue, 19 May 2026 14:44:41 -0700
Subject: [PATCH] ipmi-oem: fix potential stack corruption
Problem: A buffer was incorrectly defined with a length of 256 bytes
when it should have been 65536 bytes.
Update the buffer length.
CVE: CVE-2026-50031
Upstream-Status: Backport [https://cgit.git.savannah.gnu.org/cgit/freeipmi.git/commit/?id=f49a6076b640d802a9a80064089e772b4baa5335]
Dropped changes done to the ChangeLog file.
Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com>
---
ipmi-oem/ipmi-oem-dell.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ipmi-oem/ipmi-oem-dell.c b/ipmi-oem/ipmi-oem-dell.c
index cf3bad244..f322cdfb8 100644
--- a/ipmi-oem/ipmi-oem-dell.c
+++ b/ipmi-oem/ipmi-oem-dell.c
@@ -4207,7 +4207,7 @@ ipmi_oem_dell_set_web_server_config (ipmi_oem_state_data_t *state_data)
int
ipmi_oem_dell_get_active_directory_config (ipmi_oem_state_data_t *state_data)
{
- uint8_t token_data[IPMI_OEM_MAX_BYTES];
+ uint8_t token_data[IPMI_OEM_DELL_TOKEN_DATA_MAX];
uint16_t expected_valid_field_mask = IPMI_OEM_DELL_EXTENDED_CONFIG_AD_CONFIGURATION_ALL_FIELD_MASK;
unsigned int token_data_read = 0;
unsigned int min_token_data_read = 0;
@@ -0,0 +1,33 @@
From 1a7113599aa8926f133b5686c7e9b460d009a4e0 Mon Sep 17 00:00:00 2001
From: Albert Chu <chu11@llnl.gov>
Date: Tue, 19 May 2026 15:53:50 -0700
Subject: [PATCH] ipmi-oem: fix potential stack overflow
Problem: A buffer could incorrectly be overflowed in a fujitsu
command.
Add a guardrail to ensure no overflow.
CVE: CVE-2026-50031
Upstream-Status: Backport [https://cgit.git.savannah.gnu.org/cgit/freeipmi.git/commit/?id=60dd7014c0b1402c881ef389f4e79ebb7a9e26c4]
Dropped changes to the ChangeLog file.
Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com>
---
ipmi-oem/ipmi-oem-fujitsu.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/ipmi-oem/ipmi-oem-fujitsu.c b/ipmi-oem/ipmi-oem-fujitsu.c
index 2f505229f..10220c9fc 100644
--- a/ipmi-oem/ipmi-oem-fujitsu.c
+++ b/ipmi-oem/ipmi-oem-fujitsu.c
@@ -1384,6 +1384,8 @@ ipmi_oem_fujitsu_get_sel_entry_long_text (ipmi_oem_state_data_t *state_data)
}
data_length = bytes_rs[15];
+ if (data_length > IPMI_OEM_FUJITSU_SEL_ENTRY_LONG_TEXT_MAX_DATA_LENGTH)
+ data_length = IPMI_OEM_FUJITSU_SEL_ENTRY_LONG_TEXT_MAX_DATA_LENGTH;
/* Every response should be NUL terminated, not just the last
* component.
@@ -13,7 +13,10 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
file://COPYING.pstdout;md5=d32239bcb673463ab874e80d47fae504 \
file://COPYING.sunbmc;md5=c03f21cd76ff5caba6b890d1213cbfbb"
SRC_URI = "${GNU_MIRROR}/freeipmi/freeipmi-${PV}.tar.gz"
SRC_URI = "${GNU_MIRROR}/freeipmi/freeipmi-${PV}.tar.gz \
file://CVE-2026-50031-1.patch \
file://CVE-2026-50031-2.patch \
"
SRC_URI[sha256sum] = "16783d10faa28847a795cce0bf86deeaa72b8fbe71d1f0dc1101d13a6b501ec1"
DEPENDS = "libgcrypt"