diff options
| author | Gyorgy Sarvari <skandigraun@gmail.com> | 2026-04-20 08:27:42 +0200 |
|---|---|---|
| committer | Khem Raj <khem.raj@oss.qualcomm.com> | 2026-04-20 07:35:34 -0700 |
| commit | ce3fa8ad2a403c0c9bfcbcc9f4fc877c6ffb9fab (patch) | |
| tree | 2bf0f1f15ee2ad72afe7bfd5aac4b56c3cb91da2 | |
| parent | 754e02c668a1130e3808cdaa4dbd5c7954e99890 (diff) | |
| download | meta-openembedded-ce3fa8ad2a403c0c9bfcbcc9f4fc877c6ffb9fab.tar.gz | |
libgphoto2: patch CVE-2026-40334
Details: https://nvd.nist.gov/vuln/detail/CVE-2026-40334
Backport the patch that is 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-40334.patch | 37 | ||||
| -rw-r--r-- | meta-oe/recipes-graphics/gphoto2/libgphoto2_2.5.33.bb | 1 |
2 files changed, 38 insertions, 0 deletions
diff --git a/meta-oe/recipes-graphics/gphoto2/libgphoto2/CVE-2026-40334.patch b/meta-oe/recipes-graphics/gphoto2/libgphoto2/CVE-2026-40334.patch new file mode 100644 index 0000000000..883582dff0 --- /dev/null +++ b/meta-oe/recipes-graphics/gphoto2/libgphoto2/CVE-2026-40334.patch | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | From 20b33a26b2efdbf2c35c5cacc54a041855ec764b Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Marcus Meissner <marcus@jet.franken.de> | ||
| 3 | Date: Wed, 8 Apr 2026 15:15:54 +0200 | ||
| 4 | Subject: [PATCH] Fixed Canon FolderEntry Missing Null Termination | ||
| 5 | MIME-Version: 1.0 | ||
| 6 | Content-Type: text/plain; charset=UTF-8 | ||
| 7 | Content-Transfer-Encoding: 8bit | ||
| 8 | |||
| 9 | ptp_unpack_Canon_FE() copies filename with strncpy into a 13-byte | ||
| 10 | buffer without explicit null termination. The EOS variant at line | ||
| 11 | 1451–1452 correctly adds fe->Filename[PTP_CANON_FilenameBufferLen-1] | ||
| 12 | = 0; confirming this was recognized as necessary but not applied to the | ||
| 13 | original Canon path. | ||
| 14 | |||
| 15 | CVE-2026-40334 | ||
| 16 | |||
| 17 | Reported-By: Sebastián Alba <sebasjosue84@gmail.com> | ||
| 18 | |||
| 19 | CVE: CVE-2026-40334 | ||
| 20 | Upstream-Status: Backport [https://github.com/gphoto/libgphoto2/commit/259fc7d3bfe534ce4b114c464f55b448670ab873] | ||
| 21 | Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 22 | --- | ||
| 23 | camlibs/ptp2/ptp-pack.c | 1 + | ||
| 24 | 1 file changed, 1 insertion(+) | ||
| 25 | |||
| 26 | diff --git a/camlibs/ptp2/ptp-pack.c b/camlibs/ptp2/ptp-pack.c | ||
| 27 | index 09dcc24..982b4f4 100644 | ||
| 28 | --- a/camlibs/ptp2/ptp-pack.c | ||
| 29 | +++ b/camlibs/ptp2/ptp-pack.c | ||
| 30 | @@ -1369,6 +1369,7 @@ ptp_unpack_Canon_FE (PTPParams *params, const unsigned char* data, PTPCANONFolde | ||
| 31 | fe->ObjectSize = dtoh32a(data + PTP_cfe_ObjectSize); | ||
| 32 | fe->Time = (time_t)dtoh32a(data + PTP_cfe_Time); | ||
| 33 | strncpy(fe->Filename, (char*)data + PTP_cfe_Filename, PTP_CANON_FilenameBufferLen); | ||
| 34 | + fe->Filename[PTP_CANON_FilenameBufferLen-1] = '\0'; | ||
| 35 | } | ||
| 36 | |||
| 37 | /* | ||
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 ac7892151f..e8e56171a1 100644 --- a/meta-oe/recipes-graphics/gphoto2/libgphoto2_2.5.33.bb +++ b/meta-oe/recipes-graphics/gphoto2/libgphoto2_2.5.33.bb | |||
| @@ -14,6 +14,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/gphoto/${BP}.tar.xz;name=libgphoto2 \ | |||
| 14 | file://0001-configure-Filter-out-buildpaths-from-CC.patch \ | 14 | file://0001-configure-Filter-out-buildpaths-from-CC.patch \ |
| 15 | file://0001-libgphoto2-fix-const-correctness-for-c23-builds.patch \ | 15 | file://0001-libgphoto2-fix-const-correctness-for-c23-builds.patch \ |
| 16 | file://CVE-2026-40333.patch \ | 16 | file://CVE-2026-40333.patch \ |
| 17 | file://CVE-2026-40334.patch \ | ||
| 17 | " | 18 | " |
| 18 | SRC_URI[libgphoto2.sha256sum] = "28825f767a85544cb58f6e15028f8e53a5bb37a62148b3f1708b524781c3bef2" | 19 | SRC_URI[libgphoto2.sha256sum] = "28825f767a85544cb58f6e15028f8e53a5bb37a62148b3f1708b524781c3bef2" |
| 19 | 20 | ||
