]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
libxpm: fix CVE-2022-46285
authorLee Chee Yang <chee.yang.lee@intel.com>
Wed, 6 Sep 2023 02:21:15 +0000 (10:21 +0800)
committerSteve Sakoman <steve@sakoman.com>
Fri, 29 Sep 2023 15:38:26 +0000 (05:38 -1000)
Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
meta/recipes-graphics/xorg-lib/libxpm/CVE-2022-46285.patch [new file with mode: 0644]
meta/recipes-graphics/xorg-lib/libxpm_3.5.13.bb

diff --git a/meta/recipes-graphics/xorg-lib/libxpm/CVE-2022-46285.patch b/meta/recipes-graphics/xorg-lib/libxpm/CVE-2022-46285.patch
new file mode 100644 (file)
index 0000000..e8b654d
--- /dev/null
@@ -0,0 +1,40 @@
+CVE: CVE-2022-46285
+Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/lib/libxpm/-/commit/a3a7c6dcc3b629d7650148 ]
+Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
+
+From a3a7c6dcc3b629d765014816c566c63165c63ca8 Mon Sep 17 00:00:00 2001
+From: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat, 17 Dec 2022 12:23:45 -0800
+Subject: [PATCH] Fix CVE-2022-46285: Infinite loop on unclosed comments
+
+When reading XPM images from a file with libXpm 3.5.14 or older, if a
+comment in the file is not closed (i.e. a C-style comment starts with
+"/*" and is missing the closing "*/"), the ParseComment() function will
+loop forever calling getc() to try to read the rest of the comment,
+failing to notice that it has returned EOF, which may cause a denial of
+service to the calling program.
+
+Reported-by: Marco Ivaldi <raptor@0xdeadbeef.info>
+Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+---
+ src/data.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/data.c b/src/data.c
+index 898889c..bfad4ff 100644
+--- a/src/data.c
++++ b/src/data.c
+@@ -174,6 +174,10 @@ ParseComment(xpmData *data)
+               notend = 0;
+               Ungetc(data, *s, file);
+           }
++          else if (c == EOF) {
++              /* hit end of file before the end of the comment */
++              return XpmFileInvalid;
++          }
+       }
+       return 0;
+     }
+-- 
+GitLab
+
index fda8e32d2c5cd09c344dd561af749a51912025ae..8937e61cb580a1c45eb3c34759907c47894d78df 100644 (file)
@@ -21,6 +21,8 @@ PACKAGES =+ "sxpm cxpm"
 FILES_cxpm = "${bindir}/cxpm"
 FILES_sxpm = "${bindir}/sxpm"
 
+SRC_URI += " file://CVE-2022-46285.patch"
+
 SRC_URI[md5sum] = "6f0ecf8d103d528cfc803aa475137afa"
 SRC_URI[sha256sum] = "9cd1da57588b6cb71450eff2273ef6b657537a9ac4d02d0014228845b935ac25"