diff options
| author | Gyorgy Sarvari <skandigraun@gmail.com> | 2026-04-20 08:27:45 +0200 |
|---|---|---|
| committer | Khem Raj <khem.raj@oss.qualcomm.com> | 2026-04-20 07:35:35 -0700 |
| commit | f22e17508e89cf8bbb98e3cbe186bb99e379c456 (patch) | |
| tree | 5d66e713ca67c0939ab43a79f7f432e6419c2da5 | |
| parent | 078f26b084d7a7e4ac61521f73188249b9bdd39a (diff) | |
| download | meta-openembedded-f22e17508e89cf8bbb98e3cbe186bb99e379c456.tar.gz | |
libgphoto2: patch CVE-2026-40338
Details: https://nvd.nist.gov/vuln/detail/CVE-2026-40338
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>
| -rw-r--r-- | meta-oe/recipes-graphics/gphoto2/libgphoto2/CVE-2026-40338.patch | 34 | ||||
| -rw-r--r-- | meta-oe/recipes-graphics/gphoto2/libgphoto2_2.5.33.bb | 1 |
2 files changed, 35 insertions, 0 deletions
diff --git a/meta-oe/recipes-graphics/gphoto2/libgphoto2/CVE-2026-40338.patch b/meta-oe/recipes-graphics/gphoto2/libgphoto2/CVE-2026-40338.patch new file mode 100644 index 0000000000..9f233f2ec9 --- /dev/null +++ b/meta-oe/recipes-graphics/gphoto2/libgphoto2/CVE-2026-40338.patch | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | From 43cc20e807cd2935869617a7d8b9488070712c0e Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Marcus Meissner <marcus@jet.franken.de> | ||
| 3 | Date: Sat, 11 Apr 2026 10:47:52 +0200 | ||
| 4 | Subject: [PATCH] =?UTF-8?q?Fixed=20Sony=20DPD=20Enum=20Count=20OOB=20Read?= | ||
| 5 | =?UTF-8?q?=20(CWE-125)=20=E2=80=94=20MEDIUM?= | ||
| 6 | MIME-Version: 1.0 | ||
| 7 | Content-Type: text/plain; charset=UTF-8 | ||
| 8 | Content-Transfer-Encoding: 8bit | ||
| 9 | |||
| 10 | In the PTP_DPFF_Enumeration case of ptp_unpack_Sony_DPD(), dtoh16o(data, *poffset) reads 2 bytes for enumeration count N without verifying 2 bytes remain. The standard parser at line 704 has this check. | ||
| 11 | |||
| 12 | CVE-2026-40338 | ||
| 13 | |||
| 14 | Reported-By: Sebastián Alba <sebasjosue84@gmail.com> | ||
| 15 | |||
| 16 | CVE: CVE-2026-40338 | ||
| 17 | Upstream-Status: Backport [https://github.com/gphoto/libgphoto2/commit/3b9f9696be76ae51dca983d9dd8ce586a2561845] | ||
| 18 | Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 19 | --- | ||
| 20 | camlibs/ptp2/ptp-pack.c | 1 + | ||
| 21 | 1 file changed, 1 insertion(+) | ||
| 22 | |||
| 23 | diff --git a/camlibs/ptp2/ptp-pack.c b/camlibs/ptp2/ptp-pack.c | ||
| 24 | index fc51d77..f90d2a5 100644 | ||
| 25 | --- a/camlibs/ptp2/ptp-pack.c | ||
| 26 | +++ b/camlibs/ptp2/ptp-pack.c | ||
| 27 | @@ -851,6 +851,7 @@ ptp_unpack_Sony_DPD (PTPParams *params, const unsigned char* data, PTPDeviceProp | ||
| 28 | break; | ||
| 29 | case PTP_DPFF_Enumeration: { | ||
| 30 | #define N dpd->FORM.Enum.NumberOfValues | ||
| 31 | + if (*poffset + sizeof(uint16_t) > dpdlen) goto outofmemory; | ||
| 32 | N = dtoh16o(data, *poffset); | ||
| 33 | dpd->FORM.Enum.SupportedValue = calloc(N,sizeof(dpd->FORM.Enum.SupportedValue[0])); | ||
| 34 | 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 bb5470fa7a..df23932535 100644 --- a/meta-oe/recipes-graphics/gphoto2/libgphoto2_2.5.33.bb +++ b/meta-oe/recipes-graphics/gphoto2/libgphoto2_2.5.33.bb | |||
| @@ -17,6 +17,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/gphoto/${BP}.tar.xz;name=libgphoto2 \ | |||
| 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 | file://CVE-2026-40336.patch \ |
| 20 | file://CVE-2026-40338.patch \ | ||
| 20 | " | 21 | " |
| 21 | SRC_URI[libgphoto2.sha256sum] = "28825f767a85544cb58f6e15028f8e53a5bb37a62148b3f1708b524781c3bef2" | 22 | SRC_URI[libgphoto2.sha256sum] = "28825f767a85544cb58f6e15028f8e53a5bb37a62148b3f1708b524781c3bef2" |
| 22 | 23 | ||
