]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
e2fsprogs: CVE-2022-1304 out-of-bounds read/write via crafted filesystem
authorHitendra Prajapati <hprajapati@mvista.com>
Thu, 2 Jun 2022 04:17:50 +0000 (09:47 +0530)
committerSteve Sakoman <steve@sakoman.com>
Tue, 7 Jun 2022 18:56:30 +0000 (08:56 -1000)
Source: https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
MR: 117430
Type: Security Fix
Disposition: Backport from https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/commit/?h=maint&id=ab51d587bb9b229b1fade1afd02e1574c1ba5c76
ChangeID: e6db00c6e8375a2e869fd2e4ead61ca9149eb8fa
Description:
          CVE-2022-1304 e2fsprogs: out-of-bounds read/write via crafted filesystem.
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
meta/recipes-devtools/e2fsprogs/e2fsprogs/CVE-2022-1304.patch [new file with mode: 0644]
meta/recipes-devtools/e2fsprogs/e2fsprogs_1.45.7.bb

diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/CVE-2022-1304.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/CVE-2022-1304.patch
new file mode 100644 (file)
index 0000000..34e2567
--- /dev/null
@@ -0,0 +1,42 @@
+From a66071ed6a0d1fa666d22dcb78fa6fcb3bf22df3 Mon Sep 17 00:00:00 2001
+From: Hitendra Prajapati <hprajapati@mvista.com>
+Date: Fri, 27 May 2022 14:01:50 +0530
+Subject: [PATCH] CVE-2022-1304
+
+Upstream-Status: Backport [https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/commit/?h=maint&id=ab51d587bb9b229b1fade1afd02e1574c1ba5c76]
+CVE: CVE-2022-1304
+Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
+
+---
+ lib/ext2fs/extent.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/lib/ext2fs/extent.c b/lib/ext2fs/extent.c
+index ac3dbfec9..a1b1905cd 100644
+--- a/lib/ext2fs/extent.c
++++ b/lib/ext2fs/extent.c
+@@ -495,6 +495,10 @@ retry:
+                       ext2fs_le16_to_cpu(eh->eh_entries);
+               newpath->max_entries = ext2fs_le16_to_cpu(eh->eh_max);
++              /* Make sure there is at least one extent present */
++              if (newpath->left <= 0)
++                      return EXT2_ET_EXTENT_NO_DOWN;
++
+               if (path->left > 0) {
+                       ix++;
+                       newpath->end_blk = ext2fs_le32_to_cpu(ix->ei_block);
+@@ -1630,6 +1634,10 @@ errcode_t ext2fs_extent_delete(ext2_extent_handle_t handle, int flags)
+       cp = path->curr;
++      /* Sanity check before memmove() */
++      if (path->left < 0)
++              return EXT2_ET_EXTENT_LEAF_BAD;
++
+       if (path->left) {
+               memmove(cp, cp + sizeof(struct ext3_extent_idx),
+                       path->left * sizeof(struct ext3_extent_idx));
+-- 
+2.25.1
+
index 3bc530e02b66abedf41e333a784c81c9c2124354..3e6faf4cb820074630fd50f953917600d6b9d75d 100644 (file)
@@ -6,6 +6,7 @@ SRC_URI += "file://remove.ldconfig.call.patch \
            file://mkdir_p.patch \
            file://0001-configure.ac-correct-AM_GNU_GETTEXT.patch \
            file://0001-intl-do-not-try-to-use-gettext-defines-that-no-longe.patch \
+           file://CVE-2022-1304.patch \
            "
 
 SRC_URI_append_class-native = " file://e2fsprogs-fix-missing-check-for-permission-denied.patch \