Linux EINVAL for zero-length mmap: mmap(, 0, ,,,)

https://github.com/upx/upx/issues/681
	modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/i386-linux.elf-main.c

	modified:   stub/src/i386-bsd.elf-main.c
	modified:   stub/src/i386-openbsd.elf-main.c

	modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh

	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/i386-bsd.elf-fold.h
	modified:   stub/i386-linux.elf-fold.h
	modified:   stub/i386-netbsd.elf-fold.h
	modified:   stub/i386-openbsd.elf-fold.h
	modified:   stub/mips.r3000-linux.elf-fold.h
	modified:   stub/mipsel.r3000-linux.elf-fold.h
	modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/powerpc64-linux.elf-fold.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	modified:   stub/tmp/amd64-linux.elf-fold.map
	modified:   stub/tmp/arm64-linux.elf-fold.map
	modified:   stub/tmp/i386-bsd.elf-fold.map
	modified:   stub/tmp/i386-linux.elf-fold.map
	modified:   stub/tmp/i386-netbsd.elf-fold.map
	modified:   stub/tmp/i386-openbsd.elf-fold.map
	modified:   stub/tmp/mips.r3000-linux.elf-fold.map
	modified:   stub/tmp/mipsel.r3000-linux.elf-fold.map
	modified:   stub/tmp/powerpc-linux.elf-fold.map
	modified:   stub/tmp/powerpc64-linux.elf-fold.map
	modified:   stub/tmp/powerpc64le-linux.elf-fold.map
This commit is contained in:
John Reiser
2023-07-05 13:44:24 -07:00
committed by Markus F.X.J. Oberhumer
parent c429859cbf
commit 12c36bab6c
27 changed files with 1330 additions and 1330 deletions
+74 -74
View File
@@ -1,5 +1,5 @@
/* i386-openbsd.elf-fold.h
created from i386-openbsd.elf-fold.bin, 2033 (0x7f1) bytes
created from i386-openbsd.elf-fold.bin, 2041 (0x7f9) bytes
This file is part of the UPX executable compressor.
@@ -31,17 +31,17 @@
*/
#define STUB_I386_OPENBSD_ELF_FOLD_SIZE 2033
#define STUB_I386_OPENBSD_ELF_FOLD_ADLER32 0x325f65b8
#define STUB_I386_OPENBSD_ELF_FOLD_CRC32 0x5b86be92
#define STUB_I386_OPENBSD_ELF_FOLD_SIZE 2041
#define STUB_I386_OPENBSD_ELF_FOLD_ADLER32 0xd82f6816
#define STUB_I386_OPENBSD_ELF_FOLD_CRC32 0x8c403cd5
unsigned char stub_i386_openbsd_elf_fold[2033] = {
unsigned char stub_i386_openbsd_elf_fold[2041] = {
/* 0x0000 */ 127, 69, 76, 70, 1, 1, 1, 12, 0, 0, 0, 0, 0, 0, 0, 0,
/* 0x0010 */ 2, 0, 3, 0, 1, 0, 0, 0,128, 16,192, 0, 52, 0, 0, 0,
/* 0x0020 */ 0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 32, 0, 2, 0, 0, 0,
/* 0x0030 */ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 16,192, 0,
/* 0x0040 */ 0, 16,192, 0,241, 7, 0, 0,244, 7, 0, 0, 5, 0, 0, 0,
/* 0x0050 */ 0, 16, 0, 0, 1, 0, 0, 0,241, 7, 0, 0, 0, 0, 0, 0,
/* 0x0040 */ 0, 16,192, 0,249, 7, 0, 0,252, 7, 0, 0, 5, 0, 0, 0,
/* 0x0050 */ 0, 16, 0, 0, 1, 0, 0, 0,249, 7, 0, 0, 0, 0, 0, 0,
/* 0x0060 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* 0x0070 */ 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* 0x0080 */ 41,201,186,248, 2, 0, 0,137,230,137,231,232,134, 0, 0, 0,
@@ -50,21 +50,21 @@ unsigned char stub_i386_openbsd_elf_fold[2033] = {
/* 0x00b0 */ 141,148, 26,255, 31, 0, 0,129,226, 0,240,255,255, 82, 41,192,
/* 0x00c0 */ 102,131,123, 16, 3,117, 1,146, 80,139, 67, 24,139,112,248, 41,
/* 0x00d0 */ 240,139, 24,139, 72, 4,131,193, 12,141, 84, 36, 12, 96, 71,232,
/* 0x00e0 */ 81, 5, 0, 0,131,196, 36, 89, 91,129,196, 0, 10, 0, 0, 90,
/* 0x00e0 */ 90, 5, 0, 0,131,196, 36, 89, 91,129,196, 0, 10, 0, 0, 90,
/* 0x00f0 */ 193,226, 12, 1,211, 80,106, 0,137,229, 41,217, 41,192, 81, 83,
/* 0x0100 */ 80, 79, 60,175,175,117,252,255, 55, 49,255, 49,246, 49,210, 49,
/* 0x0110 */ 201, 49,219,176, 73,195,173,171,173,171,133,192,117,250,173,171,
/* 0x0120 */ 133,192,117,250, 87,173,171,131,248, 32,115, 3, 15,179,194,133,
/* 0x0130 */ 192,173,171,117,240,131,239, 8, 1,201, 64,243,171, 72,171,171,
/* 0x0140 */ 95,195, 0, 0, 85,137,229, 87, 86,137,206, 83,137,195, 57, 8,
/* 0x0150 */ 139,120, 4,115, 7,106,127,232, 77, 6, 0, 0,133,201,116, 8,
/* 0x0150 */ 139,120, 4,115, 7,106,127,232, 85, 6, 0, 0,133,201,116, 8,
/* 0x0160 */ 138, 7, 71,136, 2, 66,226,248, 1,115, 4, 41, 51,141,101,244,
/* 0x0170 */ 91, 94, 95,201,195, 85,137,229, 87, 86,137,198, 83,137,211,131,
/* 0x0180 */ 236, 24,139, 69, 8,139,125, 12,137, 69,220,131, 58, 0, 15,132,
/* 0x0190 */ 182, 0, 0, 0,141, 85,228,185, 12, 0, 0, 0,137,240,232,161,
/* 0x01a0 */ 255,255,255,139, 69,228,139, 77,232,133,192,117, 19,129,249, 85,
/* 0x01b0 */ 80, 88, 33,117, 15,131, 62, 0, 15,132,140, 0, 0, 0,235, 4,
/* 0x01c0 */ 133,201,117, 7,106,127,232,222, 5, 0, 0, 57,193,119,245, 59,
/* 0x01c0 */ 133,201,117, 7,106,127,232,230, 5, 0, 0, 57,193,119,245, 59,
/* 0x01d0 */ 3,119,241, 57,193,115, 86,137, 69,224,141, 69,224,255,117,236,
/* 0x01e0 */ 80,255,115, 4, 81,255,118, 4,255, 85,220,131,196, 20,133,192,
/* 0x01f0 */ 117,210,139, 85,224, 59, 85,228,117,202,138, 69,237,132,192,116,
@@ -97,71 +97,71 @@ unsigned char stub_i386_openbsd_elf_fold[2033] = {
/* 0x03a0 */ 28, 7,139, 68, 47,220, 1,194, 41,216,137, 22, 3, 93,148,106,
/* 0x03b0 */ 0, 5,255, 15, 0, 0,106,255, 37, 0,240,255,255,104, 18, 16,
/* 0x03c0 */ 0, 0,129,193,255, 15, 0, 0,106, 0,129,225, 0,240,255,255,
/* 0x03d0 */ 80,131,198, 4, 83,137, 68, 47,220,137, 76, 47,228,232,162, 3,
/* 0x03d0 */ 80,131,198, 4, 83,137, 68, 47,220,137, 76, 47,228,232,170, 3,
/* 0x03e0 */ 0, 0,137, 68, 61,212,131,196, 24,131,199, 4,255, 77,144,137,
/* 0x03f0 */ 117,152,121,141,139, 69,212,199, 69,168, 0, 0, 0, 0,139, 85,
/* 0x0400 */ 236,139, 77,196, 41,208,102,131,121, 44, 0,137, 69,172, 15,132,
/* 0x0410 */ 236, 1, 0, 0,139, 93,180,139, 3,131,248, 6,117, 34,131,125,
/* 0x0420 */ 192, 0, 15,132,193, 1, 0, 0,139, 77,172,186, 3, 0, 0, 0,
/* 0x0430 */ 3, 75, 8,139, 69,188,232, 23,254,255,255,233,169, 1, 0, 0,
/* 0x0440 */ 72, 15,133,162, 1, 0, 0,139,117,180,199, 69,164, 64, 98, 81,
/* 0x0450 */ 115,139, 69,172, 3, 70, 8,139, 78, 24,139, 86, 20,131,225, 7,
/* 0x0460 */ 137, 69,208, 1,194,193,225, 2,211,109,164,137, 85,156,139, 78,
/* 0x0470 */ 16,137,194,131,101,164, 7,129,226,255, 15, 0, 0,137, 77,204,
/* 0x0480 */ 141, 52, 17,139, 77,180, 41,208,137, 69,160,139, 65, 4, 41,208,
/* 0x0490 */ 131,125,192, 0, 80,139, 69,200,116, 3,131,200,255,131,125,192,
/* 0x04a0 */ 1, 80, 25,192, 37, 0,240,255,255, 5, 18, 16, 0, 0,131,125,
/* 0x04b0 */ 192, 0, 80,139, 69,164,116, 3,131,200, 2,131,125,192, 0, 80,
/* 0x04c0 */ 137,240,116, 3,141, 70, 3, 80,255,117,160,232,180, 2, 0, 0,
/* 0x04d0 */ 131,196, 24, 57, 69,160, 15,133,188, 0, 0, 0,131,125,192, 0,
/* 0x04e0 */ 116, 28,246, 69,164, 4,139, 69,184,117, 2, 49,192, 80,139, 69,
/* 0x04f0 */ 192,255,117,200,141, 85,204,232,121,252,255,255, 95, 88,137,247,
/* 0x0500 */ 247,223,129,231,255, 15, 0, 0,246, 69,164, 2,116, 17,139, 69,
/* 0x0510 */ 160, 1,240,133,255,116, 8,137,249,198, 0, 0, 64,226,250,131,
/* 0x0520 */ 125,192, 0,116,122,139, 93,180,131, 59, 1,117, 88,246, 67, 24,
/* 0x0530 */ 1,116, 82,139, 83, 20,137,216,139, 91, 8,141, 12, 26, 3, 77,
/* 0x0540 */ 172, 59, 80, 16,117, 14,137,200,247,216, 37,255, 15, 0, 0,131,
/* 0x0550 */ 248, 3,119, 17,139, 85,180,107, 69,172, 52,131,122, 4, 0,141,
/* 0x0560 */ 76, 3, 12,117, 15,139, 1, 61,205,128,201,195,116, 6,199, 1,
/* 0x0570 */ 205,128,201,195,133,201,116, 13,139, 69,188, 49,210,131,224,254,
/* 0x0580 */ 232,205,252,255,255,255,117,164, 86,255,117,160,232, 52, 2, 0,
/* 0x0590 */ 0,131,196, 12,133,192,116, 7,106,127,232, 10, 2, 0, 0,141,
/* 0x05a0 */ 4, 62,139, 93,160, 1,195, 59, 93,156,115, 33,106, 0,106,255,
/* 0x05b0 */ 104, 18, 16, 0, 0,255,117,164, 41, 93,156,255,117,156, 83,232,
/* 0x05c0 */ 192, 1, 0, 0,131,196, 24, 57,195,116, 30,235,203,131,125,192,
/* 0x05d0 */ 0,116, 22,141, 70, 3, 37,255, 15, 0, 0,131,248, 3,119, 9,
/* 0x05e0 */ 80, 83,232,218, 1, 0, 0, 89, 91,139, 77,196,255, 69,168, 15,
/* 0x05f0 */ 183, 65, 44,131, 69,180, 32, 57, 69,168, 15,140, 20,254,255,255,
/* 0x0600 */ 131,125,192, 0,117, 13,255,117,200,232,175, 1, 0, 0, 90,133,
/* 0x0610 */ 192,117,133,131,125, 20, 0,116, 8,139,117,172,139, 93, 20,137,
/* 0x0620 */ 51,139, 69,196,139, 64, 24, 1, 69,172,139, 69,172,141,101,244,
/* 0x0630 */ 91, 94, 95,201,195, 85,137,229, 87, 86, 83,131,236, 24,141, 85,
/* 0x0640 */ 24,139, 69, 8,106, 0,139,125, 28,199, 69,232, 0, 0, 0, 0,
/* 0x0650 */ 137, 69,228,139, 69, 16,139, 93, 32,199, 69,236, 0, 0, 0, 0,
/* 0x0660 */ 137, 69,224,131,192, 2,255,117,224,137, 69,220,141, 69, 32,141,
/* 0x0670 */ 119, 52,232,254,250,255,255,139, 69, 12,185, 0, 16, 0, 0,186,
/* 0x0680 */ 6, 0, 0, 0,137, 69, 32,139, 69,228, 41, 93, 36,232,192,251,
/* 0x0690 */ 255,255, 15,183, 79, 44,139, 69,228,186, 5, 0, 0, 0,232,175,
/* 0x06a0 */ 251,255,255, 15,183, 79, 42,139, 69,228,186, 4, 0, 0, 0,232,
/* 0x06b0 */ 158,251,255,255,139, 77, 40, 3, 78, 8,186, 3, 0, 0, 0,139,
/* 0x06c0 */ 69,228,131,193, 52,232,136,251,255,255,141, 69,240,255,117,220,
/* 0x06d0 */ 137,250, 80,141, 69, 32,255,117,228, 80,141, 69,232, 80,139, 69,
/* 0x06e0 */ 224,232,152,251,255,255,186, 9, 0, 0, 0,137,193,137,195,139,
/* 0x06f0 */ 69,228,232, 91,251,255,255,102,139, 79, 44,131,196, 28, 49,210,
/* 0x0700 */ 102,133,201,116,116,131, 62, 3,117,100,106, 0,139, 69,240,106,
/* 0x0710 */ 0, 3, 70, 8, 80,232,159, 0, 0, 0,131,196, 12,133,192,137,
/* 0x0720 */ 195,120, 22,104, 0, 2, 0, 0, 87, 80,232,130, 0, 0, 0,131,
/* 0x0730 */ 196, 12, 61, 0, 2, 0, 0,116, 7,106,127,232,105, 0, 0, 0,
/* 0x0740 */ 141, 69,240,137,250,106, 0, 80,106, 0,141, 69,232,106, 0, 80,
/* 0x0750 */ 137,216,232, 39,251,255,255,139, 77,240,137,195,139, 69,228,186,
/* 0x0760 */ 7, 0, 0, 0,232,233,250,255,255,131,196, 20,235, 11, 66, 15,
/* 0x0770 */ 183,193,131,198, 32, 57,194,124,140,141,101,244,137,216, 91, 94,
/* 0x0780 */ 95,201,195, 0, 85,137,229, 49,192, 80,255,117, 28, 80,255,117,
/* 0x0790 */ 24,255,117, 20,255,117, 16,255,117, 12,255,117, 8, 80,176,197,
/* 0x07a0 */ 80, 80,176,198,205,128,201,195,195,176, 1, 15,182,192,205,128,
/* 0x07b0 */ 195,176, 3,235,246,176, 4,235,242,176, 5,235,238,176, 6,235,
/* 0x07c0 */ 234,176, 73,235,230,176, 74,235,226,176, 33,235,222,176, 20,235,
/* 0x07d0 */ 218,176, 92,235,214,176, 59,235,210,176, 2,235,206,176,130,235,
/* 0x07e0 */ 202,176,116,235,198,176,240,235,194,176, 10,235,190,176, 7,235,
/* 0x07f0 */ 186
/* 0x0410 */ 245, 1, 0, 0,139, 93,180,139, 3,131,248, 6,117, 34,131,125,
/* 0x0420 */ 192, 0, 15,132,202, 1, 0, 0,139, 77,172,186, 3, 0, 0, 0,
/* 0x0430 */ 3, 75, 8,139, 69,188,232, 23,254,255,255,233,178, 1, 0, 0,
/* 0x0440 */ 72, 15,133,171, 1, 0, 0,139,117,180,139, 86, 20,133,210, 15,
/* 0x0450 */ 132,157, 1, 0, 0,139, 69,172,199, 69,164, 64, 98, 81,115, 3,
/* 0x0460 */ 70, 8,139, 78, 24,141, 20, 16,131,225, 7,193,225, 2,137, 69,
/* 0x0470 */ 208,211,109,164,137, 85,156,139, 78, 16,137,194,131,101,164, 7,
/* 0x0480 */ 129,226,255, 15, 0, 0,137, 77,204,141, 52, 17,139, 77,180, 41,
/* 0x0490 */ 208,137, 69,160,139, 65, 4, 41,208,131,125,192, 0, 80,139, 69,
/* 0x04a0 */ 200,116, 3,131,200,255,131,125,192, 1, 80, 25,192, 37, 0,240,
/* 0x04b0 */ 255,255, 5, 18, 16, 0, 0,131,125,192, 0, 80,139, 69,164,116,
/* 0x04c0 */ 3,131,200, 2,131,125,192, 0, 80,137,240,116, 3,141, 70, 3,
/* 0x04d0 */ 80,255,117,160,232,179, 2, 0, 0,131,196, 24, 57, 69,160, 15,
/* 0x04e0 */ 133,188, 0, 0, 0,131,125,192, 0,116, 28,246, 69,164, 4,139,
/* 0x04f0 */ 69,184,117, 2, 49,192, 80,139, 69,192,255,117,200,141, 85,204,
/* 0x0500 */ 232,112,252,255,255, 95, 88,137,247,247,223,129,231,255, 15, 0,
/* 0x0510 */ 0,246, 69,164, 2,116, 17,139, 69,160, 1,240,133,255,116, 8,
/* 0x0520 */ 137,249,198, 0, 0, 64,226,250,131,125,192, 0,116,122,139, 93,
/* 0x0530 */ 180,131, 59, 1,117, 88,246, 67, 24, 1,116, 82,139, 83, 20,137,
/* 0x0540 */ 216,139, 91, 8,141, 12, 26, 3, 77,172, 59, 80, 16,117, 14,137,
/* 0x0550 */ 200,247,216, 37,255, 15, 0, 0,131,248, 3,119, 17,139, 85,180,
/* 0x0560 */ 107, 69,172, 52,131,122, 4, 0,141, 76, 3, 12,117, 15,139, 1,
/* 0x0570 */ 61,205,128,201,195,116, 6,199, 1,205,128,201,195,133,201,116,
/* 0x0580 */ 13,139, 69,188, 49,210,131,224,254,232,196,252,255,255,255,117,
/* 0x0590 */ 164, 86,255,117,160,232, 51, 2, 0, 0,131,196, 12,133,192,116,
/* 0x05a0 */ 7,106,127,232, 9, 2, 0, 0,141, 4, 62,139, 93,160, 1,195,
/* 0x05b0 */ 59, 93,156,115, 33,106, 0,106,255,104, 18, 16, 0, 0,255,117,
/* 0x05c0 */ 164, 41, 93,156,255,117,156, 83,232,191, 1, 0, 0,131,196, 24,
/* 0x05d0 */ 57,195,116, 30,235,203,131,125,192, 0,116, 22,141, 70, 3, 37,
/* 0x05e0 */ 255, 15, 0, 0,131,248, 3,119, 9, 80, 83,232,217, 1, 0, 0,
/* 0x05f0 */ 89, 91,139, 77,196,255, 69,168, 15,183, 65, 44,131, 69,180, 32,
/* 0x0600 */ 57, 69,168, 15,140, 11,254,255,255,131,125,192, 0,117, 13,255,
/* 0x0610 */ 117,200,232,174, 1, 0, 0, 90,133,192,117,133,131,125, 20, 0,
/* 0x0620 */ 116, 8,139,117,172,139, 93, 20,137, 51,139, 69,196,139, 64, 24,
/* 0x0630 */ 1, 69,172,139, 69,172,141,101,244, 91, 94, 95,201,195, 85,137,
/* 0x0640 */ 229, 87, 86, 83,131,236, 24,141, 85, 24,139, 69, 8,106, 0,139,
/* 0x0650 */ 125, 28,199, 69,232, 0, 0, 0, 0,137, 69,228,139, 69, 16,139,
/* 0x0660 */ 93, 32,199, 69,236, 0, 0, 0, 0,137, 69,224,131,192, 2,255,
/* 0x0670 */ 117,224,137, 69,220,141, 69, 32,141,119, 52,232,245,250,255,255,
/* 0x0680 */ 139, 69, 12,185, 0, 16, 0, 0,186, 6, 0, 0, 0,137, 69, 32,
/* 0x0690 */ 139, 69,228, 41, 93, 36,232,183,251,255,255, 15,183, 79, 44,139,
/* 0x06a0 */ 69,228,186, 5, 0, 0, 0,232,166,251,255,255, 15,183, 79, 42,
/* 0x06b0 */ 139, 69,228,186, 4, 0, 0, 0,232,149,251,255,255,139, 77, 40,
/* 0x06c0 */ 3, 78, 8,186, 3, 0, 0, 0,139, 69,228,131,193, 52,232,127,
/* 0x06d0 */ 251,255,255,141, 69,240,255,117,220,137,250, 80,141, 69, 32,255,
/* 0x06e0 */ 117,228, 80,141, 69,232, 80,139, 69,224,232,143,251,255,255,186,
/* 0x06f0 */ 9, 0, 0, 0,137,193,137,195,139, 69,228,232, 82,251,255,255,
/* 0x0700 */ 102,139, 79, 44,131,196, 28, 49,210,102,133,201,116,116,131, 62,
/* 0x0710 */ 3,117,100,106, 0,139, 69,240,106, 0, 3, 70, 8, 80,232,158,
/* 0x0720 */ 0, 0, 0,131,196, 12,133,192,137,195,120, 22,104, 0, 2, 0,
/* 0x0730 */ 0, 87, 80,232,129, 0, 0, 0,131,196, 12, 61, 0, 2, 0, 0,
/* 0x0740 */ 116, 7,106,127,232,104, 0, 0, 0,141, 69,240,137,250,106, 0,
/* 0x0750 */ 80,106, 0,141, 69,232,106, 0, 80,137,216,232, 30,251,255,255,
/* 0x0760 */ 139, 77,240,137,195,139, 69,228,186, 7, 0, 0, 0,232,224,250,
/* 0x0770 */ 255,255,131,196, 20,235, 11, 66, 15,183,193,131,198, 32, 57,194,
/* 0x0780 */ 124,140,141,101,244,137,216, 91, 94, 95,201,195, 85,137,229, 49,
/* 0x0790 */ 192, 80,255,117, 28, 80,255,117, 24,255,117, 20,255,117, 16,255,
/* 0x07a0 */ 117, 12,255,117, 8, 80,176,197, 80, 80,176,198,205,128,201,195,
/* 0x07b0 */ 195,176, 1, 15,182,192,205,128,195,176, 3,235,246,176, 4,235,
/* 0x07c0 */ 242,176, 5,235,238,176, 6,235,234,176, 73,235,230,176, 74,235,
/* 0x07d0 */ 226,176, 33,235,222,176, 20,235,218,176, 92,235,214,176, 59,235,
/* 0x07e0 */ 210,176, 2,235,206,176,130,235,202,176,116,235,198,176,240,235,
/* 0x07f0 */ 194,176, 10,235,190,176, 7,235,186
};