summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Marko <peter.marko@siemens.com>2025-03-12 19:37:53 +0100
committerSteve Sakoman <steve@sakoman.com>2025-03-22 07:06:30 -0700
commit6277999680ffbda7472c448d12d9ca6e85db8ab8 (patch)
treef1a566689c626543a2fc29ac6a9a7ba5a707efb6
parent2b1149f032cc405c9d91c168d7eb9d0b3d896794 (diff)
downloadpoky-6277999680ffbda7472c448d12d9ca6e85db8ab8.tar.gz
openssh: patch CVE-2025-26465
Pick commit: https://github.com/openssh/openssh-portable/commit/0832aac79517611dd4de93ad0a83577994d9c907 (From OE-Core rev: 0d77609f814dec344535c5674f71a043a4e718e5) Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/recipes-connectivity/openssh/openssh/CVE-2025-26465.patch166
-rw-r--r--meta/recipes-connectivity/openssh/openssh_9.8p1.bb1
2 files changed, 167 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/openssh/openssh/CVE-2025-26465.patch b/meta/recipes-connectivity/openssh/openssh/CVE-2025-26465.patch
new file mode 100644
index 0000000000..a0bb5d7cd4
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh/CVE-2025-26465.patch
@@ -0,0 +1,166 @@
1From 0832aac79517611dd4de93ad0a83577994d9c907 Mon Sep 17 00:00:00 2001
2From: "djm@openbsd.org" <djm@openbsd.org>
3Date: Tue, 18 Feb 2025 08:02:48 +0000
4Subject: [PATCH 2/2] upstream: Fix cases where error codes were not correctly
5 set
6
7Reported by the Qualys Security Advisory team. ok markus@
8
9OpenBSD-Commit-ID: 7bcd4ffe0fa1e27ff98d451fb9c22f5fae6e610d
10
11CVE: CVE-2025-26465
12Upstream-Status: Backport [https://github.com/openssh/openssh-portable/commit/0832aac79517611dd4de93ad0a83577994d9c907]
13Signed-off-by: Peter Marko <peter.marko@siemens.com>
14---
15 krl.c | 4 +++-
16 ssh-agent.c | 5 +++++
17 ssh-sk-client.c | 4 +++-
18 sshconnect2.c | 5 ++++-
19 sshsig.c | 1 +
20 5 files changed, 16 insertions(+), 3 deletions(-)
21
22diff --git a/krl.c b/krl.c
23index e2efdf066..0d0f69534 100644
24--- a/krl.c
25+++ b/krl.c
26@@ -1,4 +1,4 @@
27-/* $OpenBSD: krl.c,v 1.59 2023/07/17 05:22:30 djm Exp $ */
28+/* $OpenBSD: krl.c,v 1.60 2025/02/18 08:02:48 djm Exp $ */
29 /*
30 * Copyright (c) 2012 Damien Miller <djm@mindrot.org>
31 *
32@@ -674,6 +674,7 @@ revoked_certs_generate(struct revoked_certs *rc, struct sshbuf *buf)
33 break;
34 case KRL_SECTION_CERT_SERIAL_BITMAP:
35 if (rs->lo - bitmap_start > INT_MAX) {
36+ r = SSH_ERR_INVALID_FORMAT;
37 error_f("insane bitmap gap");
38 goto out;
39 }
40@@ -1059,6 +1060,7 @@ ssh_krl_from_blob(struct sshbuf *buf, struct ssh_krl **krlp)
41 }
42
43 if ((krl = ssh_krl_init()) == NULL) {
44+ r = SSH_ERR_ALLOC_FAIL;
45 error_f("alloc failed");
46 goto out;
47 }
48diff --git a/ssh-agent.c b/ssh-agent.c
49index 48973b2c1..c27c5a956 100644
50--- a/ssh-agent.c
51+++ b/ssh-agent.c
52@@ -1208,6 +1208,7 @@ parse_key_constraint_extension(struct sshbuf *m, char **sk_providerp,
53 "restrict-destination-v00@openssh.com") == 0) {
54 if (*dcsp != NULL) {
55 error_f("%s already set", ext_name);
56+ r = SSH_ERR_INVALID_FORMAT;
57 goto out;
58 }
59 if ((r = sshbuf_froms(m, &b)) != 0) {
60@@ -1217,6 +1218,7 @@ parse_key_constraint_extension(struct sshbuf *m, char **sk_providerp,
61 while (sshbuf_len(b) != 0) {
62 if (*ndcsp >= AGENT_MAX_DEST_CONSTRAINTS) {
63 error_f("too many %s constraints", ext_name);
64+ r = SSH_ERR_INVALID_FORMAT;
65 goto out;
66 }
67 *dcsp = xrecallocarray(*dcsp, *ndcsp, *ndcsp + 1,
68@@ -1234,6 +1236,7 @@ parse_key_constraint_extension(struct sshbuf *m, char **sk_providerp,
69 }
70 if (*certs != NULL) {
71 error_f("%s already set", ext_name);
72+ r = SSH_ERR_INVALID_FORMAT;
73 goto out;
74 }
75 if ((r = sshbuf_get_u8(m, &v)) != 0 ||
76@@ -1245,6 +1248,7 @@ parse_key_constraint_extension(struct sshbuf *m, char **sk_providerp,
77 while (sshbuf_len(b) != 0) {
78 if (*ncerts >= AGENT_MAX_EXT_CERTS) {
79 error_f("too many %s constraints", ext_name);
80+ r = SSH_ERR_INVALID_FORMAT;
81 goto out;
82 }
83 *certs = xrecallocarray(*certs, *ncerts, *ncerts + 1,
84@@ -1741,6 +1745,7 @@ process_ext_session_bind(SocketEntry *e)
85 /* record new key/sid */
86 if (e->nsession_ids >= AGENT_MAX_SESSION_IDS) {
87 error_f("too many session IDs recorded");
88+ r = -1;
89 goto out;
90 }
91 e->session_ids = xrecallocarray(e->session_ids, e->nsession_ids,
92diff --git a/ssh-sk-client.c b/ssh-sk-client.c
93index 321fe53a2..06fad2213 100644
94--- a/ssh-sk-client.c
95+++ b/ssh-sk-client.c
96@@ -1,4 +1,4 @@
97-/* $OpenBSD: ssh-sk-client.c,v 1.12 2022/01/14 03:34:00 djm Exp $ */
98+/* $OpenBSD: ssh-sk-client.c,v 1.13 2025/02/18 08:02:48 djm Exp $ */
99 /*
100 * Copyright (c) 2019 Google LLC
101 *
102@@ -439,6 +439,7 @@ sshsk_load_resident(const char *provider_path, const char *device,
103 }
104 if ((srk = calloc(1, sizeof(*srk))) == NULL) {
105 error_f("calloc failed");
106+ r = SSH_ERR_ALLOC_FAIL;
107 goto out;
108 }
109 srk->key = key;
110@@ -450,6 +451,7 @@ sshsk_load_resident(const char *provider_path, const char *device,
111 if ((tmp = recallocarray(srks, nsrks, nsrks + 1,
112 sizeof(*srks))) == NULL) {
113 error_f("recallocarray keys failed");
114+ r = SSH_ERR_ALLOC_FAIL;
115 goto out;
116 }
117 debug_f("srks[%zu]: %s %s uidlen %zu", nsrks,
118diff --git a/sshconnect2.c b/sshconnect2.c
119index a69c4da18..1ee6000ab 100644
120--- a/sshconnect2.c
121+++ b/sshconnect2.c
122@@ -99,7 +99,7 @@ verify_host_key_callback(struct sshkey *hostkey, struct ssh *ssh)
123 options.required_rsa_size)) != 0)
124 fatal_r(r, "Bad server host key");
125 if (verify_host_key(xxx_host, xxx_hostaddr, hostkey,
126- xxx_conn_info) == -1)
127+ xxx_conn_info) != 0)
128 fatal("Host key verification failed.");
129 return 0;
130 }
131@@ -698,6 +698,7 @@ input_userauth_pk_ok(int type, u_int32_t seq, struct ssh *ssh)
132
133 if ((pktype = sshkey_type_from_name(pkalg)) == KEY_UNSPEC) {
134 debug_f("server sent unknown pkalg %s", pkalg);
135+ r = SSH_ERR_INVALID_FORMAT;
136 goto done;
137 }
138 if ((r = sshkey_from_blob(pkblob, blen, &key)) != 0) {
139@@ -708,6 +709,7 @@ input_userauth_pk_ok(int type, u_int32_t seq, struct ssh *ssh)
140 error("input_userauth_pk_ok: type mismatch "
141 "for decoded key (received %d, expected %d)",
142 key->type, pktype);
143+ r = SSH_ERR_INVALID_FORMAT;
144 goto done;
145 }
146
147@@ -727,6 +729,7 @@ input_userauth_pk_ok(int type, u_int32_t seq, struct ssh *ssh)
148 SSH_FP_DEFAULT);
149 error_f("server replied with unknown key: %s %s",
150 sshkey_type(key), fp == NULL ? "<ERROR>" : fp);
151+ r = SSH_ERR_INVALID_FORMAT;
152 goto done;
153 }
154 ident = format_identity(id);
155diff --git a/sshsig.c b/sshsig.c
156index 6e03c0b06..3da005d62 100644
157--- a/sshsig.c
158+++ b/sshsig.c
159@@ -874,6 +874,7 @@ cert_filter_principals(const char *path, u_long linenum,
160 }
161 if ((principals = sshbuf_dup_string(nprincipals)) == NULL) {
162 error_f("buffer error");
163+ r = SSH_ERR_ALLOC_FAIL;
164 goto out;
165 }
166 /* success */
diff --git a/meta/recipes-connectivity/openssh/openssh_9.8p1.bb b/meta/recipes-connectivity/openssh/openssh_9.8p1.bb
index 3d6cb9f245..066ff70258 100644
--- a/meta/recipes-connectivity/openssh/openssh_9.8p1.bb
+++ b/meta/recipes-connectivity/openssh/openssh_9.8p1.bb
@@ -27,6 +27,7 @@ SRC_URI = "http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar
27 file://0001-regress-banner.sh-log-input-and-output-files-on-erro.patch \ 27 file://0001-regress-banner.sh-log-input-and-output-files-on-erro.patch \
28 file://0001-regress-test-exec-use-the-absolute-path-in-the-SSH-e.patch \ 28 file://0001-regress-test-exec-use-the-absolute-path-in-the-SSH-e.patch \
29 file://CVE-2025-26466.patch \ 29 file://CVE-2025-26466.patch \
30 file://CVE-2025-26465.patch \
30 " 31 "
31SRC_URI[sha256sum] = "dd8bd002a379b5d499dfb050dd1fa9af8029e80461f4bb6c523c49973f5a39f3" 32SRC_URI[sha256sum] = "dd8bd002a379b5d499dfb050dd1fa9af8029e80461f4bb6c523c49973f5a39f3"
32 33