diff options
author | Chee Yang Lee <chee.yang.lee@intel.com> | 2023-02-09 20:46:26 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-02-15 10:21:34 +0000 |
commit | 8edbf988949b83bbdbfb0450b1c02e971775c9e5 (patch) | |
tree | 3c8c28f34ab3340abb56ae362b574028410b08ea | |
parent | 2c5d73a9470d58883cba3619f7ad364a8700c0ab (diff) | |
download | poky-8edbf988949b83bbdbfb0450b1c02e971775c9e5.tar.gz |
tar: Fix CVE-2022-48303
(From OE-Core rev: 4573a584397f197fbc9170abec3c590ea36667f7)
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-extended/tar/files/CVE-2022-48303.patch | 36 | ||||
-rw-r--r-- | meta/recipes-extended/tar/tar_1.34.bb | 4 |
2 files changed, 39 insertions, 1 deletions
diff --git a/meta/recipes-extended/tar/files/CVE-2022-48303.patch b/meta/recipes-extended/tar/files/CVE-2022-48303.patch new file mode 100644 index 0000000000..a8e9f4ac7d --- /dev/null +++ b/meta/recipes-extended/tar/files/CVE-2022-48303.patch | |||
@@ -0,0 +1,36 @@ | |||
1 | From 1d530107a24d71e798727d7f0afa0833473d1074 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Matej=20Mu=C5=BEila?= <mmuzila@gmail.com> | ||
3 | Date: Wed, 11 Jan 2023 08:55:58 +0100 | ||
4 | Subject: [PATCH] Fix savannah bug #62387 | ||
5 | |||
6 | * src/list.c (from_header): Check for the end of field after leading byte | ||
7 | (0x80 or 0xff) of base-256 encoded header value | ||
8 | |||
9 | Upstream-Status: Backport | ||
10 | [https://savannah.gnu.org/patch/download.php?file_id=54212] | ||
11 | CVE: CVE-2022-48303 | ||
12 | Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com> | ||
13 | --- | ||
14 | src/list.c | 6 ++++++ | ||
15 | 1 file changed, 6 insertions(+) | ||
16 | |||
17 | diff --git a/src/list.c b/src/list.c | ||
18 | index 9fafc425..bf41b581 100644 | ||
19 | --- a/src/list.c | ||
20 | +++ b/src/list.c | ||
21 | @@ -895,6 +895,12 @@ from_header (char const *where0, size_t digs, char const *type, | ||
22 | << (CHAR_BIT * sizeof (uintmax_t) | ||
23 | - LG_256 - (LG_256 - 2))); | ||
24 | value = (*where++ & ((1 << (LG_256 - 2)) - 1)) - signbit; | ||
25 | + if (where == lim) | ||
26 | + { | ||
27 | + if (type && !silent) | ||
28 | + ERROR ((0, 0, _("Archive base-256 value is invalid"))); | ||
29 | + return -1; | ||
30 | + } | ||
31 | for (;;) | ||
32 | { | ||
33 | value = (value << LG_256) + (unsigned char) *where++; | ||
34 | -- | ||
35 | 2.38.1 | ||
36 | |||
diff --git a/meta/recipes-extended/tar/tar_1.34.bb b/meta/recipes-extended/tar/tar_1.34.bb index 7307cd57a2..22c04ba70a 100644 --- a/meta/recipes-extended/tar/tar_1.34.bb +++ b/meta/recipes-extended/tar/tar_1.34.bb | |||
@@ -6,7 +6,9 @@ SECTION = "base" | |||
6 | LICENSE = "GPL-3.0-only" | 6 | LICENSE = "GPL-3.0-only" |
7 | LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" | 7 | LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" |
8 | 8 | ||
9 | SRC_URI = "${GNU_MIRROR}/tar/tar-${PV}.tar.bz2" | 9 | SRC_URI = "${GNU_MIRROR}/tar/tar-${PV}.tar.bz2 \ |
10 | file://CVE-2022-48303.patch \ | ||
11 | " | ||
10 | 12 | ||
11 | SRC_URI[sha256sum] = "b44cc67f8a1f6b0250b7c860e952b37e8ed932a90bd9b1862a511079255646ff" | 13 | SRC_URI[sha256sum] = "b44cc67f8a1f6b0250b7c860e952b37e8ed932a90bd9b1862a511079255646ff" |
12 | 14 | ||