diff options
author | Peter Marko <peter.marko@siemens.com> | 2025-07-27 19:49:15 +0200 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2025-08-04 07:55:06 -0700 |
commit | 5de981dd1c686872b94d9bc373ad9a0edf02e64c (patch) | |
tree | b47c4c5394e779833840fe4c93beb4a2e7ec70f5 | |
parent | e9a35f720ce4ad53d9ca8fc50485ef7cb4562aad (diff) | |
download | poky-5de981dd1c686872b94d9bc373ad9a0edf02e64c.tar.gz |
gnutls: patch read buffer overrun in the "pre_shared_key" extension
Pick relevant commit from 3.8.10 release MR [1].
The ME contains referece to undiscoled issue, so any security relevant
patch should be picked.
Binary test file was added as separate file as binary diffs are not
supported.
[1] https://gitlab.com/gnutls/gnutls/-/merge_requests/1979
(From OE-Core rev: 8f825e7f4ca36d7ac62062e452cea256f3c058aa)
Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
3 files changed, 38 insertions, 1 deletions
diff --git a/meta/recipes-support/gnutls/gnutls/0001-psk-fix-read-buffer-overrun-in-the-pre_shared_key-ex.patch b/meta/recipes-support/gnutls/gnutls/0001-psk-fix-read-buffer-overrun-in-the-pre_shared_key-ex.patch new file mode 100644 index 0000000000..e3dc286328 --- /dev/null +++ b/meta/recipes-support/gnutls/gnutls/0001-psk-fix-read-buffer-overrun-in-the-pre_shared_key-ex.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | From 208c6478d5c20b9d8a9f0a293e3808aa16ee091f Mon Sep 17 00:00:00 2001 | ||
2 | From: Andrew Hamilton <adhamilt@gmail.com> | ||
3 | Date: Mon, 7 Jul 2025 10:31:55 +0900 | ||
4 | Subject: [PATCH] psk: fix read buffer overrun in the "pre_shared_key" | ||
5 | extension | ||
6 | |||
7 | While processing the "pre_shared_key" extension in TLS 1.3, if there | ||
8 | are certain malformed data in the extension headers, then the code may | ||
9 | read uninitialized memory (2 bytes) beyond the received TLS extension | ||
10 | buffer. Spotted by oss-fuzz at: | ||
11 | https://issues.oss-fuzz.com/issues/42513990 | ||
12 | |||
13 | Signed-off-by: Andrew Hamilton <adhamilt@gmail.com> | ||
14 | Signed-off-by: Daiki Ueno <ueno@gnu.org> | ||
15 | |||
16 | Upstream-Status: Backport [https://gitlab.com/gnutls/gnutls/-/commit/208c6478d5c20b9d8a9f0a293e3808aa16ee091f] | ||
17 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
18 | --- | ||
19 | lib/ext/pre_shared_key.c | 2 ++ | ||
20 | 1 file changed, 2 insertions(+) | ||
21 | |||
22 | diff --git a/lib/ext/pre_shared_key.c b/lib/ext/pre_shared_key.c | ||
23 | index 51c4891d5..2cb83e670 100644 | ||
24 | --- a/lib/ext/pre_shared_key.c | ||
25 | +++ b/lib/ext/pre_shared_key.c | ||
26 | @@ -1170,6 +1170,8 @@ static int _gnutls_psk_recv_params(gnutls_session_t session, | ||
27 | |||
28 | if (session->security_parameters.entity == GNUTLS_CLIENT) { | ||
29 | if (session->internals.hsk_flags & HSK_PSK_KE_MODES_SENT) { | ||
30 | + DECR_LEN(len, 2); | ||
31 | + | ||
32 | uint16_t selected_identity = _gnutls_read_uint16(data); | ||
33 | |||
34 | for (i = 0; i < sizeof(session->key.binders) / | ||
diff --git a/meta/recipes-support/gnutls/gnutls/5477db1bb507a35e8833c758ce344f4b5b246d8e b/meta/recipes-support/gnutls/gnutls/5477db1bb507a35e8833c758ce344f4b5b246d8e new file mode 100644 index 0000000000..009d44c394 --- /dev/null +++ b/meta/recipes-support/gnutls/gnutls/5477db1bb507a35e8833c758ce344f4b5b246d8e | |||
Binary files differ | |||
diff --git a/meta/recipes-support/gnutls/gnutls_3.8.4.bb b/meta/recipes-support/gnutls/gnutls_3.8.4.bb index 367872d47e..973f81719a 100644 --- a/meta/recipes-support/gnutls/gnutls_3.8.4.bb +++ b/meta/recipes-support/gnutls/gnutls_3.8.4.bb | |||
@@ -26,6 +26,8 @@ SRC_URI = "https://www.gnupg.org/ftp/gcrypt/gnutls/v${SHRT_VER}/gnutls-${PV}.tar | |||
26 | file://CVE-2024-12243.patch \ | 26 | file://CVE-2024-12243.patch \ |
27 | file://CVE-2025-32989.patch \ | 27 | file://CVE-2025-32989.patch \ |
28 | file://04939b75417cc95b7372c6f208c4bda4579bdc34 \ | 28 | file://04939b75417cc95b7372c6f208c4bda4579bdc34 \ |
29 | file://0001-psk-fix-read-buffer-overrun-in-the-pre_shared_key-ex.patch \ | ||
30 | file://5477db1bb507a35e8833c758ce344f4b5b246d8e \ | ||
29 | " | 31 | " |
30 | 32 | ||
31 | SRC_URI[sha256sum] = "2bea4e154794f3f00180fa2a5c51fe8b005ac7a31cd58bd44cdfa7f36ebc3a9b" | 33 | SRC_URI[sha256sum] = "2bea4e154794f3f00180fa2a5c51fe8b005ac7a31cd58bd44cdfa7f36ebc3a9b" |
@@ -66,8 +68,9 @@ do_configure:prepend() { | |||
66 | done | 68 | done |
67 | 69 | ||
68 | # binary files cannot be delivered as diff | 70 | # binary files cannot be delivered as diff |
69 | mkdir -p ${S}/fuzz/gnutls_x509_parser_fuzzer.repro/ | 71 | mkdir -p ${S}/fuzz/gnutls_x509_parser_fuzzer.repro/ ${S}/fuzz/gnutls_psk_client_fuzzer.repro/ |
70 | cp ${WORKDIR}/04939b75417cc95b7372c6f208c4bda4579bdc34 ${S}/fuzz/gnutls_x509_parser_fuzzer.repro/ | 72 | cp ${WORKDIR}/04939b75417cc95b7372c6f208c4bda4579bdc34 ${S}/fuzz/gnutls_x509_parser_fuzzer.repro/ |
73 | cp ${WORKDIR}/5477db1bb507a35e8833c758ce344f4b5b246d8e ${S}/fuzz/gnutls_psk_client_fuzzer.repro/ | ||
71 | } | 74 | } |
72 | 75 | ||
73 | do_compile_ptest() { | 76 | do_compile_ptest() { |