diff options
| author | Hitendra Prajapati <hprajapati@mvista.com> | 2022-06-02 09:47:50 +0530 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-06-11 10:06:09 +0100 |
| commit | 77332ffb9bdc6b6867c5cd1b5558624ce87b747c (patch) | |
| tree | 282f38616a1b02c2896b8f1910027768cf8d520f /meta/recipes-devtools | |
| parent | 99478d73c5d259c2b10baa7982befab9d67244e3 (diff) | |
| download | poky-77332ffb9bdc6b6867c5cd1b5558624ce87b747c.tar.gz | |
e2fsprogs: CVE-2022-1304 out-of-bounds read/write via crafted filesystem
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.
(From OE-Core rev: b4f9ba859ed1fe5e1d42258fee1dd2e8e85e7eba)
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
| -rw-r--r-- | meta/recipes-devtools/e2fsprogs/e2fsprogs/CVE-2022-1304.patch | 42 | ||||
| -rw-r--r-- | meta/recipes-devtools/e2fsprogs/e2fsprogs_1.45.7.bb | 1 |
2 files changed, 43 insertions, 0 deletions
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 index 0000000000..34e2567b25 --- /dev/null +++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/CVE-2022-1304.patch | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | From a66071ed6a0d1fa666d22dcb78fa6fcb3bf22df3 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Hitendra Prajapati <hprajapati@mvista.com> | ||
| 3 | Date: Fri, 27 May 2022 14:01:50 +0530 | ||
| 4 | Subject: [PATCH] CVE-2022-1304 | ||
| 5 | |||
| 6 | Upstream-Status: Backport [https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/commit/?h=maint&id=ab51d587bb9b229b1fade1afd02e1574c1ba5c76] | ||
| 7 | CVE: CVE-2022-1304 | ||
| 8 | Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com> | ||
| 9 | |||
| 10 | --- | ||
| 11 | lib/ext2fs/extent.c | 8 ++++++++ | ||
| 12 | 1 file changed, 8 insertions(+) | ||
| 13 | |||
| 14 | diff --git a/lib/ext2fs/extent.c b/lib/ext2fs/extent.c | ||
| 15 | index ac3dbfec9..a1b1905cd 100644 | ||
| 16 | --- a/lib/ext2fs/extent.c | ||
| 17 | +++ b/lib/ext2fs/extent.c | ||
| 18 | @@ -495,6 +495,10 @@ retry: | ||
| 19 | ext2fs_le16_to_cpu(eh->eh_entries); | ||
| 20 | newpath->max_entries = ext2fs_le16_to_cpu(eh->eh_max); | ||
| 21 | |||
| 22 | + /* Make sure there is at least one extent present */ | ||
| 23 | + if (newpath->left <= 0) | ||
| 24 | + return EXT2_ET_EXTENT_NO_DOWN; | ||
| 25 | + | ||
| 26 | if (path->left > 0) { | ||
| 27 | ix++; | ||
| 28 | newpath->end_blk = ext2fs_le32_to_cpu(ix->ei_block); | ||
| 29 | @@ -1630,6 +1634,10 @@ errcode_t ext2fs_extent_delete(ext2_extent_handle_t handle, int flags) | ||
| 30 | |||
| 31 | cp = path->curr; | ||
| 32 | |||
| 33 | + /* Sanity check before memmove() */ | ||
| 34 | + if (path->left < 0) | ||
| 35 | + return EXT2_ET_EXTENT_LEAF_BAD; | ||
| 36 | + | ||
| 37 | if (path->left) { | ||
| 38 | memmove(cp, cp + sizeof(struct ext3_extent_idx), | ||
| 39 | path->left * sizeof(struct ext3_extent_idx)); | ||
| 40 | -- | ||
| 41 | 2.25.1 | ||
| 42 | |||
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.45.7.bb b/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.45.7.bb index 3bc530e02b..3e6faf4cb8 100644 --- a/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.45.7.bb +++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.45.7.bb | |||
| @@ -6,6 +6,7 @@ SRC_URI += "file://remove.ldconfig.call.patch \ | |||
| 6 | file://mkdir_p.patch \ | 6 | file://mkdir_p.patch \ |
| 7 | file://0001-configure.ac-correct-AM_GNU_GETTEXT.patch \ | 7 | file://0001-configure.ac-correct-AM_GNU_GETTEXT.patch \ |
| 8 | file://0001-intl-do-not-try-to-use-gettext-defines-that-no-longe.patch \ | 8 | file://0001-intl-do-not-try-to-use-gettext-defines-that-no-longe.patch \ |
| 9 | file://CVE-2022-1304.patch \ | ||
| 9 | " | 10 | " |
| 10 | 11 | ||
| 11 | SRC_URI_append_class-native = " file://e2fsprogs-fix-missing-check-for-permission-denied.patch \ | 12 | SRC_URI_append_class-native = " file://e2fsprogs-fix-missing-check-for-permission-denied.patch \ |
