summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/binutils
diff options
context:
space:
mode:
authorPgowda <pgowda.cve@gmail.com>2022-06-29 10:54:39 +0530
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-06-29 16:16:56 +0100
commit95f8fe68ee69dbca5d4b2c07cd601cbaf596065d (patch)
treed3100c2b97c5a0f52e1c89e58d3ea79aa0f77271 /meta/recipes-devtools/binutils
parentdf34fc372b3a12dfa38b74eca301da02e9edcec4 (diff)
downloadpoky-95f8fe68ee69dbca5d4b2c07cd601cbaf596065d.tar.gz
binutils : CVE-2019-1010204
Upstream-Status: Backport [https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2a4fc266dbf77ed7ab83da16468e9ba627b8bc2d] (From OE-Core rev: 0c55355a83130c2c0a59e9fb94f8914499943dd4) Signed-off-by: Pgowda <pgowda.cve@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/binutils')
-rw-r--r--meta/recipes-devtools/binutils/binutils-2.38.inc1
-rw-r--r--meta/recipes-devtools/binutils/binutils/0014-CVE-2019-1010204.patch49
2 files changed, 50 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils-2.38.inc b/meta/recipes-devtools/binutils/binutils-2.38.inc
index dc0a2a4054..a069071c97 100644
--- a/meta/recipes-devtools/binutils/binutils-2.38.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.38.inc
@@ -32,5 +32,6 @@ SRC_URI = "\
32 file://0011-sync-with-OE-libtool-changes.patch \ 32 file://0011-sync-with-OE-libtool-changes.patch \
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" 36"
36S = "${WORKDIR}/git" 37S = "${WORKDIR}/git"
diff --git a/meta/recipes-devtools/binutils/binutils/0014-CVE-2019-1010204.patch b/meta/recipes-devtools/binutils/binutils/0014-CVE-2019-1010204.patch
new file mode 100644
index 0000000000..dad4a62038
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0014-CVE-2019-1010204.patch
@@ -0,0 +1,49 @@
1From 2a4fc266dbf77ed7ab83da16468e9ba627b8bc2d Mon Sep 17 00:00:00 2001
2From: Nick Clifton <nickc@redhat.com>
3Date: Mon, 27 Jun 2022 13:07:40 +0100
4Subject: [PATCH] Have gold's File_read::do_read() function check the start
5 parameter
6
7 PR 23765
8 * fileread.cc (File_read::do_read): Check start parameter before
9 computing number of bytes to read.
10
11Upstream-Status: Backport [https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2a4fc266dbf77ed7ab83da16468e9ba627b8bc2d]
12
13Signed-off-by: Pgowda <pgowda.cve@gmail.com>
14---
15 gold/ChangeLog | 6 ++++++
16 gold/fileread.cc | 6 ++++++
17 2 files changed, 12 insertions(+)
18
19diff --git a/gold/ChangeLog b/gold/ChangeLog
20index 5103dab7b67..8557dc6db7f 100644
21--- a/gold/ChangeLog
22+++ b/gold/ChangeLog
23@@ -1,3 +1,9 @@
24+2022-06-27 Nick Clifton <nickc@redhat.com>
25+
26+ PR 23765
27+ * fileread.cc (File_read::do_read): Check start parameter before
28+ computing number of bytes to read.
29+
30 2022-02-17 Nick Clifton <nickc@redhat.com>
31
32 * po/sr.po: Updated Serbian translation.
33diff --git a/gold/fileread.cc b/gold/fileread.cc
34index 2b653f78c2e..af2df215468 100644
35--- a/gold/fileread.cc
36+++ b/gold/fileread.cc
37@@ -385,6 +385,12 @@ File_read::do_read(off_t start, section_
38 ssize_t bytes;
39 if (this->whole_file_view_ != NULL)
40 {
41+ // See PR 23765 for an example of a testcase that triggers this error.
42+ if (((ssize_t) start) < 0)
43+ gold_fatal(_("%s: read failed, starting offset (%#llx) less than zero"),
44+ this->filename().c_str(),
45+ static_cast<long long>(start));
46+
47 bytes = this->size_ - start;
48 if (static_cast<section_size_type>(bytes) >= size)
49 {