summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-graphics/gphoto2/libgphoto2/CVE-2026-40339.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-graphics/gphoto2/libgphoto2/CVE-2026-40339.patch')
-rw-r--r--meta-oe/recipes-graphics/gphoto2/libgphoto2/CVE-2026-40339.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/meta-oe/recipes-graphics/gphoto2/libgphoto2/CVE-2026-40339.patch b/meta-oe/recipes-graphics/gphoto2/libgphoto2/CVE-2026-40339.patch
new file mode 100644
index 0000000000..b00ac72772
--- /dev/null
+++ b/meta-oe/recipes-graphics/gphoto2/libgphoto2/CVE-2026-40339.patch
@@ -0,0 +1,41 @@
1From 585e8113b541469347d09c341c2e8b468b431adb Mon Sep 17 00:00:00 2001
2From: Marcus Meissner <marcus@jet.franken.de>
3Date: Sat, 11 Apr 2026 10:50:47 +0200
4Subject: [PATCH] =?UTF-8?q?Fixed=20Sony=20DPD=20FormFlag=20OOB=20Read=20(C?=
5 =?UTF-8?q?WE-125)=20=E2=80=94=20MEDIUM?=
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
9
10ptp_unpack_Sony_DPD() reads the FormFlag byte via dtoh8o(data, *poffset)
11without a prior bounds check. The standard ptp_unpack_DPD() at line
12686–687 correctly validates *offset + sizeof(uint8_t) > dpdlen before
13this same read, but the Sony variant omits this check.
14
15CVE-2026-40339
16
17Reported-By: Sebastián Alba <sebasjosue84@gmail.com>
18
19CVE: CVE-2026-40339
20Upstream-Status: Backport [https://github.com/gphoto/libgphoto2/commit/09f8a940b1e418b5693f5c11e3016a1ad2cea62d]
21Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
22---
23 camlibs/ptp2/ptp-pack.c | 3 ++-
24 1 file changed, 2 insertions(+), 1 deletion(-)
25
26diff --git a/camlibs/ptp2/ptp-pack.c b/camlibs/ptp2/ptp-pack.c
27index f90d2a5..28648a5 100644
28--- a/camlibs/ptp2/ptp-pack.c
29+++ b/camlibs/ptp2/ptp-pack.c
30@@ -833,9 +833,10 @@ ptp_unpack_Sony_DPD (PTPParams *params, const unsigned char* data, PTPDeviceProp
31 code or the Data Type is a string (with two empty strings as
32 values). In both cases Form Flag should be set to 0x00 and FORM is
33 not present. */
34-
35 if (*poffset==PTP_dpd_Sony_DefaultValue)
36 return 1;
37+ if (*poffset + sizeof(uint8_t) > dpdlen)
38+ return 1;
39
40 dpd->FormFlag = dtoh8o(data, *poffset);
41 ptp_debug (params, "formflag 0x%04x", dpd->FormFlag);