From 7dcff135913bbeb47e4ffd14f429622a580c1287 Mon Sep 17 00:00:00 2001 From: Ankur Tyagi Date: Wed, 2 Sep 2026 22:04:59 +1200 Subject: [PATCH] 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 Signed-off-by: Anuj Mittal --- .../freeipmi/freeipmi/CVE-2026-50031-1.patch | 33 +++++++++++++++++++ .../freeipmi/freeipmi/CVE-2026-50031-2.patch | 33 +++++++++++++++++++ .../freeipmi/freeipmi_1.6.17.bb | 5 ++- 3 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 meta-oe/recipes-support/freeipmi/freeipmi/CVE-2026-50031-1.patch create mode 100644 meta-oe/recipes-support/freeipmi/freeipmi/CVE-2026-50031-2.patch diff --git a/meta-oe/recipes-support/freeipmi/freeipmi/CVE-2026-50031-1.patch b/meta-oe/recipes-support/freeipmi/freeipmi/CVE-2026-50031-1.patch new file mode 100644 index 0000000000..e73368f473 --- /dev/null +++ b/meta-oe/recipes-support/freeipmi/freeipmi/CVE-2026-50031-1.patch @@ -0,0 +1,33 @@ +From 651119e671c7a64e72a79218f87b9f397037383b Mon Sep 17 00:00:00 2001 +From: Albert Chu +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 +--- + 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; diff --git a/meta-oe/recipes-support/freeipmi/freeipmi/CVE-2026-50031-2.patch b/meta-oe/recipes-support/freeipmi/freeipmi/CVE-2026-50031-2.patch new file mode 100644 index 0000000000..b44799cffc --- /dev/null +++ b/meta-oe/recipes-support/freeipmi/freeipmi/CVE-2026-50031-2.patch @@ -0,0 +1,33 @@ +From 1a7113599aa8926f133b5686c7e9b460d009a4e0 Mon Sep 17 00:00:00 2001 +From: Albert Chu +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 +--- + 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. diff --git a/meta-oe/recipes-support/freeipmi/freeipmi_1.6.17.bb b/meta-oe/recipes-support/freeipmi/freeipmi_1.6.17.bb index 7970e0f563..f612caf3ac 100644 --- a/meta-oe/recipes-support/freeipmi/freeipmi_1.6.17.bb +++ b/meta-oe/recipes-support/freeipmi/freeipmi_1.6.17.bb @@ -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"