diff options
| author | Ankur Tyagi <ankur.tyagi85@gmail.com> | 2025-12-16 12:45:35 +0530 |
|---|---|---|
| committer | Anuj Mittal <anuj.mittal@oss.qualcomm.com> | 2025-12-17 11:45:23 +0530 |
| commit | 788904cef140e7dea251c24747a36e232d773f06 (patch) | |
| tree | 42c072e58de4a6c3de2d71d5f5fbcd21c146666a /meta-networking/recipes-support | |
| parent | 1876b4656d6d3f210f4a3cd806db0ef9a6755eab (diff) | |
| download | meta-openembedded-788904cef140e7dea251c24747a36e232d773f06.tar.gz | |
unbound: patch CVE-2024-43168
Details https://nvd.nist.gov/vuln/detail/CVE-2024-43168
Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com>
Signed-off-by: Anuj Mittal <anuj.mittal@oss.qualcomm.com>
Diffstat (limited to 'meta-networking/recipes-support')
3 files changed, 88 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/unbound/unbound/CVE-2024-43168_1.patch b/meta-networking/recipes-support/unbound/unbound/CVE-2024-43168_1.patch new file mode 100644 index 0000000000..27bb01e596 --- /dev/null +++ b/meta-networking/recipes-support/unbound/unbound/CVE-2024-43168_1.patch | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | From ae1788088e0db0d7a31e9ef4edced212395089c1 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: zhailiangliang <zhailiangliang@loongson.cn> | ||
| 3 | Date: Wed, 3 Apr 2024 15:40:58 +0800 | ||
| 4 | Subject: [PATCH] fix heap-buffer-overflow issue in function cfg_mark_ports of | ||
| 5 | file util/config_file.c | ||
| 6 | |||
| 7 | CVE: CVE-2024-43168 | ||
| 8 | Upstream-Status: Backport [https://github.com/NLnetLabs/unbound/commit/193401e7543a1e561dd634a3eaae932fa462a2b9] | ||
| 9 | (cherry picked from commit 193401e7543a1e561dd634a3eaae932fa462a2b9) | ||
| 10 | Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com> | ||
| 11 | --- | ||
| 12 | util/config_file.c | 4 ++++ | ||
| 13 | 1 file changed, 4 insertions(+) | ||
| 14 | |||
| 15 | diff --git a/util/config_file.c b/util/config_file.c | ||
| 16 | index 147f41e8..724b174c 100644 | ||
| 17 | --- a/util/config_file.c | ||
| 18 | +++ b/util/config_file.c | ||
| 19 | @@ -1776,6 +1776,10 @@ cfg_mark_ports(const char* str, int allow, int* avail, int num) | ||
| 20 | #endif | ||
| 21 | if(!mid) { | ||
| 22 | int port = atoi(str); | ||
| 23 | + if(port < 0) { | ||
| 24 | + log_err("Prevent out-of-bounds access to array avail"); | ||
| 25 | + return 0; | ||
| 26 | + } | ||
| 27 | if(port == 0 && strcmp(str, "0") != 0) { | ||
| 28 | log_err("cannot parse port number '%s'", str); | ||
| 29 | return 0; | ||
diff --git a/meta-networking/recipes-support/unbound/unbound/CVE-2024-43168_2.patch b/meta-networking/recipes-support/unbound/unbound/CVE-2024-43168_2.patch new file mode 100644 index 0000000000..a85200a8c2 --- /dev/null +++ b/meta-networking/recipes-support/unbound/unbound/CVE-2024-43168_2.patch | |||
| @@ -0,0 +1,57 @@ | |||
| 1 | From c9c49b5f3244bde6f4300fc19e56d5944fb25c0c Mon Sep 17 00:00:00 2001 | ||
| 2 | From: "W.C.A. Wijngaards" <wouter@nlnetlabs.nl> | ||
| 3 | Date: Wed, 3 Apr 2024 10:16:18 +0200 | ||
| 4 | Subject: [PATCH] - For #1040: adjust error text and disallow negative ports in | ||
| 5 | other parts of cfg_mark_ports. | ||
| 6 | |||
| 7 | CVE: CVE-2024-43168 | ||
| 8 | Upstream-Status: Backport [https://github.com/NLnetLabs/unbound/commit/dfff8d23cf4145c58e5c1e99d4159d3a91a70ab7] | ||
| 9 | (cherry picked from commit dfff8d23cf4145c58e5c1e99d4159d3a91a70ab7) | ||
| 10 | Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com> | ||
| 11 | --- | ||
| 12 | util/config_file.c | 14 +++++++++++++- | ||
| 13 | 1 file changed, 13 insertions(+), 1 deletion(-) | ||
| 14 | |||
| 15 | diff --git a/util/config_file.c b/util/config_file.c | ||
| 16 | index 724b174c..c403d745 100644 | ||
| 17 | --- a/util/config_file.c | ||
| 18 | +++ b/util/config_file.c | ||
| 19 | @@ -1777,7 +1777,7 @@ cfg_mark_ports(const char* str, int allow, int* avail, int num) | ||
| 20 | if(!mid) { | ||
| 21 | int port = atoi(str); | ||
| 22 | if(port < 0) { | ||
| 23 | - log_err("Prevent out-of-bounds access to array avail"); | ||
| 24 | + log_err("port number is negative: %d", port); | ||
| 25 | return 0; | ||
| 26 | } | ||
| 27 | if(port == 0 && strcmp(str, "0") != 0) { | ||
| 28 | @@ -1789,6 +1789,10 @@ cfg_mark_ports(const char* str, int allow, int* avail, int num) | ||
| 29 | } else { | ||
| 30 | int i, low, high = atoi(mid+1); | ||
| 31 | char buf[16]; | ||
| 32 | + if(high < 0) { | ||
| 33 | + log_err("port number is negative: %d", high); | ||
| 34 | + return 0; | ||
| 35 | + } | ||
| 36 | if(high == 0 && strcmp(mid+1, "0") != 0) { | ||
| 37 | log_err("cannot parse port number '%s'", mid+1); | ||
| 38 | return 0; | ||
| 39 | @@ -1801,10 +1805,18 @@ cfg_mark_ports(const char* str, int allow, int* avail, int num) | ||
| 40 | memcpy(buf, str, (size_t)(mid-str)); | ||
| 41 | buf[mid-str] = 0; | ||
| 42 | low = atoi(buf); | ||
| 43 | + if(low < 0) { | ||
| 44 | + log_err("port number is negative: %d", low); | ||
| 45 | + return 0; | ||
| 46 | + } | ||
| 47 | if(low == 0 && strcmp(buf, "0") != 0) { | ||
| 48 | log_err("cannot parse port number '%s'", buf); | ||
| 49 | return 0; | ||
| 50 | } | ||
| 51 | + if(high > num) { | ||
| 52 | + /* Stop very high values from taking a long time. */ | ||
| 53 | + high = num; | ||
| 54 | + } | ||
| 55 | for(i=low; i<=high; i++) { | ||
| 56 | if(i < num) | ||
| 57 | avail[i] = (allow?i:0); | ||
diff --git a/meta-networking/recipes-support/unbound/unbound_1.19.3.bb b/meta-networking/recipes-support/unbound/unbound_1.19.3.bb index 9a537c2dc2..076f03f2ae 100644 --- a/meta-networking/recipes-support/unbound/unbound_1.19.3.bb +++ b/meta-networking/recipes-support/unbound/unbound_1.19.3.bb | |||
| @@ -14,6 +14,8 @@ SRC_URI = "git://github.com/NLnetLabs/unbound.git;protocol=https;nobranch=1 \ | |||
| 14 | file://CVE-2024-33655.patch \ | 14 | file://CVE-2024-33655.patch \ |
| 15 | file://CVE-2025-11411.patch \ | 15 | file://CVE-2025-11411.patch \ |
| 16 | file://CVE-2024-43167.patch \ | 16 | file://CVE-2024-43167.patch \ |
| 17 | file://CVE-2024-43168_1.patch \ | ||
| 18 | file://CVE-2024-43168_2.patch \ | ||
| 17 | " | 19 | " |
| 18 | SRCREV = "48b6c60a24e9a5d6d369a7a37c9fe2a767f26abd" | 20 | SRCREV = "48b6c60a24e9a5d6d369a7a37c9fe2a767f26abd" |
| 19 | 21 | ||
