summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-graphics/gphoto2/libgphoto2/CVE-2026-40336.patch44
-rw-r--r--meta-oe/recipes-graphics/gphoto2/libgphoto2_2.5.33.bb1
2 files changed, 45 insertions, 0 deletions
diff --git a/meta-oe/recipes-graphics/gphoto2/libgphoto2/CVE-2026-40336.patch b/meta-oe/recipes-graphics/gphoto2/libgphoto2/CVE-2026-40336.patch
new file mode 100644
index 0000000000..1a809b4f25
--- /dev/null
+++ b/meta-oe/recipes-graphics/gphoto2/libgphoto2/CVE-2026-40336.patch
@@ -0,0 +1,44 @@
1From e19c45d3530f1585805711e14aa4ea788e499f46 Mon Sep 17 00:00:00 2001
2From: Marcus Meissner <marcus@jet.franken.de>
3Date: Wed, 8 Apr 2026 15:13:51 +0200
4Subject: [PATCH] Fixed Sony DPD Secondary Enum List Memory Leak
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Finding 4: Sony DPD Secondary Enum List Memory Leak (CWE-401) — LOW
10
11File: ptp-pack.c:884-885
12
13When processing a secondary enumeration list (2024+ Sony cameras), line
14884–885 overwrites dpd->FORM.Enum.SupportedValue with a new calloc()
15without freeing the previous allocation from line 857. The original
16array and any string values it contains are leaked.
17
18CVE-2026-40336
19
20Reported-By: Sebastián Alba <sebasjosue84@gmail.com>
21
22CVE: CVE-2026-40336
23Upstream-Status: Backport [https://github.com/gphoto/libgphoto2/commit/404ff02c75f3cb280196fc260a63c4d26cf1a8f6]
24Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
25---
26 camlibs/ptp2/ptp-pack.c | 5 +++++
27 1 file changed, 5 insertions(+)
28
29diff --git a/camlibs/ptp2/ptp-pack.c b/camlibs/ptp2/ptp-pack.c
30index 7fc120d..fc51d77 100644
31--- a/camlibs/ptp2/ptp-pack.c
32+++ b/camlibs/ptp2/ptp-pack.c
33@@ -879,6 +879,11 @@ ptp_unpack_Sony_DPD (PTPParams *params, const unsigned char* data, PTPDeviceProp
34 /* check if we have a secondary list of items, this is for newer Sonys (2024) */
35 if (val < 0x200) { /* if a secondary list is not provided, this will be the next property code - 0x5XXX or 0xDxxx */
36 if (dpd->FormFlag == PTP_DPFF_Enumeration) {
37+ /* free old enum variables */
38+ for (i=0;i<dpd->FORM.Enum.NumberOfValues;i++)
39+ ptp_free_propvalue (dpd->DataType, dpd->FORM.Enum.SupportedValue+i);
40+ free (dpd->FORM.Enum.SupportedValue);
41+
42 N = dtoh16o(data, *poffset);
43 dpd->FORM.Enum.SupportedValue = calloc(N,sizeof(dpd->FORM.Enum.SupportedValue[0]));
44 if (!dpd->FORM.Enum.SupportedValue)
diff --git a/meta-oe/recipes-graphics/gphoto2/libgphoto2_2.5.33.bb b/meta-oe/recipes-graphics/gphoto2/libgphoto2_2.5.33.bb
index 269731731b..bb5470fa7a 100644
--- a/meta-oe/recipes-graphics/gphoto2/libgphoto2_2.5.33.bb
+++ b/meta-oe/recipes-graphics/gphoto2/libgphoto2_2.5.33.bb
@@ -16,6 +16,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/gphoto/${BP}.tar.xz;name=libgphoto2 \
16 file://CVE-2026-40333.patch \ 16 file://CVE-2026-40333.patch \
17 file://CVE-2026-40334.patch \ 17 file://CVE-2026-40334.patch \
18 file://CVE-2026-40335.patch \ 18 file://CVE-2026-40335.patch \
19 file://CVE-2026-40336.patch \
19 " 20 "
20SRC_URI[libgphoto2.sha256sum] = "28825f767a85544cb58f6e15028f8e53a5bb37a62148b3f1708b524781c3bef2" 21SRC_URI[libgphoto2.sha256sum] = "28825f767a85544cb58f6e15028f8e53a5bb37a62148b3f1708b524781c3bef2"
21 22