diff options
-rw-r--r-- | meta-networking/recipes-extended/corosync/corosync/CVE-2025-30472.patch | 69 | ||||
-rw-r--r-- | meta-networking/recipes-extended/corosync/corosync_3.1.9.bb | 1 |
2 files changed, 70 insertions, 0 deletions
diff --git a/meta-networking/recipes-extended/corosync/corosync/CVE-2025-30472.patch b/meta-networking/recipes-extended/corosync/corosync/CVE-2025-30472.patch new file mode 100644 index 0000000000..9b36dbe3fb --- /dev/null +++ b/meta-networking/recipes-extended/corosync/corosync/CVE-2025-30472.patch | |||
@@ -0,0 +1,69 @@ | |||
1 | From 7839990f9cdf34e55435ed90109e82709032466a Mon Sep 17 00:00:00 2001 | ||
2 | From: Jan Friesse <jfriesse@redhat.com> | ||
3 | Date: Mon, 24 Mar 2025 12:05:08 +0100 | ||
4 | Subject: [PATCH] totemsrp: Check size of orf_token msg | ||
5 | |||
6 | orf_token message is stored into preallocated array on endian convert | ||
7 | so carefully crafted malicious message can lead to crash of corosync. | ||
8 | |||
9 | Solution is to check message size beforehand. | ||
10 | |||
11 | Signed-off-by: Jan Friesse <jfriesse@redhat.com> | ||
12 | Reviewed-by: Christine Caulfield <ccaulfie@redhat.com> | ||
13 | |||
14 | CVE: CVE-2025-30472 | ||
15 | Upstream-Status: Backport [https://github.com/corosync/corosync/commits/7839990f9cdf34e55435ed90109e82709032466a] | ||
16 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
17 | --- | ||
18 | exec/totemsrp.c | 18 +++++++++++++++++- | ||
19 | 1 file changed, 17 insertions(+), 1 deletion(-) | ||
20 | |||
21 | diff --git a/exec/totemsrp.c b/exec/totemsrp.c | ||
22 | index 962d0e2a..364528ce 100644 | ||
23 | --- a/exec/totemsrp.c | ||
24 | +++ b/exec/totemsrp.c | ||
25 | @@ -3679,12 +3679,20 @@ static int check_orf_token_sanity( | ||
26 | const struct totemsrp_instance *instance, | ||
27 | const void *msg, | ||
28 | size_t msg_len, | ||
29 | + size_t max_msg_len, | ||
30 | int endian_conversion_needed) | ||
31 | { | ||
32 | int rtr_entries; | ||
33 | const struct orf_token *token = (const struct orf_token *)msg; | ||
34 | size_t required_len; | ||
35 | |||
36 | + if (msg_len > max_msg_len) { | ||
37 | + log_printf (instance->totemsrp_log_level_security, | ||
38 | + "Received orf_token message is too long... ignoring."); | ||
39 | + | ||
40 | + return (-1); | ||
41 | + } | ||
42 | + | ||
43 | if (msg_len < sizeof(struct orf_token)) { | ||
44 | log_printf (instance->totemsrp_log_level_security, | ||
45 | "Received orf_token message is too short... ignoring."); | ||
46 | @@ -3698,6 +3706,13 @@ static int check_orf_token_sanity( | ||
47 | rtr_entries = token->rtr_list_entries; | ||
48 | } | ||
49 | |||
50 | + if (rtr_entries > RETRANSMIT_ENTRIES_MAX) { | ||
51 | + log_printf (instance->totemsrp_log_level_security, | ||
52 | + "Received orf_token message rtr_entries is corrupted... ignoring."); | ||
53 | + | ||
54 | + return (-1); | ||
55 | + } | ||
56 | + | ||
57 | required_len = sizeof(struct orf_token) + rtr_entries * sizeof(struct rtr_item); | ||
58 | if (msg_len < required_len) { | ||
59 | log_printf (instance->totemsrp_log_level_security, | ||
60 | @@ -3868,7 +3883,8 @@ static int message_handler_orf_token ( | ||
61 | "Time since last token %0.4f ms", tv_diff / (float)QB_TIME_NS_IN_MSEC); | ||
62 | #endif | ||
63 | |||
64 | - if (check_orf_token_sanity(instance, msg, msg_len, endian_conversion_needed) == -1) { | ||
65 | + if (check_orf_token_sanity(instance, msg, msg_len, sizeof(token_storage), | ||
66 | + endian_conversion_needed) == -1) { | ||
67 | return (0); | ||
68 | } | ||
69 | |||
diff --git a/meta-networking/recipes-extended/corosync/corosync_3.1.9.bb b/meta-networking/recipes-extended/corosync/corosync_3.1.9.bb index af023307bb..1699701c9d 100644 --- a/meta-networking/recipes-extended/corosync/corosync_3.1.9.bb +++ b/meta-networking/recipes-extended/corosync/corosync_3.1.9.bb | |||
@@ -9,6 +9,7 @@ inherit autotools pkgconfig systemd github-releases | |||
9 | 9 | ||
10 | SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/${BP}.tar.gz \ | 10 | SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/${BP}.tar.gz \ |
11 | file://corosync.conf \ | 11 | file://corosync.conf \ |
12 | file://CVE-2025-30472.patch \ | ||
12 | " | 13 | " |
13 | SRC_URI[sha256sum] = "203354bbddee1a97b3c50a076eae89c635f406dd674ccaefc94bb9092acd9535" | 14 | SRC_URI[sha256sum] = "203354bbddee1a97b3c50a076eae89c635f406dd674ccaefc94bb9092acd9535" |
14 | UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)" | 15 | UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)" |