summarylogtreecommitdiffstats
path: root/2015_spectre_variant2_bug1542958.patch
diff options
context:
space:
mode:
authorBjörn Bidar2019-05-21 19:58:24 +0200
committerBjörn Bidar2019-05-22 09:56:05 +0200
commitf10fff05999bdb852ea4598cb4fd934815d808ca (patch)
treee9f14b43af7fd8f745ea9691bf79081bfa4e8826 /2015_spectre_variant2_bug1542958.patch
parent0307526376aba5d42c0056301d083023fdde010b (diff)
downloadaur-f10fff05999bdb852ea4598cb4fd934815d808ca.tar.gz
upkg
- new upstream release - update unity-menubar/global menu patch to 67.x - update rust 1.33 support to 67.x, use gentoos patches in that case - add patch to fix compiling with specter migrations - patch patch to use system av1 instead of bundled - add url to gentoo patch source - document deps for --enable-system=<lib> deps - add missing harbuzz and graphite deps
Diffstat (limited to '2015_spectre_variant2_bug1542958.patch')
-rw-r--r--2015_spectre_variant2_bug1542958.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/2015_spectre_variant2_bug1542958.patch b/2015_spectre_variant2_bug1542958.patch
new file mode 100644
index 000000000000..5a3a97c42578
--- /dev/null
+++ b/2015_spectre_variant2_bug1542958.patch
@@ -0,0 +1,32 @@
+# HG changeset patch
+# Parent f5febee8d7dc9cf6ba776d6a8550f87eb343f998
+Bug 1542958 - fix code section adjustments in elfhack; r=glandium
+
+We were never adjusting `last` in this loop, so we were computing the
+wrong addresses for all sections beyond the first. Which in turn meant
+that we would compute the wrong size for the section data we needed to
+allocate.
+
+Differential Revision: https://phabricator.services.mozilla.com/D28195
+
+diff --git a/build/unix/elfhack/elfhack.cpp b/build/unix/elfhack/elfhack.cpp
+--- a/build/unix/elfhack/elfhack.cpp
++++ b/build/unix/elfhack/elfhack.cpp
+@@ -172,16 +172,17 @@ class ElfRelHackCode_Section : public El
+ unsigned int addr = last->getShdr().sh_addr + last->getSize();
+ if (addr & ((*c)->getAddrAlign() - 1))
+ addr = (addr | ((*c)->getAddrAlign() - 1)) + 1;
+ (*c)->getShdr().sh_addr = addr;
+ // We need to align this section depending on the greater
+ // alignment required by code sections.
+ if (shdr.sh_addralign < (*c)->getAddrAlign())
+ shdr.sh_addralign = (*c)->getAddrAlign();
++ last = *c;
+ }
+ shdr.sh_size = code.back()->getAddr() + code.back()->getSize();
+ data = static_cast<char *>(malloc(shdr.sh_size));
+ if (!data) {
+ throw std::runtime_error("Could not malloc ElfSection data");
+ }
+ char *buf = data;
+ for (c = code.begin(); c != code.end(); ++c) {