diff options
| author | Gyorgy Sarvari <skandigraun@gmail.com> | 2026-04-20 08:27:46 +0200 |
|---|---|---|
| committer | Khem Raj <khem.raj@oss.qualcomm.com> | 2026-04-20 07:35:35 -0700 |
| commit | 2e3be1dddc215192ff277740271d65cdceaa0b18 (patch) | |
| tree | e9105944c60abaf3536e1be70ac55269db1e7524 | |
| parent | f22e17508e89cf8bbb98e3cbe186bb99e379c456 (diff) | |
| download | meta-openembedded-2e3be1dddc215192ff277740271d65cdceaa0b18.tar.gz | |
libgphoto2: patch CVE-2026-40339
Details: https://nvd.nist.gov/vuln/detail/CVE-2026-40339
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-40339.patch | 41 | ||||
| -rw-r--r-- | meta-oe/recipes-graphics/gphoto2/libgphoto2_2.5.33.bb | 1 |
2 files changed, 42 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 @@ | |||
| 1 | From 585e8113b541469347d09c341c2e8b468b431adb Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Marcus Meissner <marcus@jet.franken.de> | ||
| 3 | Date: Sat, 11 Apr 2026 10:50:47 +0200 | ||
| 4 | Subject: [PATCH] =?UTF-8?q?Fixed=20Sony=20DPD=20FormFlag=20OOB=20Read=20(C?= | ||
| 5 | =?UTF-8?q?WE-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 | ptp_unpack_Sony_DPD() reads the FormFlag byte via dtoh8o(data, *poffset) | ||
| 11 | without a prior bounds check. The standard ptp_unpack_DPD() at line | ||
| 12 | 686–687 correctly validates *offset + sizeof(uint8_t) > dpdlen before | ||
| 13 | this same read, but the Sony variant omits this check. | ||
| 14 | |||
| 15 | CVE-2026-40339 | ||
| 16 | |||
| 17 | Reported-By: Sebastián Alba <sebasjosue84@gmail.com> | ||
| 18 | |||
| 19 | CVE: CVE-2026-40339 | ||
| 20 | Upstream-Status: Backport [https://github.com/gphoto/libgphoto2/commit/09f8a940b1e418b5693f5c11e3016a1ad2cea62d] | ||
| 21 | Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 22 | --- | ||
| 23 | camlibs/ptp2/ptp-pack.c | 3 ++- | ||
| 24 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
| 25 | |||
| 26 | diff --git a/camlibs/ptp2/ptp-pack.c b/camlibs/ptp2/ptp-pack.c | ||
| 27 | index 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); | ||
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 df23932535..be761bc940 100644 --- a/meta-oe/recipes-graphics/gphoto2/libgphoto2_2.5.33.bb +++ b/meta-oe/recipes-graphics/gphoto2/libgphoto2_2.5.33.bb | |||
| @@ -18,6 +18,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/gphoto/${BP}.tar.xz;name=libgphoto2 \ | |||
| 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 | file://CVE-2026-40338.patch \ |
| 21 | file://CVE-2026-40339.patch \ | ||
| 21 | " | 22 | " |
| 22 | SRC_URI[libgphoto2.sha256sum] = "28825f767a85544cb58f6e15028f8e53a5bb37a62148b3f1708b524781c3bef2" | 23 | SRC_URI[libgphoto2.sha256sum] = "28825f767a85544cb58f6e15028f8e53a5bb37a62148b3f1708b524781c3bef2" |
| 23 | 24 | ||
