John Reiser
|
65b06f6046
|
More LZMA inSize (srclen) defense
https://github.com/upx/upx/issues/717
modified: stub/src/amd64-darwin.dylib-entry.S fixed
modified: stub/src/amd64-darwin.macho-entry.S fixed
modified: stub/src/amd64-linux.elf-so_entry.S comment-only
modified: stub/src/i386-linux.elf-so_entry.S comment-only
modified: stub/amd64-darwin.dylib-entry.h
modified: stub/amd64-darwin.macho-entry.h
modified: stub/amd64-linux.elf-so_entry.h
modified: stub/tmp/amd64-darwin.dylib-entry.bin.dump
modified: stub/tmp/amd64-darwin.macho-entry.bin.dump
modified: stub/tmp/amd64-linux.elf-so_entry.bin.dump
Find+fix steps that were performed:
1. Find all 'add' instructions that compute "eof".
NRV run-time decompressors ignore srclen, so 'add' can be ignored for them.
$ cd upx-devel4/src/stub
$ grep -sr 'add.*eof' src | grep -v 'nrv2._d.*.S' | sort
src/amd64-darwin.dylib-entry.S: addq src,lsrc; push lsrc // &input_eof
src/amd64-darwin.macho-entry.S: addq src,lsrc; push lsrc // &input_eof
src/amd64-linux.elf-entry.S: addq src,lsrc; push lsrc // &input_eof
src/amd64-linux.elf-so_entry.S: addq src,lsrc; push lsrc // MATCH_05 &input_eof
src/amd64-linux.elf-so_main.c: void *mfd_addr = Pmap(0, sizeof(code), PROT_READ|PROT_EXEC, MAP_PRIVATE, mfd, 0);
src/amd64-linux.shlib-init.S: addq src,lsrc; push lsrc // &input_eof
src/arch/amd64/lzma_d.S:// addq src,lsrc; push lsrc // &input_eof
src/i386-expand.S: add src,%ecx; push %ecx // MATCH_52 eof_src
src/i386-linux.elf-so_entry.S: add src,lsrc; push lsrc // MATCH_05 &input_eof
2. Case-by-case inspection
src/amd64-darwin.dylib-entry.S: addq src,lsrc; push lsrc // &input_eof
restoring 'subq' is added in this commit
src/amd64-darwin.macho-entry.S: addq src,lsrc; push lsrc // &input_eof
restoring 'subq' is added in this commit
src/amd64-linux.elf-entry.S: addq src,lsrc; push lsrc // &input_eof
a restoring 'subq' is already next
src/amd64-linux.elf-so_entry.S: addq src,lsrc; push lsrc // MATCH_05 &input_eof
lsrc is dead for inlined nrv2b
src/amd64-linux.elf-so_main.c: void *mfd_addr = Pmap(0, sizeof(code), PROT_READ|PROT_EXEC, MAP_PRIVATE, mfd, 0);
.c code
src/amd64-linux.shlib-init.S: addq src,lsrc; push lsrc // &input_eof
restoring 'subq' is already next
src/arch/amd64/lzma_d.S:// addq src,lsrc; push lsrc // &input_eof
comment that explains preceding actions in ELFMAINX; a restoring 'subq' is already next
src/i386-expand.S: add src,%ecx; push %ecx // MATCH_52 eof_src
%ecx is dead
src/i386-linux.elf-so_entry.S: add src,lsrc; push lsrc // MATCH_05 &input_eof
lsrc is dead for inlined nrv2b
|
2023-10-12 10:41:13 -07:00 |
John Reiser
|
0515be4334
|
LZMA on AMD64 had bug in calling sequence, leading to random exit(127)
LzmaDecode randomly decided that the input had ended in the middle,
because of error in interface between ELFMAINX and the decoder.
Thanks to Kevin Gosse!
https://github.com/upx/upx/pull/716
https://github.com/MichalStrehovsky/PublishAotCompressed/issues/11
|
2023-10-06 14:14:32 -07:00 |
Markus F.X.J. Oberhumer
|
e32de83758
|
CI updates
|
2023-10-05 12:23:17 +02:00 |
Markus F.X.J. Oberhumer
|
e767461f65
|
src: more clang-format
|
2023-10-05 11:53:02 +02:00 |
Markus F.X.J. Oberhumer
|
632c7c4826
|
all: assorted cleanups; introduce undocumented '--sysinfo' option
|
2023-10-05 03:51:27 +02:00 |
Markus F.X.J. Oberhumer
|
7f9d381c7b
|
CI updates
|
2023-09-30 10:46:39 +02:00 |
Markus F.X.J. Oberhumer
|
4d5d6661d5
|
submodules: update for new versions
|
2023-09-30 09:44:58 +02:00 |
John Reiser
|
b0b87eda02
|
check-whitespace
modified: stub/src/upxfd_android.c
|
2023-09-28 12:49:14 -07:00 |
John Reiser
|
f63a673a8b
|
Prepare to emulate memfd_create() on 32-bit Android (ARM and i386)
modified: stub/src/include/linux.h
new file: stub/src/upxfd_android.c
new file: stub/src/upxfd_create.c
|
2023-09-28 12:44:49 -07:00 |
John Reiser
|
290dd0c5d2
|
Git straggler
modified: src/stub/tmp/i386-linux.elf-entry.bin.dump
|
2023-09-28 12:09:32 -07:00 |
John Reiser
|
194bf2b852
|
Common prototypes for mmap and ftruncate
modified: src/stub/src/include/linux.h
modified: src/stub/src/amd64-linux.elf-so_main.c
modified: src/stub/src/i386-linux.elf-so_main.c
modified: src/stub/src/i386-linux.elf.execve-main.c
modified: src/stub/src/i386-linux.elf.interp-main.c
modified: src/stub/src/i386-linux.elf.shell-main.c
|
2023-09-28 12:07:04 -07:00 |
John Reiser
|
d6d5e7ae3d
|
For Android emulator: align i386 LEXEC020 binfo
modified: src/stub/src/i386-linux.elf-entry.S
modified: src/p_lx_elf.cpp
modified: src/stub/i386-linux.elf-entry.h
modified: misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
|
2023-09-28 12:02:28 -07:00 |
Markus F.X.J. Oberhumer
|
39a6cc4b5f
|
src: improve memory sanitizer handling
|
2023-09-26 15:15:55 +02:00 |
Markus F.X.J. Oberhumer
|
a24de15060
|
submodules: update for new versions
|
2023-09-26 15:15:55 +02:00 |
Markus F.X.J. Oberhumer
|
eb021accd1
|
CI updates
|
2023-09-25 13:47:43 +02:00 |
Markus F.X.J. Oberhumer
|
98a77dde00
|
CI updates
|
2023-09-22 17:33:22 +02:00 |
John Reiser
|
854988bc5f
|
Detect AlreadyPacked even when trailing PackHeader has been lopped.
This is heuristic, but strong.
https://github.com/upx/upx/issues/712
modified: p_lx_elf.cpp
modified: p_unix.h
|
2023-09-21 14:12:18 -07:00 |
John Reiser
|
bfeed2ab9a
|
MAP_PRIVATE to capture memfd pages before closing the fd
https://github.com/upx/upx/issues/710
modified: stub/src/amd64-linux.elf-so_main.c
modified: stub/src/i386-linux.elf-so_main.c
modified: stub/amd64-linux.elf-so_fold.h
modified: stub/arm.v4a-linux.elf-so_fold.h
modified: stub/arm.v5a-linux.elf-so_fold.h
modified: stub/arm64-linux.elf-so_fold.h
modified: stub/i386-linux.elf-so_fold.h
|
2023-09-20 13:12:04 -07:00 |
Markus F.X.J. Oberhumer
|
d11fc71e79
|
CI updates
|
2023-09-20 11:24:55 +02:00 |
Markus F.X.J. Oberhumer
|
f1703fa322
|
CI updates
|
2023-09-19 11:47:15 +02:00 |
Markus F.X.J. Oberhumer
|
06675acc67
|
all: cosmetic cleanups
|
2023-09-18 15:19:37 +02:00 |
Markus F.X.J. Oberhumer
|
57ad6bc37d
|
CI updates
|
2023-09-11 06:52:57 +02:00 |
dependabot[bot]
|
0192b0b7e4
|
build(deps): bump actions/checkout from 3 to 4 (#707)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
|
2023-09-06 18:54:02 +02:00 |
Markus F.X.J. Oberhumer
|
3b098b845a
|
CI updates
|
2023-09-06 12:48:30 +02:00 |
Markus F.X.J. Oberhumer
|
ac398f1ffe
|
CI updates
|
2023-09-06 01:48:20 +02:00 |
Markus F.X.J. Oberhumer
|
92dfb9c83c
|
testsuite: add file system test suite test_symlinks.sh
|
2023-09-06 00:09:44 +02:00 |
Markus F.X.J. Oberhumer
|
38d6cb090c
|
src/packer.cpp: fix bug in constructor introduced during cleanup
Introduced in 10e759f1f1
|
2023-09-05 21:09:17 +02:00 |
Markus F.X.J. Oberhumer
|
e93172bd33
|
src/work.cpp: clean up get_open_flags()
|
2023-09-05 06:09:13 +02:00 |
Markus F.X.J. Oberhumer
|
30fcca4b64
|
src: optimize preserve_link: only if the file has actual link-count >= 2
|
2023-09-05 05:50:47 +02:00 |
Markus F.X.J. Oberhumer
|
4f6320d3aa
|
src: add new option `--link` to preserve hard links; use with care
|
2023-09-04 22:34:21 +02:00 |
Markus F.X.J. Oberhumer
|
62dbf8485f
|
src: sort cleanups
|
2023-09-04 07:28:48 +02:00 |
John Reiser
|
9331ed39d4
|
32-bit Android lacks memfd_create, and has varying __NR_ftruncate
https://github.com/upx/upx/issues/700
modified: stub/src/i386-linux.elf-so_main.c
modified: stub/src/arm.v4a-linux.elf-so_entry.S
modified: stub/src/arm.v4a-linux.elf-so_fold.S
modified: stub/arm.v4a-linux.elf-so_entry.h
modified: stub/arm.v4a-linux.elf-so_fold.h
modified: stub/arm.v5a-linux.elf-so_entry.h
modified: stub/arm.v5a-linux.elf-so_fold.h
|
2023-09-02 15:31:32 -07:00 |
Markus F.X.J. Oberhumer
|
35dd9cfd22
|
src: retract libc qsort() requirements
|
2023-09-02 16:15:57 +02:00 |
Markus F.X.J. Oberhumer
|
0ac6c36af2
|
src: add a check for libc qsort(); cleanups
|
2023-09-01 11:59:29 +02:00 |
Markus F.X.J. Oberhumer
|
3c4b959f78
|
all: update clang-format settings
|
2023-09-01 11:29:51 +02:00 |
Markus F.X.J. Oberhumer
|
a00687b092
|
src/p_mach.cpp: make sort order deterministic
|
2023-09-01 11:11:00 +02:00 |
Markus F.X.J. Oberhumer
|
bb6b087862
|
src: implement upx_shellsort()
|
2023-09-01 10:49:47 +02:00 |
John Reiser
|
bfb438dc89
|
Sync stubs
modified: stub/amd64-linux.elf-so_fold.h
modified: stub/arm.v4a-linux.elf-so_fold.h
modified: stub/arm.v5a-linux.elf-so_fold.h
modified: stub/arm64-linux.elf-so_fold.h
modified: stub/i386-linux.elf-so_fold.h
modified: stub/tmp/amd64-linux.elf-so_fold.bin.dump
|
2023-08-31 13:34:49 -07:00 |
John Reiser
|
cd3f69c290
|
Explicit write() can subsume ftruncate()
modified: stub/src/amd64-linux.elf-so_main.c
modified: stub/src/i386-linux.elf-so_main.c
|
2023-08-31 13:25:53 -07:00 |
Markus F.X.J. Oberhumer
|
d54315392e
|
src: add support for NO_COLOR environment variable
|
2023-08-31 12:31:31 +02:00 |
Markus F.X.J. Oberhumer
|
cfa8107ab9
|
src: make sort order deterministic, next try
We cannot compare pointers as they may point to qsort-local objects.
And we must make sure that cmp(a,b) always agrees with cmp(b,a).
|
2023-08-30 16:41:59 +02:00 |
Markus F.X.J. Oberhumer
|
f4e5b29708
|
src: make sort order deterministic
|
2023-08-28 02:08:34 +02:00 |
Markus F.X.J. Oberhumer
|
d65fea1147
|
src/bele.h: try to detect possible size-mismatches
|
2023-08-28 00:23:53 +02:00 |
Markus F.X.J. Oberhumer
|
25a3c109c1
|
CI updates
|
2023-08-27 13:30:51 +02:00 |
John Reiser
|
b526eed346
|
Detect "no Shdrs" earlier when already packed
https://github.com/upx/upx/issues/699
modified: p_lx_elf.cpp
|
2023-08-23 19:52:35 +02:00 |
John Reiser
|
59c6a71b72
|
More use of ph_forced_method()
modified: p_lx_elf.cpp
|
2023-08-23 19:52:35 +02:00 |
John Reiser
|
c7a2a0faa1
|
Document path to mach-o/loader.h on Apple CommandLineTools
modified: p_mach_enum.h
|
2023-08-23 19:52:35 +02:00 |
John Reiser
|
bfb5ea50a9
|
Temporary
modified: p_lx_elf.cpp
|
2023-08-23 19:52:35 +02:00 |
John Reiser
|
149d84edca
|
--brute versus forced_method(ph.method)
https://github.com/upx/upx/issues/694 (partial)
modified: p_lx_elf.cpp
|
2023-08-23 19:52:35 +02:00 |
Markus F.X.J. Oberhumer
|
7636abc158
|
CI updates
|
2023-08-22 11:12:48 +02:00 |