mirror of
https://git.yoctoproject.org/poky
synced 2026-02-13 04:03:03 +01:00
ofono: patch CVE-2024-7537
Pick commit https://web.git.kernel.org/pub/scm/network/ofono/ofono.git/commit/?id=e6d8d526d5077c0b6ab459efeb6b882c28e0fdeb (From OE-Core rev: 9ab0da6f0564787b753aedb90ea437b135243bdf) Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
This commit is contained in:
committed by
Steve Sakoman
parent
577bbcd237
commit
fdb3f69e74
59
meta/recipes-connectivity/ofono/ofono/CVE-2024-7537.patch
Normal file
59
meta/recipes-connectivity/ofono/ofono/CVE-2024-7537.patch
Normal file
@@ -0,0 +1,59 @@
|
||||
From e6d8d526d5077c0b6ab459efeb6b882c28e0fdeb Mon Sep 17 00:00:00 2001
|
||||
From: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
|
||||
Date: Sun, 16 Mar 2025 12:26:42 +0200
|
||||
Subject: [PATCH] qmi: sms: Fix possible out-of-bounds read
|
||||
|
||||
Fixes: CVE-2024-7537
|
||||
|
||||
CVE: CVE-2024-7537
|
||||
Upstream-Status: Backport [https://web.git.kernel.org/pub/scm/network/ofono/ofono.git/commit/?id=e6d8d526d5077c0b6ab459efeb6b882c28e0fdeb]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
drivers/qmimodem/sms.c | 13 ++++++++++---
|
||||
1 file changed, 10 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/drivers/qmimodem/sms.c b/drivers/qmimodem/sms.c
|
||||
index 3e2bef6e..75863480 100644
|
||||
--- a/drivers/qmimodem/sms.c
|
||||
+++ b/drivers/qmimodem/sms.c
|
||||
@@ -442,6 +442,8 @@ static void get_msg_list_cb(struct qmi_result *result, void *user_data)
|
||||
const struct qmi_wms_result_msg_list *list;
|
||||
uint32_t cnt = 0;
|
||||
uint16_t tmp;
|
||||
+ uint16_t length;
|
||||
+ size_t msg_size;
|
||||
|
||||
DBG("");
|
||||
|
||||
@@ -451,7 +453,7 @@ static void get_msg_list_cb(struct qmi_result *result, void *user_data)
|
||||
goto done;
|
||||
}
|
||||
|
||||
- list = qmi_result_get(result, QMI_WMS_RESULT_MSG_LIST, NULL);
|
||||
+ list = qmi_result_get(result, QMI_WMS_RESULT_MSG_LIST, &length);
|
||||
if (list == NULL) {
|
||||
DBG("Err: get msg list empty");
|
||||
goto done;
|
||||
@@ -460,6 +462,13 @@ static void get_msg_list_cb(struct qmi_result *result, void *user_data)
|
||||
cnt = L_LE32_TO_CPU(list->cnt);
|
||||
DBG("msgs found %d", cnt);
|
||||
|
||||
+ msg_size = cnt * sizeof(list->msg[0]);
|
||||
+
|
||||
+ if (length != sizeof(list->cnt) + msg_size) {
|
||||
+ DBG("Err: invalid msg list count");
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
for (tmp = 0; tmp < cnt; tmp++) {
|
||||
DBG("unread type %d ndx %d", list->msg[tmp].type,
|
||||
L_LE32_TO_CPU(list->msg[tmp].ndx));
|
||||
@@ -473,8 +482,6 @@ static void get_msg_list_cb(struct qmi_result *result, void *user_data)
|
||||
|
||||
/* save list and get 1st msg */
|
||||
if (cnt) {
|
||||
- int msg_size = cnt * sizeof(list->msg[0]);
|
||||
-
|
||||
data->msg_list = l_malloc(sizeof(list->cnt) + msg_size);
|
||||
data->msg_list->cnt = cnt;
|
||||
memcpy(data->msg_list->msg, list->msg, msg_size);
|
||||
@@ -9,6 +9,7 @@ DEPENDS = "dbus glib-2.0 udev mobile-broadband-provider-info ell"
|
||||
|
||||
SRC_URI = "${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \
|
||||
file://ofono \
|
||||
file://CVE-2024-7537.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "1af93ab72a70502452fe3d0297a6eaea13750cacae1fff3b643dd2245a6408ca"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user