Gentoo Archives: gentoo-commits

From: Conrad Kostecki <conikost@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-arch/upx/, app-arch/upx/files/
Date: Mon, 31 Oct 2022 22:51:23
Message-Id: 1667256659.c5af888421c9b7acf5c5ee521a53c6b88f433a50.conikost@gentoo
1 commit: c5af888421c9b7acf5c5ee521a53c6b88f433a50
2 Author: Azamat H. Hackimov <azamat.hackimov <AT> gmail <DOT> com>
3 AuthorDate: Sun Oct 30 12:38:21 2022 +0000
4 Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
5 CommitDate: Mon Oct 31 22:50:59 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c5af8884
7
8 app-arch/upx: drop 3.96-r2
9
10 Signed-off-by: Azamat H. Hackimov <azamat.hackimov <AT> gmail.com>
11 Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>
12
13 app-arch/upx/Manifest | 1 -
14 app-arch/upx/files/upx-3.96_CVE-2020-24119.patch | 34 -----------
15 app-arch/upx/files/upx-3.96_CVE-2021-20285.patch | 76 ------------------------
16 app-arch/upx/upx-3.96-r2.ebuild | 41 -------------
17 4 files changed, 152 deletions(-)
18
19 diff --git a/app-arch/upx/Manifest b/app-arch/upx/Manifest
20 index 305f77a6cf04..d1fc5bbdc5a7 100644
21 --- a/app-arch/upx/Manifest
22 +++ b/app-arch/upx/Manifest
23 @@ -1,2 +1 @@
24 -DIST upx-3.96-src.tar.xz 792524 BLAKE2B 21af85dbcfdd1bf0151a653c865db13c9f30b9de0b9b4b94557ddd55736c7053dd829c5d72b9a7e5aa94a71ecc0151145dd66d7d98ded178c50ff7357d0ba442 SHA512 2d4d1be21d274d9bfdee9b9815396f5e5ff0bcdfb781b7be5fafa4d1e224028e412ec5f5ba607c482671aae27ccf9069abb2db0fb58f78f3a102a51897df2b11
25 DIST upx-4.0.0-src.tar.xz 1159308 BLAKE2B d2626a63b626f9b4e913b822e699fa93b7080d322b19555d44d7cf4ce17b37f0d50ec1381d07d0e4f8827e8edcd29d525d497fa79acd18d520ac58e176fb2b72 SHA512 fe3e8c594e845a91338b1e11fe3cb6371430af40a567187d63835e27da8b2abf993a104b0693063f4db984234bada7b2bd16ad79e3ad90861a1f495d99de7de6
26
27 diff --git a/app-arch/upx/files/upx-3.96_CVE-2020-24119.patch b/app-arch/upx/files/upx-3.96_CVE-2020-24119.patch
28 deleted file mode 100644
29 index 7e6de04948bd..000000000000
30 --- a/app-arch/upx/files/upx-3.96_CVE-2020-24119.patch
31 +++ /dev/null
32 @@ -1,34 +0,0 @@
33 -From 87b73e5cfdc12da94c251b2cd83bb01c7d9f616c Mon Sep 17 00:00:00 2001
34 -From: John Reiser <jreiser@××××××××.com>
35 -Date: Wed, 22 Jul 2020 19:34:27 -0700
36 -Subject: [PATCH] Unpack: Phdrs must be within expansion of first compressed
37 - block
38 -
39 -https://github.com/upx/upx/issues/388
40 - modified: p_lx_elf.cpp
41 ----
42 - src/p_lx_elf.cpp | 4 ++--
43 - 1 file changed, 2 insertions(+), 2 deletions(-)
44 -
45 -diff --git a/src/p_lx_elf.cpp b/src/p_lx_elf.cpp
46 -index cd9e4ec97..453d5c457 100644
47 ---- a/src/p_lx_elf.cpp
48 -+++ b/src/p_lx_elf.cpp
49 -@@ -4550,7 +4550,7 @@ void PackLinuxElf64::unpack(OutputFile *fo)
50 - unsigned c_adler = upx_adler32(NULL, 0);
51 - unsigned u_adler = upx_adler32(NULL, 0);
52 - #define MAX_ELF_HDR 1024
53 -- if ((MAX_ELF_HDR - sizeof(Elf64_Ehdr))/sizeof(Elf64_Phdr) < u_phnum) {
54 -+ if ((umin64(MAX_ELF_HDR, ph.u_len) - sizeof(Elf64_Ehdr))/sizeof(Elf64_Phdr) < u_phnum) {
55 - throwCantUnpack("bad compressed e_phnum");
56 - }
57 - #undef MAX_ELF_HDR
58 -@@ -5617,7 +5617,7 @@ void PackLinuxElf32::unpack(OutputFile *fo)
59 - unsigned c_adler = upx_adler32(NULL, 0);
60 - unsigned u_adler = upx_adler32(NULL, 0);
61 - #define MAX_ELF_HDR 512
62 -- if ((MAX_ELF_HDR - sizeof(Elf32_Ehdr))/sizeof(Elf32_Phdr) < u_phnum) {
63 -+ if ((umin(MAX_ELF_HDR, ph.u_len) - sizeof(Elf32_Ehdr))/sizeof(Elf32_Phdr) < u_phnum) {
64 - throwCantUnpack("bad compressed e_phnum");
65 - }
66 - #undef MAX_ELF_HDR
67
68 diff --git a/app-arch/upx/files/upx-3.96_CVE-2021-20285.patch b/app-arch/upx/files/upx-3.96_CVE-2021-20285.patch
69 deleted file mode 100644
70 index 1d47b2a8bb67..000000000000
71 --- a/app-arch/upx/files/upx-3.96_CVE-2021-20285.patch
72 +++ /dev/null
73 @@ -1,76 +0,0 @@
74 -From 3781df9da23840e596d5e9e8493f22666802fe6c Mon Sep 17 00:00:00 2001
75 -From: John Reiser <jreiser@××××××××.com>
76 -Date: Fri, 11 Dec 2020 13:38:18 -0800
77 -Subject: [PATCH] Check DT_REL/DT_RELA, DT_RELSZ/DT_RELASZ
78 -
79 -https://github.com/upx/upx/issues/421
80 - modified: p_lx_elf.cpp
81 ----
82 - src/p_lx_elf.cpp | 34 +++++++++++++++++++++++++++++-----
83 - 1 file changed, 29 insertions(+), 5 deletions(-)
84 -
85 -diff --git a/src/p_lx_elf.cpp b/src/p_lx_elf.cpp
86 -index 182db192..3a4101cf 100644
87 ---- a/src/p_lx_elf.cpp
88 -+++ b/src/p_lx_elf.cpp
89 -@@ -2222,8 +2222,20 @@ bool PackLinuxElf32::canPack()
90 - int z_rsz = dt_table[Elf32_Dyn::DT_RELSZ];
91 - if (z_rel && z_rsz) {
92 - unsigned rel_off = get_te32(&dynseg[-1+ z_rel].d_val);
93 -+ if ((unsigned)file_size <= rel_off) {
94 -+ char msg[70]; snprintf(msg, sizeof(msg),
95 -+ "bad Elf32_Dynamic[DT_REL] %#x\n",
96 -+ rel_off);
97 -+ throwCantPack(msg);
98 -+ }
99 - Elf32_Rel *rp = (Elf32_Rel *)&file_image[rel_off];
100 - unsigned relsz = get_te32(&dynseg[-1+ z_rsz].d_val);
101 -+ if ((unsigned)file_size <= relsz) {
102 -+ char msg[70]; snprintf(msg, sizeof(msg),
103 -+ "bad Elf32_Dynamic[DT_RELSZ] %#x\n",
104 -+ relsz);
105 -+ throwCantPack(msg);
106 -+ }
107 - Elf32_Rel *last = (Elf32_Rel *)(relsz + (char *)rp);
108 - for (; rp < last; ++rp) {
109 - unsigned r_va = get_te32(&rp->r_offset);
110 -@@ -2562,14 +2574,26 @@ PackLinuxElf64::canPack()
111 - int z_rel = dt_table[Elf64_Dyn::DT_RELA];
112 - int z_rsz = dt_table[Elf64_Dyn::DT_RELASZ];
113 - if (z_rel && z_rsz) {
114 -- unsigned rel_off = get_te64(&dynseg[-1+ z_rel].d_val);
115 -+ upx_uint64_t rel_off = get_te64(&dynseg[-1+ z_rel].d_val);
116 -+ if ((u64_t)file_size <= rel_off) {
117 -+ char msg[70]; snprintf(msg, sizeof(msg),
118 -+ "bad Elf64_Dynamic[DT_RELA] %#llx\n",
119 -+ rel_off);
120 -+ throwCantPack(msg);
121 -+ }
122 - Elf64_Rela *rp = (Elf64_Rela *)&file_image[rel_off];
123 -- unsigned relsz = get_te64(&dynseg[-1+ z_rsz].d_val);
124 -+ upx_uint64_t relsz = get_te64(&dynseg[-1+ z_rsz].d_val);
125 -+ if ((u64_t)file_size <= relsz) {
126 -+ char msg[70]; snprintf(msg, sizeof(msg),
127 -+ "bad Elf64_Dynamic[DT_RELASZ] %#llx\n",
128 -+ relsz);
129 -+ throwCantPack(msg);
130 -+ }
131 - Elf64_Rela *last = (Elf64_Rela *)(relsz + (char *)rp);
132 - for (; rp < last; ++rp) {
133 -- unsigned r_va = get_te64(&rp->r_offset);
134 -+ upx_uint64_t r_va = get_te64(&rp->r_offset);
135 - if (r_va == user_init_ava) { // found the Elf64_Rela
136 -- unsigned r_info = get_te64(&rp->r_info);
137 -+ upx_uint64_t r_info = get_te64(&rp->r_info);
138 - unsigned r_type = ELF64_R_TYPE(r_info);
139 - if (Elf64_Ehdr::EM_AARCH64 == e_machine
140 - && R_AARCH64_RELATIVE == r_type) {
141 -@@ -2581,7 +2605,7 @@ PackLinuxElf64::canPack()
142 - }
143 - else {
144 - char msg[50]; snprintf(msg, sizeof(msg),
145 -- "bad relocation %#x DT_INIT_ARRAY[0]",
146 -+ "bad relocation %#llx DT_INIT_ARRAY[0]",
147 - r_info);
148 - throwCantPack(msg);
149 - }
150
151 diff --git a/app-arch/upx/upx-3.96-r2.ebuild b/app-arch/upx/upx-3.96-r2.ebuild
152 deleted file mode 100644
153 index 14c355bb6351..000000000000
154 --- a/app-arch/upx/upx-3.96-r2.ebuild
155 +++ /dev/null
156 @@ -1,41 +0,0 @@
157 -# Copyright 1999-2021 Gentoo Authors
158 -# Distributed under the terms of the GNU General Public License v2
159 -
160 -EAPI=7
161 -
162 -inherit toolchain-funcs
163 -
164 -DESCRIPTION="Ultimate Packer for eXecutables (free version using UCL compression and not NRV)"
165 -HOMEPAGE="https://upx.github.io/"
166 -SRC_URI="https://github.com/upx/upx/releases/download/v${PV}/${P}-src.tar.xz"
167 -
168 -LICENSE="GPL-2+ UPX-exception" # Read the exception before applying any patches
169 -SLOT="0"
170 -KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~sparc ~x86"
171 -IUSE=""
172 -
173 -DEPEND=">=dev-libs/ucl-1.03
174 - sys-libs/zlib"
175 -RDEPEND="${RDEPEND}
176 - !app-arch/upx-bin"
177 -BDEPEND="
178 - app-arch/xz-utils[extra-filters]
179 - dev-lang/perl"
180 -
181 -S="${WORKDIR}/${P}-src"
182 -
183 -PATCHES=(
184 - "${FILESDIR}/${P}_CVE-2020-24119.patch"
185 - "${FILESDIR}/${P}_CVE-2021-20285.patch"
186 -)
187 -
188 -src_compile() {
189 - tc-export CXX
190 - emake CXXFLAGS_WERROR="" all
191 -}
192 -
193 -src_install() {
194 - newbin src/upx.out upx
195 - dodoc BUGS NEWS PROJECTS README* THANKS doc/*.txt doc/upx.html
196 - doman doc/upx.1
197 -}