diff options
-rw-r--r-- | meta/recipes-connectivity/ofono/ofono/CVE-2024-7537.patch | 59 | ||||
-rw-r--r-- | meta/recipes-connectivity/ofono/ofono_2.4.bb | 1 |
2 files changed, 60 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/ofono/ofono/CVE-2024-7537.patch b/meta/recipes-connectivity/ofono/ofono/CVE-2024-7537.patch new file mode 100644 index 0000000000..6e131121f2 --- /dev/null +++ b/meta/recipes-connectivity/ofono/ofono/CVE-2024-7537.patch | |||
@@ -0,0 +1,59 @@ | |||
1 | From e6d8d526d5077c0b6ab459efeb6b882c28e0fdeb Mon Sep 17 00:00:00 2001 | ||
2 | From: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com> | ||
3 | Date: Sun, 16 Mar 2025 12:26:42 +0200 | ||
4 | Subject: [PATCH] qmi: sms: Fix possible out-of-bounds read | ||
5 | |||
6 | Fixes: CVE-2024-7537 | ||
7 | |||
8 | CVE: CVE-2024-7537 | ||
9 | Upstream-Status: Backport [https://web.git.kernel.org/pub/scm/network/ofono/ofono.git/commit/?id=e6d8d526d5077c0b6ab459efeb6b882c28e0fdeb] | ||
10 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
11 | --- | ||
12 | drivers/qmimodem/sms.c | 13 ++++++++++--- | ||
13 | 1 file changed, 10 insertions(+), 3 deletions(-) | ||
14 | |||
15 | diff --git a/drivers/qmimodem/sms.c b/drivers/qmimodem/sms.c | ||
16 | index 3e2bef6e..75863480 100644 | ||
17 | --- a/drivers/qmimodem/sms.c | ||
18 | +++ b/drivers/qmimodem/sms.c | ||
19 | @@ -467,6 +467,8 @@ static void get_msg_list_cb(struct qmi_result *result, void *user_data) | ||
20 | const struct qmi_wms_result_msg_list *list; | ||
21 | uint32_t cnt = 0; | ||
22 | uint16_t tmp; | ||
23 | + uint16_t length; | ||
24 | + size_t msg_size; | ||
25 | |||
26 | DBG(""); | ||
27 | |||
28 | @@ -476,7 +478,7 @@ static void get_msg_list_cb(struct qmi_result *result, void *user_data) | ||
29 | goto done; | ||
30 | } | ||
31 | |||
32 | - list = qmi_result_get(result, QMI_WMS_RESULT_MSG_LIST, NULL); | ||
33 | + list = qmi_result_get(result, QMI_WMS_RESULT_MSG_LIST, &length); | ||
34 | if (list == NULL) { | ||
35 | DBG("Err: get msg list empty"); | ||
36 | goto done; | ||
37 | @@ -485,6 +487,13 @@ static void get_msg_list_cb(struct qmi_result *result, void *user_data) | ||
38 | cnt = GUINT32_FROM_LE(list->cnt); | ||
39 | DBG("msgs found %d", cnt); | ||
40 | |||
41 | + msg_size = cnt * sizeof(list->msg[0]); | ||
42 | + | ||
43 | + if (length != sizeof(list->cnt) + msg_size) { | ||
44 | + DBG("Err: invalid msg list count"); | ||
45 | + goto done; | ||
46 | + } | ||
47 | + | ||
48 | for (tmp = 0; tmp < cnt; tmp++) { | ||
49 | DBG("unread type %d ndx %d", list->msg[tmp].type, | ||
50 | GUINT32_FROM_LE(list->msg[tmp].ndx)); | ||
51 | @@ -498,8 +507,6 @@ static void get_msg_list_cb(struct qmi_result *result, void *user_data) | ||
52 | |||
53 | /* save list and get 1st msg */ | ||
54 | if (cnt) { | ||
55 | - int msg_size = cnt * sizeof(list->msg[0]); | ||
56 | - | ||
57 | data->msg_list = g_try_malloc0(sizeof(list->cnt) + msg_size); | ||
58 | if (data->msg_list == NULL) | ||
59 | goto done; | ||
diff --git a/meta/recipes-connectivity/ofono/ofono_2.4.bb b/meta/recipes-connectivity/ofono/ofono_2.4.bb index 5ae63e6ef6..2cf6438117 100644 --- a/meta/recipes-connectivity/ofono/ofono_2.4.bb +++ b/meta/recipes-connectivity/ofono/ofono_2.4.bb | |||
@@ -25,6 +25,7 @@ SRC_URI = "\ | |||
25 | file://CVE-2024-7540_CVE-2024-7541_CVE-2024-7542.patch \ | 25 | file://CVE-2024-7540_CVE-2024-7541_CVE-2024-7542.patch \ |
26 | file://CVE-2023-4232.patch \ | 26 | file://CVE-2023-4232.patch \ |
27 | file://CVE-2023-4235.patch \ | 27 | file://CVE-2023-4235.patch \ |
28 | file://CVE-2024-7537.patch \ | ||
28 | " | 29 | " |
29 | SRC_URI[sha256sum] = "93580adc1afd1890dc516efb069de0c5cdfef014415256ddfb28ab172df2d11d" | 30 | SRC_URI[sha256sum] = "93580adc1afd1890dc516efb069de0c5cdfef014415256ddfb28ab172df2d11d" |
30 | 31 | ||