From: Vinay Kumar <vinay.m.engg@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH] gdb: Discard sections whose size is greater than the file size.
Date: Mon, 4 Nov 2019 19:02:38 +0530 [thread overview]
Message-ID: <1572874358-21616-1-git-send-email-vinay.m.engg@gmail.com> (raw)
Backport the upstream fix. that was not present in master.
CVE: CVE-2019-1010180
Upstream-Status: Backport
Signed-off-by: Vinay Kumar <vinay.m.engg@gmail.com>
---
meta/recipes-devtools/gdb/gdb-8.3.1.inc | 1 +
meta/recipes-devtools/gdb/gdb/CVE-2019-1010180.patch | 20 ++++++++++++++++++++
2 files changed, 21 insertions(+)
create mode 100644 meta/recipes-devtools/gdb/gdb/CVE-2019-1010180.patch
diff --git a/meta/recipes-devtools/gdb/gdb-8.3.1.inc b/meta/recipes-devtools/gdb/gdb-8.3.1.inc
index 39f1c48..aec913f 100644
--- a/meta/recipes-devtools/gdb/gdb-8.3.1.inc
+++ b/meta/recipes-devtools/gdb/gdb-8.3.1.inc
@@ -16,6 +16,7 @@ SRC_URI = "${GNU_MIRROR}/gdb/gdb-${PV}.tar.xz \
file://0009-Change-order-of-CFLAGS.patch \
file://0010-resolve-restrict-keyword-conflict.patch \
file://0011-Fix-invalid-sigprocmask-call.patch \
+ file://CVE-2019-1010180.patch \
"
SRC_URI[md5sum] = "73b6a5d8141672c62bf851cd34c4aa83"
SRC_URI[sha256sum] = "1e55b4d7cdca7b34be12f4ceae651623aa73b2fd640152313f9f66a7149757c4"
diff --git a/meta/recipes-devtools/gdb/gdb/CVE-2019-1010180.patch b/meta/recipes-devtools/gdb/gdb/CVE-2019-1010180.patch
new file mode 100644
index 0000000..2e4e842
--- /dev/null
+++ b/meta/recipes-devtools/gdb/gdb/CVE-2019-1010180.patch
@@ -0,0 +1,20 @@
+diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
+index 4251ed0..fafdb89 100644
+--- a/gdb/dwarf2read.c
++++ b/gdb/dwarf2read.c
+@@ -2378,6 +2378,15 @@ dwarf2_per_objfile::locate_sections (bfd *abfd, asection *sectp,
+ if ((aflag & SEC_HAS_CONTENTS) == 0)
+ {
+ }
++ else if (elf_section_data (sectp)->this_hdr.sh_size
++ > bfd_get_file_size (abfd))
++ {
++ bfd_size_type size = elf_section_data (sectp)->this_hdr.sh_size;
++ warning (_("Discarding section %s which has a section size (%s"
++ ") larger than the file size [in module %s]"),
++ bfd_section_name (abfd, sectp), phex_nz (size, sizeof (size)),
++ bfd_get_filename (abfd));
++ }
+ else if (section_is_p (sectp->name, &names.info))
+ {
+ this->info.s.section = sectp;
--
2.7.4
next reply other threads:[~2019-11-04 13:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-04 13:32 Vinay Kumar [this message]
2019-11-04 14:02 ` ✗ patchtest: failure for gdb: Discard sections whose size is greater than the file size Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1572874358-21616-1-git-send-email-vinay.m.engg@gmail.com \
--to=vinay.m.engg@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox