new file mode 100644
@@ -0,0 +1,31 @@
+From 5f4ffda88770f95482fd0e66aa44106614dbf466 Mon Sep 17 00:00:00 2001
+From: Jakub Jelen <jjelen@redhat.com>
+Date: Tue, 22 Apr 2025 21:18:44 +0200
+Subject: CVE-2025-5318: sftpserver: Fix possible buffer overrun
+
+Signed-off-by: Jakub Jelen <jjelen@redhat.com>
+Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
+
+Upstream-Status: Backport [https://git.libssh.org/projects/libssh.git/commit/?id=5f4ffda88770f95482fd0e66aa44106614dbf466]
+CVE: CVE-2025-5318
+Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
+---
+ src/sftpserver.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/sftpserver.c b/src/sftpserver.c
+index 1af8a0e7..dee51534 100644
+--- a/src/sftpserver.c
++++ b/src/sftpserver.c
+@@ -530,7 +530,7 @@ void *sftp_handle(sftp_session sftp, ssh_string handle){
+
+ memcpy(&val, ssh_string_data(handle), sizeof(uint32_t));
+
+- if (val > SFTP_HANDLES) {
++ if (val >= SFTP_HANDLES) {
+ return NULL;
+ }
+
+--
+2.49.0
+
@@ -8,6 +8,7 @@ DEPENDS = "zlib openssl"
SRC_URI = "git://git.libssh.org/projects/libssh.git;protocol=https;branch=stable-0.8 \
file://CVE-2020-16135.patch \
+ file://CVE-2025-5318.patch \
"
SRCREV = "04685a74df9ce1db1bc116a83a0da78b4f4fa1f8"
Upstream-Status: Backport from https://git.libssh.org/projects/libssh.git/commit/?id=5f4ffda88770f95482fd0e66aa44106614dbf466 Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com> --- .../libssh/libssh/CVE-2025-5318.patch | 31 +++++++++++++++++++ .../recipes-support/libssh/libssh_0.8.9.bb | 1 + 2 files changed, 32 insertions(+) create mode 100644 meta-oe/recipes-support/libssh/libssh/CVE-2025-5318.patch