diff options
| -rw-r--r-- | meta/recipes-connectivity/openssh/openssh/CVE-2025-26465.patch | 140 | ||||
| -rw-r--r-- | meta/recipes-connectivity/openssh/openssh_8.9p1.bb | 1 |
2 files changed, 141 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..ffc798a158 --- /dev/null +++ b/meta/recipes-connectivity/openssh/openssh/CVE-2025-26465.patch | |||
| @@ -0,0 +1,140 @@ | |||
| 1 | From 0832aac79517611dd4de93ad0a83577994d9c907 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: "djm@openbsd.org" <djm@openbsd.org> | ||
| 3 | Date: Tue, 18 Feb 2025 08:02:48 +0000 | ||
| 4 | Subject: [PATCH] upstream: Fix cases where error codes were not correctly set | ||
| 5 | |||
| 6 | Reported by the Qualys Security Advisory team. ok markus@ | ||
| 7 | |||
| 8 | OpenBSD-Commit-ID: 7bcd4ffe0fa1e27ff98d451fb9c22f5fae6e610d | ||
| 9 | |||
| 10 | Upstream-Status: Backport [https://github.com/openssh/openssh-portable/commit/0832aac79517611dd4de93ad0a83577994d9c907] | ||
| 11 | CVE: CVE-2025-26465 | ||
| 12 | Signed-off-by: Vijay Anusuri <vanusuri@mvista.com> | ||
| 13 | --- | ||
| 14 | krl.c | 2 ++ | ||
| 15 | ssh-agent.c | 3 +++ | ||
| 16 | ssh-sk-client.c | 2 ++ | ||
| 17 | sshconnect2.c | 5 ++++- | ||
| 18 | sshsig.c | 1 + | ||
| 19 | 5 files changed, 12 insertions(+), 1 deletion(-) | ||
| 20 | |||
| 21 | diff --git a/krl.c b/krl.c | ||
| 22 | index 17b88ed..aef2001 100644 | ||
| 23 | --- a/krl.c | ||
| 24 | +++ b/krl.c | ||
| 25 | @@ -674,6 +674,7 @@ revoked_certs_generate(struct revoked_certs *rc, struct sshbuf *buf) | ||
| 26 | break; | ||
| 27 | case KRL_SECTION_CERT_SERIAL_BITMAP: | ||
| 28 | if (rs->lo - bitmap_start > INT_MAX) { | ||
| 29 | + r = SSH_ERR_INVALID_FORMAT; | ||
| 30 | error_f("insane bitmap gap"); | ||
| 31 | goto out; | ||
| 32 | } | ||
| 33 | @@ -1008,6 +1009,7 @@ ssh_krl_from_blob(struct sshbuf *buf, struct ssh_krl **krlp, | ||
| 34 | goto out; | ||
| 35 | |||
| 36 | if ((krl = ssh_krl_init()) == NULL) { | ||
| 37 | + r = SSH_ERR_ALLOC_FAIL; | ||
| 38 | error_f("alloc failed"); | ||
| 39 | goto out; | ||
| 40 | } | ||
| 41 | diff --git a/ssh-agent.c b/ssh-agent.c | ||
| 42 | index 4dbb4f3..6382ef4 100644 | ||
| 43 | --- a/ssh-agent.c | ||
| 44 | +++ b/ssh-agent.c | ||
| 45 | @@ -1198,6 +1198,7 @@ parse_key_constraint_extension(struct sshbuf *m, char **sk_providerp, | ||
| 46 | "restrict-destination-v00@openssh.com") == 0) { | ||
| 47 | if (*dcsp != NULL) { | ||
| 48 | error_f("%s already set", ext_name); | ||
| 49 | + r = SSH_ERR_INVALID_FORMAT; | ||
| 50 | goto out; | ||
| 51 | } | ||
| 52 | if ((r = sshbuf_froms(m, &b)) != 0) { | ||
| 53 | @@ -1207,6 +1208,7 @@ parse_key_constraint_extension(struct sshbuf *m, char **sk_providerp, | ||
| 54 | while (sshbuf_len(b) != 0) { | ||
| 55 | if (*ndcsp >= AGENT_MAX_DEST_CONSTRAINTS) { | ||
| 56 | error_f("too many %s constraints", ext_name); | ||
| 57 | + r = SSH_ERR_INVALID_FORMAT; | ||
| 58 | goto out; | ||
| 59 | } | ||
| 60 | *dcsp = xrecallocarray(*dcsp, *ndcsp, *ndcsp + 1, | ||
| 61 | @@ -1663,6 +1665,7 @@ process_ext_session_bind(SocketEntry *e) | ||
| 62 | /* record new key/sid */ | ||
| 63 | if (e->nsession_ids >= AGENT_MAX_SESSION_IDS) { | ||
| 64 | error_f("too many session IDs recorded"); | ||
| 65 | + r = -1; | ||
| 66 | goto out; | ||
| 67 | } | ||
| 68 | e->session_ids = xrecallocarray(e->session_ids, e->nsession_ids, | ||
| 69 | diff --git a/ssh-sk-client.c b/ssh-sk-client.c | ||
| 70 | index 321fe53..750accb 100644 | ||
| 71 | --- a/ssh-sk-client.c | ||
| 72 | +++ b/ssh-sk-client.c | ||
| 73 | @@ -439,6 +439,7 @@ sshsk_load_resident(const char *provider_path, const char *device, | ||
| 74 | } | ||
| 75 | if ((srk = calloc(1, sizeof(*srk))) == NULL) { | ||
| 76 | error_f("calloc failed"); | ||
| 77 | + r = SSH_ERR_ALLOC_FAIL; | ||
| 78 | goto out; | ||
| 79 | } | ||
| 80 | srk->key = key; | ||
| 81 | @@ -450,6 +451,7 @@ sshsk_load_resident(const char *provider_path, const char *device, | ||
| 82 | if ((tmp = recallocarray(srks, nsrks, nsrks + 1, | ||
| 83 | sizeof(*srks))) == NULL) { | ||
| 84 | error_f("recallocarray keys failed"); | ||
| 85 | + r = SSH_ERR_ALLOC_FAIL; | ||
| 86 | goto out; | ||
| 87 | } | ||
| 88 | debug_f("srks[%zu]: %s %s uidlen %zu", nsrks, | ||
| 89 | diff --git a/sshconnect2.c b/sshconnect2.c | ||
| 90 | index 83ae4a4..6cfae2a 100644 | ||
| 91 | --- a/sshconnect2.c | ||
| 92 | +++ b/sshconnect2.c | ||
| 93 | @@ -97,7 +97,7 @@ static int | ||
| 94 | verify_host_key_callback(struct sshkey *hostkey, struct ssh *ssh) | ||
| 95 | { | ||
| 96 | if (verify_host_key(xxx_host, xxx_hostaddr, hostkey, | ||
| 97 | - xxx_conn_info) == -1) | ||
| 98 | + xxx_conn_info) != 0) | ||
| 99 | fatal("Host key verification failed."); | ||
| 100 | return 0; | ||
| 101 | } | ||
| 102 | @@ -713,6 +713,7 @@ input_userauth_pk_ok(int type, u_int32_t seq, struct ssh *ssh) | ||
| 103 | |||
| 104 | if ((pktype = sshkey_type_from_name(pkalg)) == KEY_UNSPEC) { | ||
| 105 | debug_f("server sent unknown pkalg %s", pkalg); | ||
| 106 | + r = SSH_ERR_INVALID_FORMAT; | ||
| 107 | goto done; | ||
| 108 | } | ||
| 109 | if ((r = sshkey_from_blob(pkblob, blen, &key)) != 0) { | ||
| 110 | @@ -723,6 +724,7 @@ input_userauth_pk_ok(int type, u_int32_t seq, struct ssh *ssh) | ||
| 111 | error("input_userauth_pk_ok: type mismatch " | ||
| 112 | "for decoded key (received %d, expected %d)", | ||
| 113 | key->type, pktype); | ||
| 114 | + r = SSH_ERR_INVALID_FORMAT; | ||
| 115 | goto done; | ||
| 116 | } | ||
| 117 | |||
| 118 | @@ -742,6 +744,7 @@ input_userauth_pk_ok(int type, u_int32_t seq, struct ssh *ssh) | ||
| 119 | SSH_FP_DEFAULT); | ||
| 120 | error_f("server replied with unknown key: %s %s", | ||
| 121 | sshkey_type(key), fp == NULL ? "<ERROR>" : fp); | ||
| 122 | + r = SSH_ERR_INVALID_FORMAT; | ||
| 123 | goto done; | ||
| 124 | } | ||
| 125 | ident = format_identity(id); | ||
| 126 | diff --git a/sshsig.c b/sshsig.c | ||
| 127 | index 7736134..76d7c21 100644 | ||
| 128 | --- a/sshsig.c | ||
| 129 | +++ b/sshsig.c | ||
| 130 | @@ -857,6 +857,7 @@ cert_filter_principals(const char *path, u_long linenum, | ||
| 131 | } | ||
| 132 | if ((principals = sshbuf_dup_string(nprincipals)) == NULL) { | ||
| 133 | error_f("buffer error"); | ||
| 134 | + r = SSH_ERR_ALLOC_FAIL; | ||
| 135 | goto out; | ||
| 136 | } | ||
| 137 | /* success */ | ||
| 138 | -- | ||
| 139 | 2.25.1 | ||
| 140 | |||
diff --git a/meta/recipes-connectivity/openssh/openssh_8.9p1.bb b/meta/recipes-connectivity/openssh/openssh_8.9p1.bb index d2c477a062..54b4d238eb 100644 --- a/meta/recipes-connectivity/openssh/openssh_8.9p1.bb +++ b/meta/recipes-connectivity/openssh/openssh_8.9p1.bb | |||
| @@ -37,6 +37,7 @@ SRC_URI = "http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar | |||
| 37 | file://CVE-2023-51384.patch \ | 37 | file://CVE-2023-51384.patch \ |
| 38 | file://CVE-2023-51385.patch \ | 38 | file://CVE-2023-51385.patch \ |
| 39 | file://CVE-2024-6387.patch \ | 39 | file://CVE-2024-6387.patch \ |
| 40 | file://CVE-2025-26465.patch \ | ||
| 40 | " | 41 | " |
| 41 | SRC_URI[sha256sum] = "fd497654b7ab1686dac672fb83dfb4ba4096e8b5ffcdaccd262380ae58bec5e7" | 42 | SRC_URI[sha256sum] = "fd497654b7ab1686dac672fb83dfb4ba4096e8b5ffcdaccd262380ae58bec5e7" |
| 42 | 43 | ||
