diff -Nru upx-ucl-3.96/debian/changelog upx-ucl-3.96/debian/changelog --- upx-ucl-3.96/debian/changelog 2020-03-08 12:48:26.000000000 +0000 +++ upx-ucl-3.96/debian/changelog 2020-06-05 10:14:39.000000000 +0000 @@ -1,3 +1,11 @@ +upx-ucl (3.96-2) unstable; urgency=medium + + * Add 02-arm64-crashes.patch that reverts one of upstream commits, what should + fix crashes visible on arm64 (closes: 955157). + * Bump debhelper's compat version to 13. + + -- Robert Luberda Fri, 05 Jun 2020 12:14:39 +0200 + upx-ucl (3.96-1) unstable; urgency=medium * New upstream version: diff -Nru upx-ucl-3.96/debian/control upx-ucl-3.96/debian/control --- upx-ucl-3.96/debian/control 2020-03-08 12:48:26.000000000 +0000 +++ upx-ucl-3.96/debian/control 2020-06-05 10:14:39.000000000 +0000 @@ -3,7 +3,7 @@ Priority: optional Maintainer: Robert Luberda Standards-Version: 4.5.0 -Build-Depends: debhelper-compat (= 12), libucl-dev (>= 1.03), zlib1g-dev (>= 1:1.1.4) +Build-Depends: debhelper-compat (= 13), libucl-dev (>= 1.03), zlib1g-dev (>= 1:1.1.4) Homepage: https://upx.github.io/ Rules-Requires-Root: no Vcs-Git: https://salsa.debian.org/debian/upx-ucl.git diff -Nru upx-ucl-3.96/debian/patches/02-arm64-crashes.patch upx-ucl-3.96/debian/patches/02-arm64-crashes.patch --- upx-ucl-3.96/debian/patches/02-arm64-crashes.patch 1970-01-01 00:00:00.000000000 +0000 +++ upx-ucl-3.96/debian/patches/02-arm64-crashes.patch 2020-06-05 10:14:39.000000000 +0000 @@ -0,0 +1,55 @@ +From: Robert Luberda +Date: Fri, 5 Jun 2020 11:51:20 +0200 +Subject: Fix crashes on arm64 + +Revert the following upstream commit: + +> commit d4e2d7e8a80e0e3d95e17bbc0bcf649bad3da19a +> Author: John Reiser +> Date: Fri Mar 1 20:31:41 2019 -0800 +> +> arm64 (aarch64) and PAGE_SIZE > 4KiB +> +> Future: use prctl(PR_SET_MM, PR_SET_MM_START_BRK, addr) +> https://github.com/upx/upx/issues/254 +> modified: p_lx_elf.cpp +> modified: stub/src/amd64-linux.elf-main.c + +Reverting the commit should fix crashes visible on arm, even though +according to upstream authors,a bug is in Linux kernel, see +https://github.com/upx/upx/issues/351 + +Bugs-Debian: https://bugs.debian.org/955157 +--- + src/p_lx_elf.cpp | 2 +- + src/stub/src/amd64-linux.elf-main.c | 4 +--- + 2 files changed, 2 insertions(+), 4 deletions(-) + +diff --git a/src/p_lx_elf.cpp b/src/p_lx_elf.cpp +index c03d6ee..91926af 100644 +--- a/src/p_lx_elf.cpp ++++ b/src/p_lx_elf.cpp +@@ -523,7 +523,7 @@ off_t PackLinuxElf64::pack3(OutputFile *fo, Filter &ft) + // So: pretend 4KiB pages. + upx_uint64_t const pm = ( + Elf64_Ehdr::EM_X86_64 ==e_machine +- //|| Elf64_Ehdr::EM_AARCH64==e_machine ++ || Elf64_Ehdr::EM_AARCH64==e_machine + //|| Elf64_Ehdr::EM_PPC64 ==e_machine /* DOES NOT WORK! */ + ) + ? ((~(upx_uint64_t)0)<<12) +diff --git a/src/stub/src/amd64-linux.elf-main.c b/src/stub/src/amd64-linux.elf-main.c +index 4e3e05f..7c42e51 100644 +--- a/src/stub/src/amd64-linux.elf-main.c ++++ b/src/stub/src/amd64-linux.elf-main.c +@@ -433,9 +433,7 @@ xfind_pages(unsigned mflags, Elf64_Phdr const *phdr, int phnum, + } + } + DPRINTF(" addr=%%p lo=%%p hi=%%p\\n", addr, lo, hi); +- // PROT_WRITE allows testing of 64k pages on 4k Linux +- addr = (Elf64_Addr)mmap((void *)addr, hi, (DEBUG ? PROT_WRITE : PROT_NONE), // FIXME XXX EVIL +- mflags, -1, 0); ++ addr = (Elf64_Addr)mmap((void *)addr, hi, PROT_NONE, mflags, -1, 0); + DPRINTF(" addr=%%p\\n", addr); + *p_brk = hi + addr; // the logical value of brk(0) + return (Elf64_Addr)(addr - lo); diff -Nru upx-ucl-3.96/debian/patches/series upx-ucl-3.96/debian/patches/series --- upx-ucl-3.96/debian/patches/series 2020-03-08 12:48:26.000000000 +0000 +++ upx-ucl-3.96/debian/patches/series 2020-06-05 10:14:39.000000000 +0000 @@ -1 +1,2 @@ 01-Documentation.patch +02-arm64-crashes.patch