mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-11-15 04:17:29 +00:00
libgphoto2: patch CVE-2026-120451
Details: https://nvd.nist.gov/vuln/detail/cve-2026-120451 Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com> Signed-off-by: Anuj Mittal <anuj.mittal@oss.qualcomm.com>
This commit is contained in:
1 parent
0662b78ffb
commit
9d29072b9c
2 files changed
+44
No files matched your search
@@ -0,0 +1,43 @@
|
||||
From 021b03a90b744321bb237f66b1052fea58e91224 Mon Sep 17 00:00:00 2001
|
||||
From: TheProtagonist07 <63047129+TheProtagonist07@users.noreply.github.com>
|
||||
Date: Wed, 28 Oct 2026 18:51:05 +0530
|
||||
Subject: [PATCH] jl2005c: reject an allocation table that does not fit the
|
||||
buffers
|
||||
|
||||
jl2005c_init() computes alloc_table_size from the entry count reported by
|
||||
the camera and then reads that many bytes into the 0x4020 byte info[] stack
|
||||
buffer and copies them into priv->table[0x4000]. For nb_entries >= 1022 both
|
||||
operations write past the end of their destination.
|
||||
|
||||
Return GP_ERROR_CORRUPTED_DATA if the table would not fit.
|
||||
|
||||
Addresses findings 1 and 2 of #1326.
|
||||
|
||||
(cherry picked from commit 6a3393dd996502457ab965432cf0b2035278825e)
|
||||
|
||||
CVE: CVE-2026-120451
|
||||
Upstream-Status: Backport [https://github.com/gphoto/libgphoto2/commit/6a3393dd996502457ab965432cf0b2035278825e]
|
||||
Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com>
|
||||
---
|
||||
camlibs/jl2005c/jl2005c.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/camlibs/jl2005c/jl2005c.c b/camlibs/jl2005c/jl2005c.c
|
||||
index c447a23..12c106a 100644
|
||||
--- a/camlibs/jl2005c/jl2005c.c
|
||||
+++ b/camlibs/jl2005c/jl2005c.c
|
||||
@@ -144,6 +144,14 @@ restart:
|
||||
alloc_table_size = priv->nb_entries * 0x10 + 0x30;
|
||||
if (alloc_table_size%0x200)
|
||||
alloc_table_size += 0x200 - (alloc_table_size%0x200);
|
||||
+ /* nb_entries comes from the camera. The table has to fit into the
|
||||
+ * local info buffer as well as into priv->table. */
|
||||
+ if ((size_t)alloc_table_size > sizeof(info) ||
|
||||
+ (size_t)alloc_table_size - 0x30 > sizeof(priv->table)) {
|
||||
+ GP_DEBUG("alloc_table_size 0x%x is too large for %d entries\n",
|
||||
+ alloc_table_size, priv->nb_entries);
|
||||
+ return GP_ERROR_CORRUPTED_DATA;
|
||||
+ }
|
||||
/* However, we have already just now downloaded 0x200 bytes, so
|
||||
* when downloading the rest of the table we correct for that and
|
||||
* just download whatever remains of the information block.
|
||||
@@ -21,6 +21,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/gphoto/${BP}.tar.xz;name=libgphoto2 \
|
||||
file://CVE-2026-40339.patch \
|
||||
file://CVE-2026-40340.patch \
|
||||
file://CVE-2026-40341.patch \
|
||||
file://CVE-2026-120451.patch \
|
||||
"
|
||||
SRC_URI[libgphoto2.sha256sum] = "28825f767a85544cb58f6e15028f8e53a5bb37a62148b3f1708b524781c3bef2"
|
||||
|
||||
|
||||
Reference in new issue
Block a user