summaryrefslogtreecommitdiff
path: root/system/binutils
diff options
context:
space:
mode:
Diffstat (limited to 'system/binutils')
-rw-r--r--system/binutils/APKBUILD14
-rw-r--r--system/binutils/BTS-170.patch42
-rw-r--r--system/binutils/BTS-196.patch223
-rw-r--r--system/binutils/CVE-2019-14444.patch28
-rw-r--r--system/binutils/arm-pie.patch24
5 files changed, 329 insertions, 2 deletions
diff --git a/system/binutils/APKBUILD b/system/binutils/APKBUILD
index c7924b43e..682f2e93c 100644
--- a/system/binutils/APKBUILD
+++ b/system/binutils/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Adelie Platform Group <adelie-devel@lists.adelielinux.org>
pkgname=binutils
pkgver=2.32
-pkgrel=2
+pkgrel=4
pkgdesc="Tools necessary to build programs"
url="https://www.gnu.org/software/binutils/"
depends=""
@@ -15,6 +15,7 @@ subpackages="$pkgname-dev $pkgname-doc $pkgname-lang $pkgname-libs"
# non-PIC is unsupported by musl/ppc
[ "${CARCH}" != "ppc" ] || options='!check'
source="https://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.xz
+ arm-pie.patch
binutils-ld-fix-static-linking.patch
disable-gnu-mbind.patch
disable-ifunc-tests.patch
@@ -30,6 +31,9 @@ source="https://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.xz
CVE-2019-9077.patch
CVE-2019-12972.patch
CVE-2019-14250.patch
+ CVE-2019-14444.patch
+ BTS-170.patch
+ BTS-196.patch
"
if [ "$CHOST" != "$CTARGET" ]; then
@@ -57,6 +61,8 @@ fi
# - CVE-2019-9077
# - CVE-2019-12972
# - CVE-2019-14250
+# 2.32-r3:
+# - CVE-2019-14444
build() {
local _sysroot=/
@@ -135,6 +141,7 @@ libs() {
}
sha512sums="d326408f12a03d9a61a9de56584c2af12f81c2e50d2d7e835d51565df8314df01575724afa1e43bd0db45cfc9916b41519b67dfce03232aa4978704492a6994a binutils-2.32.tar.xz
+2f862c473b357effe63221a47c4a34893eff50e4ab3c7b500b19754f3c7bf81ee695c35e5ce16f6c6fcd75696d270d04f282ae4c7d32b42a61b667ff1eccce8f arm-pie.patch
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
d378fdf1964f8f2bd0b1e62827ac5884bdf943aa435ec89c29fc84bb045d406b733fffaff8fdd8bd1cba8ddea7701c4cf6ccf3ed76a8a3df9c72b447737575a6 disable-gnu-mbind.patch
474ab24097bbb5b24433620549e5234fe65c547824c1342f693c718ffbc81e2d968259cce2d650b55200dd1ec89da207ea2db10c551cd9941285c4600b4297b2 disable-ifunc-tests.patch
@@ -149,4 +156,7 @@ f52d21f194c2d7dbdc56e93636d3228034ee1718b457e5a5ce289bba2454155846d1ff6ea8530d11
a46b9211608e2f35219b95363a5ba90506742dcb9e4bd4a43915af6c0b3e74bd8339a8318dc2923c0952ef579112412cb1cf619a5f090066769a852587b27d03 CVE-2019-9075.patch
c0f50f1a843480f29b3895c8814df9801b9f90260edbaff1831aa5738fedd07a9e6b7a79f5b6f9be34df4954dbf02feb5232ebbecc596277fc2fe63673ed347c CVE-2019-9077.patch
9109a6ff9c55f310f86a1561fe6b404534928d402672490059bbe358f77c0c2a7f73c8b67f0a4450f00ba1776452858b63fa60cf2ec0744104a6b077e8fa3e42 CVE-2019-12972.patch
-c277202272d9883741c2530a94c6d50d55dd9d0a9efaa43a1f8c9fc7529bd45e635255c0d90035dfc5920d5387010a4259612a4d711260a95d7b3d9fa6500e4f CVE-2019-14250.patch"
+c277202272d9883741c2530a94c6d50d55dd9d0a9efaa43a1f8c9fc7529bd45e635255c0d90035dfc5920d5387010a4259612a4d711260a95d7b3d9fa6500e4f CVE-2019-14250.patch
+0942cc1a4c5ec03e931c6ebd15c5d60eae6be48cd0a3d9b7f6356f97361226bb6d53dbdcb01b20efcca0ccaf23764730d9bbad2c1bbe2ea6ca320e43b43b311b CVE-2019-14444.patch
+d4543d2f77808d317d17a5f0eb9af21540ef8543fceaed4e3524213e31e058333321f3ba3b495199e3b57bfd0c4164929cf679369470389e26871b8895cb0110 BTS-170.patch
+9cc17d9fe3fc1351d1f6b4fc1c916254529f3304c95db6f4698b867eeb623210b914dc798fb837eafbad2b287b78b31c4ed5482b3151a2992864da04e1dd5fac BTS-196.patch"
diff --git a/system/binutils/BTS-170.patch b/system/binutils/BTS-170.patch
new file mode 100644
index 000000000..daca64319
--- /dev/null
+++ b/system/binutils/BTS-170.patch
@@ -0,0 +1,42 @@
+The "No PLT (static 1d)" link test fails on pmmx and x86_64.
+lea is being emitted instead of mov.
+
+https://bts.adelielinux.org/show_bug.cgi?id=170
+https://bts.adelielinux.org/show_bug.cgi?id=196
+
+--- binutils-2.32/ld/testsuite/ld-x86-64/no-plt.exp 2019-01-19 10:01:34.000000000 -0600
++++ binutils-2.32/ld/testsuite/ld-x86-64/no-plt.exp 2019-09-11 17:21:27.232257151 -0500
+@@ -100,15 +100,6 @@ run_cc_link_tests [list \
+ "no-plt-1c" \
+ ] \
+ [list \
+- "No PLT (static 1d)" \
+- "-static tmpdir/no-plt-check1.o tmpdir/no-plt-main1.o \
+- tmpdir/no-plt-func1.o tmpdir/no-plt-extern1.o" \
+- "-Wa,-mx86-used-note=yes" \
+- {dummy.s} \
+- {{readelf -Wr no-plt-1d.rd} {objdump -dwrj.text no-plt-1d.dd}} \
+- "no-plt-1d" \
+- ] \
+- [list \
+ "No PLT (PIE 1e)" \
+ "-pie tmpdir/no-plt-check1.o tmpdir/no-plt-main1.o \
+ tmpdir/no-plt-func1.o tmpdir/no-plt-extern1.o" \
+--- binutils-2.32/ld/testsuite/ld-i386/no-plt.exp 2019-01-19 10:01:33.000000000 -0600
++++ binutils-2.32/ld/testsuite/ld-i386/no-plt.exp 2019-09-11 18:03:48.012302603 -0500
+@@ -102,15 +102,6 @@ run_cc_link_tests [list \
+ "no-plt-1c" \
+ ] \
+ [list \
+- "No PLT (static 1d)" \
+- "-static tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \
+- tmpdir/no-plt-func1.o tmpdir/no-plt-extern1a.o" \
+- "-Wa,-mx86-used-note=yes" \
+- {dummy.s} \
+- {{readelf -Wr no-plt-1d.rd} {objdump -dwrj.text no-plt-1d.dd}} \
+- "no-plt-1d" \
+- ] \
+- [list \
+ "No PLT (PIE 1e)" \
+ "-pie tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \
+ tmpdir/no-plt-func1.o tmpdir/no-plt-extern1a.o" \
diff --git a/system/binutils/BTS-196.patch b/system/binutils/BTS-196.patch
new file mode 100644
index 000000000..08316d279
--- /dev/null
+++ b/system/binutils/BTS-196.patch
@@ -0,0 +1,223 @@
+https://bts.adelielinux.org/show_bug.cgi?id=196
+
+--- binutils-2.32/ld/testsuite/ld-i386/i386.exp 2019-01-19 10:01:33.000000000 -0600
++++ binutils-2.32/ld/testsuite/ld-i386/i386.exp 2019-09-17 13:47:29.921108280 -0500
+@@ -1035,23 +1035,6 @@ if { [isnative]
+ "pr18900.out" \
+ ] \
+ [list \
+- "Run pr19031" \
+- "$NOPIE_LDFLAGS tmpdir/pr19031.so" \
+- "-Wa,-mx86-used-note=yes" \
+- { pr19031b.S pr19031c.c } \
+- "pr19031" \
+- "pr19031.out" \
+- "$NOPIE_CFLAGS" \
+- ] \
+- [list \
+- "Run got1" \
+- "$NOPIE_LDFLAGS tmpdir/got1d.so" \
+- "-Wa,-mx86-used-note=yes" \
+- { got1a.S got1b.c got1c.c } \
+- "got1" \
+- "got1.out" \
+- ] \
+- [list \
+ "Run property 1" \
+ "" \
+ "-Wa,-mx86-used-note=yes" \
+@@ -1159,8 +1142,6 @@ if { [isnative]
+ ]
+
+ undefined_weak "$NOPIE_CFLAGS" "$NOPIE_LDFLAGS"
+- undefined_weak "-fPIE" "$NOPIE_LDFLAGS"
+- undefined_weak "-fPIE" "-pie"
+ undefined_weak "-fPIE" "-z nodynamic-undefined-weak $NOPIE_LDFLAGS"
+ undefined_weak "-fPIE" "-pie -z nodynamic-undefined-weak"
+ }
+@@ -1327,15 +1308,6 @@ if { [isnative]
+ "$NOPIE_CFLAGS" \
+ ] \
+ [list \
+- "Run pr22001-1" \
+- "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \
+- "-Wa,-mx86-used-note=yes" \
+- { pr22001-1b.c } \
+- "pr22001-1" \
+- "pass.out" \
+- "$NOPIE_CFLAGS" \
+- ] \
+- [list \
+ "Run pr22001-1 (PIE 1)" \
+ "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \
+ "-Wa,-mx86-used-note=yes" \
+@@ -1370,15 +1342,6 @@ if { [isnative]
+ "-fPIC" \
+ ] \
+ [list \
+- "Run pr21997-1" \
+- "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr21997-1.so" \
+- "-Wa,-mx86-used-note=yes" \
+- { pr21997-1b.c } \
+- "pr21997-1" \
+- "pass.out" \
+- "$NOPIE_CFLAGS" \
+- ] \
+- [list \
+ "Run pr21997-1 (PIC 1)" \
+ "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr21997-1.so" \
+ "-Wa,-mx86-used-note=yes" \
+--- binutils-2.32/ld/testsuite/ld-i386/no-plt.exp 2019-09-17 13:51:35.771111471 -0500
++++ binutils-2.32/ld/testsuite/ld-i386/no-plt.exp 2019-09-17 14:00:48.581118647 -0500
+@@ -66,69 +66,6 @@ run_cc_link_tests [list \
+ "libno-plt-1a.so" \
+ ] \
+ [list \
+- "Build libno-plt-1b.so" \
+- "-shared tmpdir/no-plt-extern1a.o" \
+- "-Wa,-mx86-used-note=yes" \
+- {dummy.s} \
+- {{readelf -Wr libno-plt-1b.rd} \
+- {objdump -dwrj.text libno-plt-1b.dd}} \
+- "libno-plt-1b.so" \
+- ] \
+- [list \
+- "No PLT (dynamic 1a)" \
+- "$NOPIE_LDFLAGS tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \
+- tmpdir/no-plt-func1.o tmpdir/no-plt-extern1a.o" \
+- "-Wa,-mx86-used-note=yes" \
+- {dummy.s} \
+- {{readelf -Wr no-plt-1a.rd} {objdump -dwrj.text no-plt-1a.dd}} \
+- "no-plt-1a" \
+- ] \
+- [list \
+- "No PLT (dynamic 1b)" \
+- "tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \
+- tmpdir/libno-plt-1a.so tmpdir/libno-plt-1b.so" \
+- "-Wa,-mx86-used-note=yes" \
+- {dummy.s} \
+- {{readelf -Wr no-plt-1b.rd} {objdump -dwrj.text no-plt-1b.dd}} \
+- "no-plt-1b" \
+- ] \
+- [list \
+- "No PLT (dynamic 1c)" \
+- "$NOPIE_LDFLAGS tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \
+- tmpdir/no-plt-func1.o tmpdir/libno-plt-1b.so" \
+- "-Wa,-mx86-used-note=yes" \
+- {dummy.s} \
+- {{readelf -Wr no-plt-1c.rd} {objdump -dwrj.text no-plt-1c.dd}} \
+- "no-plt-1c" \
+- ] \
+- [list \
+- "No PLT (PIE 1e)" \
+- "-pie tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \
+- tmpdir/no-plt-func1.o tmpdir/no-plt-extern1a.o" \
+- "-Wa,-mx86-used-note=yes" \
+- {dummy.s} \
+- {{readelf -Wr no-plt-1e.rd} {objdump -dwrj.text no-plt-1e.dd}} \
+- "no-plt-1e" \
+- ] \
+- [list \
+- "No PLT (PIE 1f)" \
+- "-pie tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \
+- tmpdir/libno-plt-1a.so tmpdir/libno-plt-1b.so" \
+- "-Wa,-mx86-used-note=yes" \
+- { dummy.s } \
+- {{readelf -Wr no-plt-1f.rd} {objdump -dwrj.text no-plt-1f.dd}} \
+- "no-plt-1f" \
+- ] \
+- [list \
+- "No PLT (PIE 1g)" \
+- "-pie tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \
+- tmpdir/no-plt-func1.o tmpdir/libno-plt-1b.so" \
+- "-Wa,-mx86-used-note=yes" \
+- { dummy.s } \
+- {{readelf -Wr no-plt-1g.rd} {objdump -dwrj.text no-plt-1g.dd}} \
+- "no-plt-1g" \
+- ] \
+- [list \
+ "No PLT (dynamic 1h)" \
+ "$NOPIE_LDFLAGS tmpdir/no-plt-check1b.o tmpdir/no-plt-main1.o \
+ tmpdir/no-plt-func1.o tmpdir/no-plt-extern1b.o" \
+@@ -146,15 +83,6 @@ run_cc_link_tests [list \
+ {{readelf -Wr no-plt-1i.rd} {objdump -dwrj.text no-plt-1i.dd}} \
+ "no-plt-1i" \
+ ] \
+- [list \
+- "No PLT (static 1j)" \
+- "-static tmpdir/no-plt-check1b.o tmpdir/no-plt-main1.o \
+- tmpdir/no-plt-func1.o tmpdir/no-plt-extern1b.o" \
+- "-Wa,-mx86-used-note=yes" \
+- {dummy.s} \
+- {{readelf -Wr no-plt-1j.rd} {objdump -dwrj.text no-plt-1j.dd}} \
+- "no-plt-1j" \
+- ] \
+ ]
+
+ run_ld_link_exec_tests [list \
+@@ -168,24 +96,6 @@ run_ld_link_exec_tests [list \
+ "pass.out" \
+ ] \
+ [list \
+- "No PLT (dynamic 1b)" \
+- "tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \
+- tmpdir/libno-plt-1a.so tmpdir/libno-plt-1b.so" \
+- "-Wa,-mx86-used-note=yes" \
+- { dummy.s } \
+- "no-plt-1b" \
+- "pass.out" \
+- ] \
+- [list \
+- "No PLT (dynamic 1c)" \
+- "tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \
+- tmpdir/no-plt-func1.o tmpdir/libno-plt-1b.so" \
+- "-Wa,-mx86-used-note=yes" \
+- { dummy.s } \
+- "no-plt-1c" \
+- "pass.out" \
+- ] \
+- [list \
+ "No PLT (static 1d)" \
+ "-static tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \
+ tmpdir/no-plt-func1.o tmpdir/no-plt-extern1a.o" \
+@@ -204,24 +114,6 @@ run_ld_link_exec_tests [list \
+ "pass.out" \
+ ] \
+ [list \
+- "No PLT (PIE 1f)" \
+- "-pie tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \
+- tmpdir/libno-plt-1a.so tmpdir/libno-plt-1b.so" \
+- "-Wa,-mx86-used-note=yes" \
+- { dummy.s } \
+- "no-plt-1f" \
+- "pass.out" \
+- ] \
+- [list \
+- "No PLT (PIE 1g)" \
+- "-pie tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \
+- tmpdir/no-plt-func1.o tmpdir/libno-plt-1b.so" \
+- "-Wa,-mx86-used-note=yes" \
+- { dummy.s } \
+- "no-plt-1g" \
+- "pass.out" \
+- ] \
+- [list \
+ "No PLT (dynamic 1h)" \
+ "$NOPIE_LDFLAGS tmpdir/no-plt-check1b.o tmpdir/no-plt-main1.o \
+ tmpdir/no-plt-func1.o tmpdir/no-plt-extern1b.o" \
+@@ -239,15 +131,6 @@ run_ld_link_exec_tests [list \
+ "no-plt-1i" \
+ "pass.out" \
+ ] \
+- [list \
+- "No PLT (static 1j)" \
+- "-static tmpdir/no-plt-check1b.o tmpdir/no-plt-main1.o \
+- tmpdir/no-plt-func1.o tmpdir/no-plt-extern1b.o" \
+- "-Wa,-mx86-used-note=yes" \
+- {dummy.s} \
+- "no-plt-1j" \
+- "pass.out" \
+- ] \
+ ]
+
+ # Run-time tests which require working IFUNC support.
diff --git a/system/binutils/CVE-2019-14444.patch b/system/binutils/CVE-2019-14444.patch
new file mode 100644
index 000000000..43d4e2a91
--- /dev/null
+++ b/system/binutils/CVE-2019-14444.patch
@@ -0,0 +1,28 @@
+From e17869db99195849826eaaf5d2d0eb2cfdd7a2a7 Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Mon, 5 Aug 2019 10:40:35 +0100
+Subject: [PATCH] Catch potential integer overflow in readelf when processing
+ corrupt binaries.
+
+ PR 24829
+ * readelf.c (apply_relocations): Catch potential integer overflow
+ whilst checking reloc location against section size.
+---
+ binutils/readelf.c | 2 +-
+
+diff --git a/binutils/readelf.c b/binutils/readelf.c
+index b896ad9..e785fde 100644
+--- a/binutils/readelf.c
++++ b/binutils/readelf.c
+@@ -13366,7 +13366,7 @@ apply_relocations (Filedata * filedata,
+ }
+
+ rloc = start + rp->r_offset;
+- if ((rloc + reloc_size) > end || (rloc < start))
++ if (rloc >= end || (rloc + reloc_size) > end || (rloc < start))
+ {
+ warn (_("skipping invalid relocation offset 0x%lx in section %s\n"),
+ (unsigned long) rp->r_offset,
+--
+2.9.3
+
diff --git a/system/binutils/arm-pie.patch b/system/binutils/arm-pie.patch
new file mode 100644
index 000000000..f42477a04
--- /dev/null
+++ b/system/binutils/arm-pie.patch
@@ -0,0 +1,24 @@
+Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=25056
+Author: Rich Felker <dalias@libc.org>
+Upstream-Status: reported
+
+--- binutils-2.32/bfd/elf32-arm.c.orig 2019-10-02 07:47:36.153918869 -0400
++++ binutils-2.32/bfd/elf32-arm.c 2019-10-02 08:37:09.108263016 -0400
+@@ -11624,7 +11624,7 @@
+ {
+ /* If we don't know the module number, create a relocation
+ for it. */
+- if (bfd_link_pic (info))
++ if (bfd_link_dll (info))
+ {
+ Elf_Internal_Rela outrel;
+
+@@ -11728,7 +11728,7 @@
+ now, and emit any relocations. If both an IE GOT and a
+ GD GOT are necessary, we emit the GD first. */
+
+- if ((bfd_link_pic (info) || indx != 0)
++ if ((bfd_link_dll (info) || indx != 0)
+ && (h == NULL
+ || (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ && !resolved_to_zero)