diff options
| author | pgowda <pgowda.cve@gmail.com> | 2022-09-06 10:18:26 +0530 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-09-12 08:41:47 +0100 |
| commit | 72aa63fcf5f1b877f71d6f3ef6201f9058aa54f0 (patch) | |
| tree | 6067294a377621afcd8acb92e6e9192735e97627 /meta/recipes-devtools | |
| parent | 68dfce5f526164560e4ae32e9548a9e87c36c690 (diff) | |
| download | poky-72aa63fcf5f1b877f71d6f3ef6201f9058aa54f0.tar.gz | |
binutils : CVE-2022-38533
Upstream-Status: Backport
[https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ef186fe54aa6d281a3ff8a9528417e5cc614c797]
(From OE-Core rev: 9644d9a38dac8d2c0263f4e8a67624da7a8bc55b)
Signed-off-by: pgowda <pgowda.cve@gmail.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/binutils/binutils-2.38.inc | 1 | ||||
| -rw-r--r-- | meta/recipes-devtools/binutils/binutils/0015-CVE-2022-38533.patch | 36 |
2 files changed, 37 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils-2.38.inc b/meta/recipes-devtools/binutils/binutils-2.38.inc index eed252976a..8aa8295881 100644 --- a/meta/recipes-devtools/binutils/binutils-2.38.inc +++ b/meta/recipes-devtools/binutils/binutils-2.38.inc | |||
| @@ -33,5 +33,6 @@ SRC_URI = "\ | |||
| 33 | file://0012-Check-for-clang-before-checking-gcc-version.patch \ | 33 | file://0012-Check-for-clang-before-checking-gcc-version.patch \ |
| 34 | file://0013-Avoid-as-info-race-condition.patch \ | 34 | file://0013-Avoid-as-info-race-condition.patch \ |
| 35 | file://0014-CVE-2019-1010204.patch \ | 35 | file://0014-CVE-2019-1010204.patch \ |
| 36 | file://0015-CVE-2022-38533.patch \ | ||
| 36 | " | 37 | " |
| 37 | S = "${WORKDIR}/git" | 38 | S = "${WORKDIR}/git" |
diff --git a/meta/recipes-devtools/binutils/binutils/0015-CVE-2022-38533.patch b/meta/recipes-devtools/binutils/binutils/0015-CVE-2022-38533.patch new file mode 100644 index 0000000000..5d9ac2cb1f --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils/0015-CVE-2022-38533.patch | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | From ef186fe54aa6d281a3ff8a9528417e5cc614c797 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Alan Modra <amodra@gmail.com> | ||
| 3 | Date: Sat, 13 Aug 2022 15:32:47 +0930 | ||
| 4 | Subject: [PATCH] PR29482 - strip: heap-buffer-overflow | ||
| 5 | |||
| 6 | PR 29482 | ||
| 7 | * coffcode.h (coff_set_section_contents): Sanity check _LIB. | ||
| 8 | |||
| 9 | Upstream-Status: Backport [https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ef186fe54aa6d281a3ff8a9528417e5cc614c797] | ||
| 10 | |||
| 11 | Signed-off-by: Pgowda <pgowda.cve@gmail.com> | ||
| 12 | |||
| 13 | --- | ||
| 14 | bfd/coffcode.h | 7 +++++-- | ||
| 15 | 1 file changed, 5 insertions(+), 2 deletions(-) | ||
| 16 | |||
| 17 | diff --git a/bfd/coffcode.h b/bfd/coffcode.h | ||
| 18 | index 67aaf158ca1..52027981c3f 100644 | ||
| 19 | --- a/bfd/coffcode.h | ||
| 20 | +++ b/bfd/coffcode.h | ||
| 21 | @@ -4302,10 +4302,13 @@ coff_set_section_contents (bfd * abfd, | ||
| 22 | |||
| 23 | rec = (bfd_byte *) location; | ||
| 24 | recend = rec + count; | ||
| 25 | - while (rec < recend) | ||
| 26 | + while (recend - rec >= 4) | ||
| 27 | { | ||
| 28 | + size_t len = bfd_get_32 (abfd, rec); | ||
| 29 | + if (len == 0 || len > (size_t) (recend - rec) / 4) | ||
| 30 | + break; | ||
| 31 | + rec += len * 4; | ||
| 32 | ++section->lma; | ||
| 33 | - rec += bfd_get_32 (abfd, rec) * 4; | ||
| 34 | } | ||
| 35 | |||
| 36 | BFD_ASSERT (rec == recend); | ||
