Files
buildroot/package/libssh2/0005-libssh2-priv-backport-LIBSSH2_UNCONST.patch
Stefan Müller 3328948349 package/libssh2: fix CVE-2025-15661
Backport the SFTP symlink bounds checking fix for CVE-2025-15661.

The initial fix requires the LIBSSH2_UNCONST compatibility backport on
libssh2 1.11.1. Also include the upstream follow-up fixing
SSH_FXP_STATUS handling introduced by the initial security fix.

The patches are based on the upstream fixes and Debian's libssh2 1.11.1
backports.

Signed-off-by: Stefan Müller <stefan.mueller@rey-technology.com>
[Julien: add links to Debian patches]
Signed-off-by: Julien Olivain <ju.o@free.fr>
(cherry picked from commit 546fd31c70)
Signed-off-by: Titouan Christophe <titouan.christophe@mind.be>
2026-08-28 15:57:20 +02:00

31 lines
1.0 KiB
Diff

Needed by the fix for CVE-2025-15661
Cherrypicked from
commit 606c102e52f8447de2b745dd6c5ddf418defc519
Author: Viktor Szakats <commit@vsz.me>
Date: Thu Jan 30 21:18:23 2025 +0100
CVE: CVE-2025-15661
Upstream: https://sources.debian.org/patches/libssh2/1.11.1-6/libssh-unconst-backport.patch/
Upstream: https://github.com/libssh2/libssh2/commit/606c102e52f8447de2b745dd6c5ddf418defc519
Signed-off-by: Stefan Müller <stefan.mueller@rey-technology.com>
---
--- libssh2-1.11.1.orig/src/libssh2_priv.h
+++ libssh2-1.11.1/src/libssh2_priv.h
@@ -117,6 +117,14 @@
#define UINT32_MAX 0xffffffffU
#endif
+#ifdef _WIN64
+#define LIBSSH2_UNCONST(p) ((void *)(libssh2_uint64_t)(const void *)(p))
+#elif defined(_MSC_VER)
+#define LIBSSH2_UNCONST(p) ((void *)(unsigned int)(const void *)(p))
+#else
+#define LIBSSH2_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
+#endif
+
#if (defined(__GNUC__) || defined(__clang__)) && \
defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \
!defined(LIBSSH2_NO_FMT_CHECKS)