Subject: Re: [wrynose][PATCH 10/12] curl: fix CVE-2026-87865 To: openembedded-core@lists.openembedded.org From: "Darsh Kelaiya -X (dkelaiya - E INFOCHIPS PRIVATE LIMITED at Cisco)" X-Originating-Location: Mumbai, Maharashtra, IN (151.186.177.21) X-Originating-Platform: Windows Edge 158 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Tue, 24 Nov 2026 02:16:07 -0800 References: <20261104073627.302002-1-dkelaiya@cisco.com> <20261104073627.302002-11-dkelaiya@cisco.com> In-Reply-To: Message-ID: <1226682.1795515367119608830@lists.openembedded.org> Content-Type: multipart/alternative; boundary="B7X2asCwAhXcQg81dXvu" List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Tue, 24 Nov 2026 10:16:09 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/251000 --B7X2asCwAhXcQg81dXvu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi Yoann, Thanks for the review. I've sent a v2 which drops the _p2 patch as requested. https://lists.openembedded.org/g/openembedded-core/message/250999 Regards, Darsh On Mon, Nov 23, 2026 at 10:26 PM, Yoann Congal wrote: >=20 > On Wed Nov 4, 2026 at 8:36 AM CET, Darsh Kelaiya -X (dkelaiya - E > INFOCHIPS PRIVATE LIMITED at Cisco) via openembedded-core wrote: >=20 >> From: Darsh Kelaiya >>=20 >> This patch applies the upstream fix as referenced in [2], >> using the commit shown in [1]. >>=20 >> Match hashed known_hosts entries against the requested host before >> selecting the host-key algorithm. Adapt the connection fields and >> SSH test fixture to curl 8.19.0. >>=20 >> Include the upstream follow-up [3] to cache key types already absent >> for this host, avoiding repeated full-file scans introduced by [1]. >> Keep both upstream commits in separate patches and retain test3500. >>=20 >> Install test3500.pl into ptest so the hashed-host regression can run >> from the target package. >>=20 >> [1] https://github.com/curl/curl/commit/323c184b6bdf5b1988a10c0a61560666= e1588149 >>=20 >> [2] https://curl.se/docs/CVE-2026-87865.html >> [3] https://github.com/curl/curl/commit/dc055e8a9eefe65cf63cb0396668a37c= 0b7c474a >>=20 >>=20 >> Signed-off-by: Darsh Kelaiya >> --- >> .../curl/curl/CVE-2026-87865_p1.patch | 225 ++++++++++++++++++ >> .../curl/curl/CVE-2026-87865_p2.patch | 89 +++++++ >> meta/recipes-support/curl/curl_8.19.0.bb | 4 + >> 3 files changed, 318 insertions(+) >> create mode 100644 meta/recipes-support/curl/curl/CVE-2026-87865_p1.patc= h >> create mode 100644 meta/recipes-support/curl/curl/CVE-2026-87865_p2.patc= h >>=20 >> diff --git a/meta/recipes-support/curl/curl/CVE-2026-87865_p2.patch >> b/meta/recipes-support/curl/curl/CVE-2026-87865_p2.patch >> new file mode 100644 >> index 00000000000..0bf7cfea3c6 >> --- /dev/null >> +++ b/meta/recipes-support/curl/curl/CVE-2026-87865_p2.patch >> @@ -0,0 +1,89 @@ >> +From dc055e8a9eefe65cf63cb0396668a37c0b7c474a Mon Sep 17 00:00:00 2001 >> +From: Bobbeh Rhino >> +Date: Tue, 8 Sep 2026 20:24:35 -0400 >> +Subject: [PATCH] libssh2: skip repeat checkp() for already-absent hashe= d >> key >> + types >> + >> +ssh_force_knownhost_key_type() called libssh2_knownhost_checkp() once >> +per hashed known_hosts entry, and each call itself rescans the whole >> +known_hosts set. Cache key types already confirmed absent for the >> +connecting host so repeat entries of the same type do not each trigger >> +another full scan. checkp() NOTFOUND for a given (host, port, type) is >> +independent of the key bytes passed in, so this is safe. >> + >> +Behavior for MATCH is unchanged, and only store->typemask is read >> +after a match, which is identical for any entry of the same type. >> + >> +Tests: runtests.pl 3500 1459 600, full SFTP/SCP keyword set (58/58), >> +checksrc.pl. >> + >> +Closes #22905 >> + >> +CVE: CVE-2026-87865 >> +Upstream-Status: Backport [ https://github.com/curl/curl/commit/dc055e8= a9eefe65cf63cb0396668a37c0b7c474a >> ] >> + >> +Backport Changes: >> +- Use curl 8.19.0's conn->host.name and conn->remote_port instead of >> + conn->origin->hostname and conn->origin->port. The older connection >> + has no origin pointer; preserve the -1 lookup port for port 22. >> + >> +(cherry picked from commit dc055e8a9eefe65cf63cb0396668a37c0b7c474a) >> +Signed-off-by: Darsh Kelaiya >=20 > Hello, >=20 > This _p2 has not been submitted for blacksail. Also, it's a perf > optimisation not a security/bug fix. So, I can't accept it (Unless the > perf issue creates a bug). >=20 > I suggest to resend this patch with p1 only. Beware, I plan to merge > some patches of this series. >=20 > Regards, > -- > Yoann Congal > Smile ECS --B7X2asCwAhXcQg81dXvu Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
Hi Yoann,

Thanks for the review. I've sent a v2 which drops= the _p2 patch as
 
Regards,
Darsh
 
On Mon, Nov 23, 2026 at 10:26 PM, Yoann Congal wrote:
On Wed Nov 4, 2026 at 8:36 AM CET, Darsh Kelaiya -X (dkelaiya -= E INFOCHIPS PRIVATE LIMITED at Cisco) via openembedded-core wrote:
From: Darsh Kelaiya <dkelaiya@cisco.com>

This = patch applies the upstream fix as referenced in [2],
using the commit = shown in [1].

Match hashed known_hosts entries against the reque= sted host before
selecting the host-key algorithm. Adapt the connectio= n fields and
SSH test fixture to curl 8.19.0.

Include the u= pstream follow-up [3] to cache key types already absent
for this host,= avoiding repeated full-file scans introduced by [1].
Keep both upstre= am commits in separate patches and retain test3500.

Install test= 3500.pl into ptest so the hashed-host regression can run
from the targ= et package.

[1] https://github.com/curl/curl/commit/323c184b6bdf5b1988a10c0a61560666e15881= 49
[2] https://curl.se/docs/CVE-2026-87865.html[3] https://github.com= /curl/curl/commit/dc055e8a9eefe65cf63cb0396668a37c0b7c474a

S= igned-off-by: Darsh Kelaiya <dkelaiya@cisco.com>
---
.../cu= rl/curl/CVE-2026-87865_p1.patch | 225 ++++++++++++++++++
.../curl/curl= /CVE-2026-87865_p2.patch | 89 +++++++
meta/recipes-support/curl/curl_8= .19.0.bb | 4 +
3 files changed, 318 insertions(+)
create mode 100= 644 meta/recipes-support/curl/curl/CVE-2026-87865_p1.patch
create mode= 100644 meta/recipes-support/curl/curl/CVE-2026-87865_p2.patch

d= iff --git a/meta/recipes-support/curl/curl/CVE-2026-87865_p2.patch b/meta/r= ecipes-support/curl/curl/CVE-2026-87865_p2.patch
new file mode 100644<= br />index 00000000000..0bf7cfea3c6
--- /dev/null
+++ b/meta/reci= pes-support/curl/curl/CVE-2026-87865_p2.patch
@@ -0,0 +1,89 @@
+F= rom dc055e8a9eefe65cf63cb0396668a37c0b7c474a Mon Sep 17 00:00:00 2001
= +From: Bobbeh Rhino <bobbeh@rhino.Rhino>
+Date: Tue, 8 Sep 2026 = 20:24:35 -0400
+Subject: [PATCH] libssh2: skip repeat checkp() for alr= eady-absent hashed key
+ types
+
+ssh_force_knownhost_key_ty= pe() called libssh2_knownhost_checkp() once
+per hashed known_hosts en= try, and each call itself rescans the whole
+known_hosts set. Cache ke= y types already confirmed absent for the
+connecting host so repeat en= tries of the same type do not each trigger
+another full scan. checkp(= ) NOTFOUND for a given (host, port, type) is
+independent of the key b= ytes passed in, so this is safe.
+
+Behavior for MATCH is unchang= ed, and only store->typemask is read
+after a match, which is ident= ical for any entry of the same type.
+
+Tests: runtests.pl 3500 1= 459 600, full SFTP/SCP keyword set (58/58),
+checksrc.pl.
+
= +Closes #22905
+
+CVE: CVE-2026-87865
+Upstream-Status: Back= port [https://github.com/c= url/curl/commit/dc055e8a9eefe65cf63cb0396668a37c0b7c474a]
+
+= Backport Changes:
+- Use curl 8.19.0's conn->host.name and conn->= ;remote_port instead of
+ conn->origin->hostname and conn->or= igin->port. The older connection
+ has no origin pointer; preserve = the -1 lookup port for port 22.
+
+(cherry picked from commit dc0= 55e8a9eefe65cf63cb0396668a37c0b7c474a)
+Signed-off-by: Darsh Kelaiya &= lt;dkelaiya@cisco.com>
Hello,

This _p2 has not been submitted for blacksail. Also, it's= a perf
optimisation not a security/bug fix. So, I can't accept it (Un= less the
perf issue creates a bug).

I suggest to resend thi= s patch with p1 only. Beware, I plan to merge
some patches of this ser= ies.

Regards,
--
Yoann Congal
Smile ECS
--B7X2asCwAhXcQg81dXvu--