summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-graphics
diff options
context:
space:
mode:
authorGyorgy Sarvari <skandigraun@gmail.com>2026-04-20 08:27:48 +0200
committerKhem Raj <khem.raj@oss.qualcomm.com>2026-04-20 07:35:35 -0700
commitde5f93f95d420447043cedbedf798560925c44e1 (patch)
treedf183df701220358630e568681efbf45758a6f51 /meta-oe/recipes-graphics
parent420e5aec46b8e9344c4d9e692f2e05236b9c89e5 (diff)
downloadmeta-openembedded-de5f93f95d420447043cedbedf798560925c44e1.tar.gz
libgphoto2: patch CVE-2026-40341
Details: https://nvd.nist.gov/vuln/detail/CVE-2026-40341 Backport the patch referenced by the NVD advisory. Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
Diffstat (limited to 'meta-oe/recipes-graphics')
-rw-r--r--meta-oe/recipes-graphics/gphoto2/libgphoto2/CVE-2026-40341.patch69
-rw-r--r--meta-oe/recipes-graphics/gphoto2/libgphoto2_2.5.33.bb1
2 files changed, 70 insertions, 0 deletions
diff --git a/meta-oe/recipes-graphics/gphoto2/libgphoto2/CVE-2026-40341.patch b/meta-oe/recipes-graphics/gphoto2/libgphoto2/CVE-2026-40341.patch
new file mode 100644
index 0000000000..b71792c185
--- /dev/null
+++ b/meta-oe/recipes-graphics/gphoto2/libgphoto2/CVE-2026-40341.patch
@@ -0,0 +1,69 @@
1From 3674dbeafa5157a264ca5e562ffdbef159a2185f Mon Sep 17 00:00:00 2001
2From: Marcus Meissner <marcus@jet.franken.de>
3Date: Wed, 8 Apr 2026 15:28:52 +0200
4Subject: [PATCH] Fixed OOB read in ptp_unpack_EOS_FocusInfoEx
5
6Do not read out values before checking there is sufficient size
7
8CVE-2026-40341
9
10CVE: CVE-2026-40341
11Upstream-Status: Backport [https://github.com/gphoto/libgphoto2/commit/c385b34af260595dfbb5f9329526be5158985987]
12Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
13---
14 camlibs/ptp2/ptp-pack.c | 34 +++++++++++++++++++++++++---------
15 1 file changed, 25 insertions(+), 9 deletions(-)
16
17diff --git a/camlibs/ptp2/ptp-pack.c b/camlibs/ptp2/ptp-pack.c
18index 9eba06f..11428ab 100644
19--- a/camlibs/ptp2/ptp-pack.c
20+++ b/camlibs/ptp2/ptp-pack.c
21@@ -1629,23 +1629,39 @@ ptp_pack_EOS_ImageFormat (PTPParams* params, unsigned char* data, uint16_t value
22 static inline char*
23 ptp_unpack_EOS_FocusInfoEx (PTPParams* params, const unsigned char** data, uint32_t datasize)
24 {
25- uint32_t size = dtoh32a( *data );
26- uint32_t halfsize = dtoh16a( (*data) + 4);
27- uint32_t version = dtoh16a( (*data) + 6);
28- uint32_t focus_points_in_struct = dtoh16a( (*data) + 8);
29- uint32_t focus_points_in_use = dtoh16a( (*data) + 10);
30- uint32_t sizeX = dtoh16a( (*data) + 12);
31- uint32_t sizeY = dtoh16a( (*data) + 14);
32- uint32_t size2X = dtoh16a( (*data) + 16);
33- uint32_t size2Y = dtoh16a( (*data) + 18);
34+ uint32_t size;
35+ uint32_t halfsize;
36+ uint32_t version;
37+ uint32_t focus_points_in_struct;
38+ uint32_t focus_points_in_use;
39+ uint32_t sizeX;
40+ uint32_t sizeY;
41+ uint32_t size2X;
42+ uint32_t size2Y;
43 uint32_t i;
44 uint32_t maxlen;
45 char *str, *p;
46
47+ if (datasize<4) {
48+ ptp_error(params, "FocusInfoEx has invalid size (%d)", datasize);
49+ return strdup("bad size 0");
50+ }
51+
52+ size = dtoh32a( *data );
53 if ((size > datasize) || (size < 20)) {
54 ptp_error(params, "FocusInfoEx has invalid size (%d) vs datasize (%d)", size, datasize);
55 return strdup("bad size 1");
56 }
57+
58+ halfsize = dtoh16a( (*data) + 4);
59+ version = dtoh16a( (*data) + 6);
60+ focus_points_in_struct = dtoh16a( (*data) + 8);
61+ focus_points_in_use = dtoh16a( (*data) + 10);
62+ sizeX = dtoh16a( (*data) + 12);
63+ sizeY = dtoh16a( (*data) + 14);
64+ size2X = dtoh16a( (*data) + 16);
65+ size2Y = dtoh16a( (*data) + 18);
66+
67 /* If data is zero-filled, then it is just a placeholder, so nothing
68 useful, but also not an error */
69 if (!focus_points_in_struct || !focus_points_in_use) {
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 c82e76a06e..04c4786f84 100644
--- a/meta-oe/recipes-graphics/gphoto2/libgphoto2_2.5.33.bb
+++ b/meta-oe/recipes-graphics/gphoto2/libgphoto2_2.5.33.bb
@@ -20,6 +20,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/gphoto/${BP}.tar.xz;name=libgphoto2 \
20 file://CVE-2026-40338.patch \ 20 file://CVE-2026-40338.patch \
21 file://CVE-2026-40339.patch \ 21 file://CVE-2026-40339.patch \
22 file://CVE-2026-40340.patch \ 22 file://CVE-2026-40340.patch \
23 file://CVE-2026-40341.patch \
23 " 24 "
24SRC_URI[libgphoto2.sha256sum] = "28825f767a85544cb58f6e15028f8e53a5bb37a62148b3f1708b524781c3bef2" 25SRC_URI[libgphoto2.sha256sum] = "28825f767a85544cb58f6e15028f8e53a5bb37a62148b3f1708b524781c3bef2"
25 26