diff options
| author | Peter Marko <peter.marko@siemens.com> | 2025-05-20 22:20:29 +0200 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2025-06-02 10:26:30 -0700 |
| commit | fdb3f69e746ea2a3e37811bd627352bb9cb28af4 (patch) | |
| tree | 10440590761c9b9e1b8b3194b514b2f547b7cc46 /meta | |
| parent | 577bbcd237a9095fce8fe9a921626dddf5b3b86c (diff) | |
| download | poky-fdb3f69e746ea2a3e37811bd627352bb9cb28af4.tar.gz | |
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>
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/recipes-connectivity/ofono/ofono/CVE-2024-7537.patch | 59 | ||||
| -rw-r--r-- | meta/recipes-connectivity/ofono/ofono_2.15.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..4a7cd12297 --- /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 | @@ -442,6 +442,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 | @@ -451,7 +453,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 | @@ -460,6 +462,13 @@ static void get_msg_list_cb(struct qmi_result *result, void *user_data) | ||
| 38 | cnt = L_LE32_TO_CPU(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 | L_LE32_TO_CPU(list->msg[tmp].ndx)); | ||
| 51 | @@ -473,8 +482,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 = l_malloc(sizeof(list->cnt) + msg_size); | ||
| 58 | data->msg_list->cnt = cnt; | ||
| 59 | memcpy(data->msg_list->msg, list->msg, msg_size); | ||
diff --git a/meta/recipes-connectivity/ofono/ofono_2.15.bb b/meta/recipes-connectivity/ofono/ofono_2.15.bb index 40eeb3a086..07d7ac6095 100644 --- a/meta/recipes-connectivity/ofono/ofono_2.15.bb +++ b/meta/recipes-connectivity/ofono/ofono_2.15.bb | |||
| @@ -9,6 +9,7 @@ DEPENDS = "dbus glib-2.0 udev mobile-broadband-provider-info ell" | |||
| 9 | 9 | ||
| 10 | SRC_URI = "${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \ | 10 | SRC_URI = "${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \ |
| 11 | file://ofono \ | 11 | file://ofono \ |
| 12 | file://CVE-2024-7537.patch \ | ||
| 12 | " | 13 | " |
| 13 | SRC_URI[sha256sum] = "1af93ab72a70502452fe3d0297a6eaea13750cacae1fff3b643dd2245a6408ca" | 14 | SRC_URI[sha256sum] = "1af93ab72a70502452fe3d0297a6eaea13750cacae1fff3b643dd2245a6408ca" |
| 14 | 15 | ||
