From 4054ac192ac5b4ad78bd79e1023c7f76e22daba3 Mon Sep 17 00:00:00 2001 From: John Reiser Date: Sun, 23 Jun 2024 14:06:45 -0700 Subject: [PATCH] ELF2: memcheck avoids extra safety bytes modified: stub/src/amd64-linux.elf-entry.S modified: ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh plus generated .h and .dump --- .../upx_testsuite_1-expected_sha256sums.sh | 28 ++--- src/stub/amd64-linux.elf-entry.h | 119 +++++++++--------- src/stub/src/amd64-linux.elf-entry.S | 5 +- src/stub/tmp/amd64-linux.elf-entry.bin.dump | 4 +- 4 files changed, 80 insertions(+), 76 deletions(-) diff --git a/misc/testsuite/upx_testsuite_1-expected_sha256sums.sh b/misc/testsuite/upx_testsuite_1-expected_sha256sums.sh index 0f1755f4..ed4212ca 100644 --- a/misc/testsuite/upx_testsuite_1-expected_sha256sums.sh +++ b/misc/testsuite/upx_testsuite_1-expected_sha256sums.sh @@ -46,8 +46,8 @@ b8c35fa2956da17ca505956e9f5017bb5f3a746322647e24ccb8ff28059cafa4 *powerpc-linux. a0950546dc17fca9437219431d8ddb0249ce5b08e899e0c799a87ac982adee70 *powerpc64le-linux.elf/upx-3.95 " expected_sha256sums__t110_compress_ucl_nrv2b_3_no_filter="\ -9549b4bc030cf87180c3ccf3496a814f36f7c5c2c760d496be3e1a3a413c3c4c *amd64-linux.elf/upx-3.91 -1ad32402649158637008103999b295c34b136a5c5ef2df7662743be847479059 *amd64-linux.elf/upx-3.95 +6f942149013864ff4017d00acd8654a2de69c348d2cbd33f21615f523b751f7e *amd64-linux.elf/upx-3.91 +33df9d4f6ab4a7b541ca5141bd1a6bc170010e29aa5f92fe567628dbc56be5d0 *amd64-linux.elf/upx-3.95 1bd70a3cd3b34e635a3c947cacd46c4d66bf07e0fd350cc6d1f3cf60483f75b9 *amd64-win64.pe/upx-3.95.exe c9d8d916100e1dd972a2a9a060e4213505b14c62e9705ab6c8b544a8f18e083d *arm-linux.elf/upx-3.95 94422a91473a467dfb534afa3f20247bc38691aeb386a42fb3e0fd18d3d0ae08 *arm-wince.pe/upx-3.91.exe @@ -69,8 +69,8 @@ fcbd8b4709ee324eb772e5de45a85bac5b8e560460fb1d50d0958f2ce568be97 *mipsel-linux.e d74c348bad0c1f3e776cf78282141492a58746c601f3f4288c9e675b7b425f82 *powerpc64le-linux.elf/upx-3.95 " expected_sha256sums__t120_compress_ucl_nrv2d_3_no_filter="\ -8d80375df7f1c2b0a989d9e9142055e069dd0b5fea8a1adb958af8f71b3a4875 *amd64-linux.elf/upx-3.91 -8db9ef6b61fa95e3e527b9b3bea680a8c46d882ffb78ba872054b972e7d40e07 *amd64-linux.elf/upx-3.95 +5e7f5c3ae86cc36395a6a9a90d8e9557cd626e51f4a3d67f52f55599b3055eae *amd64-linux.elf/upx-3.91 +7a69e62552623ec6ea59f381d7e0f451202e88f070a9d9844997436b73fe8efb *amd64-linux.elf/upx-3.95 0314c6974f29d180e46e41a1004d46a3993fe96f03de7f78d45ad89ad3b2177e *amd64-win64.pe/upx-3.95.exe 0f781a70828dc3b939988b96e70c0734cef3f4a7693624e61f7a678b0c8667a6 *arm-linux.elf/upx-3.95 d7839b7dee866794e4ca3df32e2b1084b35aa22dee5f060fa14b5ca09c612ba3 *arm-wince.pe/upx-3.91.exe @@ -92,8 +92,8 @@ d05786b4b729f13a9b325322c2ea41ca7db6f60fee9f82c58874a25ee7eca086 *powerpc-linux. c4888e9ed7c587163b53246c2c0cb2c6118122feacfc5248f371d8f6c8783abd *powerpc64le-linux.elf/upx-3.95 " expected_sha256sums__t130_compress_ucl_nrv2e_3_no_filter="\ -a3c96e15956c311e8d684cb8f1ce469514daa1101abe402afdbebacfdbba8765 *amd64-linux.elf/upx-3.91 -31bfd042e9599547a40c5bae98761c602d09fd6dc60eb2761e3abbb2d066fbb5 *amd64-linux.elf/upx-3.95 +7b86ba7b4caa0d54aefb21105bdfa5931d0a96460e0f662293801898819e1cf0 *amd64-linux.elf/upx-3.91 +bee6f96dbcbd498b4e9db4a4dbb5409a7fa27cb2545bb5a705b0df3666faf312 *amd64-linux.elf/upx-3.95 97bb5953405f3413d9ff9bdc272caf2858697168b3e85dab54213da356b5ea0f *amd64-win64.pe/upx-3.95.exe 0bf33b6b3f246093a7e15c4a51b0a15f40c7ec9c16fcd38613b8b66004a3b3cb *arm-linux.elf/upx-3.95 8c73f5acfc70e3c518be09978af87b9bec4906240cb457a166da0eba05bea4db *arm-wince.pe/upx-3.91.exe @@ -115,8 +115,8 @@ fa3be8f93006a88c7ad3d9fd13f600c4f69745859eb76f7eab317a5b87d256ea *mipsel-linux.e cf8c7d3616c00e6709eea0ae335cc3959a8debdac3623076541f51724649a6cc *powerpc64le-linux.elf/upx-3.95 " expected_sha256sums__t140_compress_lzma_2_no_filter="\ -c7ee47451ff10ae22f147000f99f94cbc7adf272cafed82f6886cfe9b96fc340 *amd64-linux.elf/upx-3.91 -a24f58a9f74c4b7394797a4d1050221dc4f675d87947d27a71b926dd595eeb5f *amd64-linux.elf/upx-3.95 +faf11f3e4d19eb2ce7351a774cebe6092fcca0fca7faf6a35afb960bf97d367d *amd64-linux.elf/upx-3.91 +12e58e139e25cc3fbb0ecc1587599a401e3abff1d17e8ef3d18d5ee882a10fd6 *amd64-linux.elf/upx-3.95 b8815f95e92d6853a04a86069e9054115be2d9aa657fa2c8912d0f37e56c894f *amd64-win64.pe/upx-3.95.exe 7a832eb6c3c33a04053786334c9e1953796ba2debacc754b5a18632ec987aa40 *arm-linux.elf/upx-3.95 018242f330e19dd7ca2fb78687c0070ad88f1aa2e113be865c30ad3ff94a4ada *arm-wince.pe/upx-3.91.exe @@ -138,8 +138,8 @@ a214c035d403c1dc7b5d80d6cfd8e00e2278f8600332875f2e53e1c61648fdc2 *powerpc-linux. e614e62b002d3f8e900099d1683d17a932e8879c53de6b9a9d4a064f551afa8d *powerpc64le-linux.elf/upx-3.95 " expected_sha256sums__t150_compress_ucl_2_all_filters="\ -48495deeffd861aad3158a8e301e6f638b152626c4e846ab0a8a5f24417198eb *amd64-linux.elf/upx-3.91 -f6756249a7dfd7c1f46ab2ee1883c6fc4856ba9b57b05cffbbbf9431673fad5a *amd64-linux.elf/upx-3.95 +77d82db8965276678bc8efc07fa68e9ae7b048f11659b08bfbe1becd02bf9eb9 *amd64-linux.elf/upx-3.91 +cbb51ecc9e939fc946d1feea3934af8d5eb7e0311b087169f91c7035e1a900eb *amd64-linux.elf/upx-3.95 434732efb16b89114162a1787a28c128e2c11edb9835411f2b707cac5cd475ae *amd64-win64.pe/upx-3.95.exe acbb1628a4631ec5ded40ec286c55544839f57a671ef925c89f81a7fff937954 *arm-linux.elf/upx-3.95 93e2ead9e54732a1731896681d415e3ce60b7420ad7f3c57822ad7dbd061cdd3 *arm-wince.pe/upx-3.91.exe @@ -161,8 +161,8 @@ e3825daa7fb8d509590c1db347a8403dbd899da453fb43850ebf1d31abbe0cba *powerpc-linux. 3b246002f2dff8e44cf3c2cd2c64701514a1354c27b616c9a704f542df30e04f *powerpc64le-linux.elf/upx-3.95 " expected_sha256sums__t160_compress_all_methods_1_no_filter="\ -a6ce29bb62217d075e7185ef3bb3b86e79ce392b8e5a7cefb67f09472e6ff27c *amd64-linux.elf/upx-3.91 -5d9f69d5d894518e4ac1e206eacf0f46f267ed7c74b9631cd47631c8f5c363cb *amd64-linux.elf/upx-3.95 +a459d86bb62c779ed6677cbd78989c56f1f696758307f40f2aaf76bf68fb6608 *amd64-linux.elf/upx-3.91 +64c49801d815e015c2f4402e70f89904dc6dbb34acb4a9059d21029049850053 *amd64-linux.elf/upx-3.95 f38ff7edc916c1a3e82020035667de858c89d52c98d960dad0e21b4da444ed6c *amd64-win64.pe/upx-3.95.exe 2481a933d3f1bcaed047e9cbc81ae227351e86e7c6c761c4756faea0c525aeb6 *arm-linux.elf/upx-3.95 bb475839ec547696aaccf4da202b99be927c872e5de298a5eb1f0be0edc06d1d *arm-wince.pe/upx-3.91.exe @@ -184,8 +184,8 @@ c37806b0d68697276cdd208ab37c92e01055bfbab73c6bbdf054c95fe9cef3b9 *powerpc-linux. bdd174f8e00e1364fba1f821b56e0083fb9993d2bab9e3a93fced8f66ccc84c7 *powerpc64le-linux.elf/upx-3.95 " expected_sha256sums__t170_compress_all_methods_no_lzma_5_no_filter="\ -9f0841b2f7a81e3720e58bc100d4a5044ab972e67c06b2c609ec6f9333c16c85 *amd64-linux.elf/upx-3.91 -6707494a2352c452f033da20c0c54ca91c344e8d5572c5aa66414a7813e60955 *amd64-linux.elf/upx-3.95 +c4916446d81e67849558eb5768e1dc97f03c26d116d3aa33dcd2cc6df3c48fa0 *amd64-linux.elf/upx-3.91 +42939aa7fe7cbcc0cc89fd1bd9fd26a3a2d24f0a270b510b4cb95668fa93e414 *amd64-linux.elf/upx-3.95 5fccb0f5044baaa74d176efb25eefa3b5810dc737ed0f9d38084d275f7ebe7b8 *amd64-win64.pe/upx-3.95.exe 90e56eefcce87542dbbc65e54c83c7e921a747877cbe489089c6043165b4f334 *arm-linux.elf/upx-3.95 56be0b4046accdfadbe534ecb6e6452b9e3a18bb9eac39da0ee8893c31d24416 *arm-wince.pe/upx-3.91.exe diff --git a/src/stub/amd64-linux.elf-entry.h b/src/stub/amd64-linux.elf-entry.h index 8d28cbd2..3880f184 100644 --- a/src/stub/amd64-linux.elf-entry.h +++ b/src/stub/amd64-linux.elf-entry.h @@ -1,5 +1,5 @@ /* amd64-linux.elf-entry.h - created from amd64-linux.elf-entry.bin, 1101 (0x44d) bytes + created from amd64-linux.elf-entry.bin, 1105 (0x451) bytes This file is part of the UPX executable compressor. @@ -32,78 +32,79 @@ /* clang-format off */ -#define STUB_AMD64_LINUX_ELF_ENTRY_SIZE 1101 -#define STUB_AMD64_LINUX_ELF_ENTRY_ADLER32 0x6aa33a05 -#define STUB_AMD64_LINUX_ELF_ENTRY_CRC32 0x424cb481 +#define STUB_AMD64_LINUX_ELF_ENTRY_SIZE 1105 +#define STUB_AMD64_LINUX_ELF_ENTRY_ADLER32 0xbd0f3bb4 +#define STUB_AMD64_LINUX_ELF_ENTRY_CRC32 0x69ac5629 -unsigned char stub_amd64_linux_elf_entry[1101] = { +unsigned char stub_amd64_linux_elf_entry[1105] = { /* 0x0000 */ 127, 69, 76, 70, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x0010 */ 1, 0, 62, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/* 0x0020 */ 0, 0, 0, 0, 0, 0, 0, 0,232, 1, 0, 0, 0, 0, 0, 0, +/* 0x0020 */ 0, 0, 0, 0, 0, 0, 0, 0,240, 1, 0, 0, 0, 0, 0, 0, /* 0x0030 */ 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, -/* 0x0040 */ 89, 84, 95, 81,232, 47, 1, 0, 0,232, 42, 1, 0, 0, 72,139, +/* 0x0040 */ 89, 84, 95, 81,232, 51, 1, 0, 0,232, 46, 1, 0, 0, 72,139, /* 0x0050 */ 7, 72,139, 79, 8, 72,131,199, 16, 72,131,248, 6,116, 12, 72, /* 0x0060 */ 199,193, 0, 16, 0, 0, 72,133,192,117,227, 72,247,217, 81, 82, -/* 0x0070 */ 104,117,112,120, 0, 84, 95, 41,246,184, 63, 1, 0, 0,232, 2, +/* 0x0070 */ 104,117,112,120, 0, 84, 95, 41,246,184, 63, 1, 0, 0,232, 6, /* 0x0080 */ 1, 0, 0, 73,137,196, 89, 72,141, 61,174,255,255,255,139, 15, /* 0x0090 */ 72, 41,207, 72,141, 53, 0, 0, 0, 0,173,147, 65,137,221,173, /* 0x00a0 */ 146,131,194, 16, 82,106,255, 87, 72, 41,217, 81, 72, 1,251, 83, /* 0x00b0 */ 84, 93, 72, 41,212, 72,131,228,192, 84, 95,173, 80,173,102,131, /* 0x00c0 */ 248, 2,116, 1,244, 88, 72, 1,240, 80, 85, 49,219, 49,201, 72, -/* 0x00d0 */ 141, 21,196, 0, 0, 0,106,255, 93,252,168,164,255,210,114,251, +/* 0x00d0 */ 141, 21,200, 0, 0, 0,106,255, 93,252,168,164,255,210,114,251, /* 0x00e0 */ 141, 65, 1,255,210, 17,192,255,210,115,248,131,232, 3,114, 12, /* 0x00f0 */ 193,224, 8,172,131,240,255,116, 47, 72, 99,232,141, 65, 1,255, /* 0x0100 */ 210, 17,201,255,210, 17,201,117, 13,137,193,131,192, 2,255,210, /* 0x0110 */ 17,201,255,210,115,248,129,253, 0,243,255,255, 17,193, 86, 72, /* 0x0120 */ 141, 52, 47,243,164, 94,235,180, 93, 89, 72, 57,206,116, 1,244, -/* 0x0130 */ 72,139, 69, 48, 72,137, 4, 36, 72,139, 85, 32, 84, 94, 76,137, -/* 0x0140 */ 231,106, 1, 88,232, 60, 0, 0, 0, 85, 92, 69, 41,201, 77,137, -/* 0x0150 */ 224,106, 1, 65, 90, 82, 94,106, 7, 90, 41,255,106, 9, 88,232, -/* 0x0160 */ 33, 0, 0, 0, 80, 72,137, 69, 24, 65, 80, 95,106, 3, 88, 15, -/* 0x0170 */ 5, 88, 72,131,192, 8,255,224, 72,139, 7, 72,131,199, 8, 72, -/* 0x0180 */ 133,192,117,244,195, 80, 15, 5, 89, 72, 61, 0,240,255,255,114, -/* 0x0190 */ 1,244,195, 72,139, 60, 36,102,175,195, 1,219,116, 2,243,195, -/* 0x01a0 */ 139, 30, 72,131,238,252, 17,219,243,195, 0, 0, 0, 0, 0, 0, -/* 0x01b0 */ 102,105,108,101, 32,102,111,114,109, 97,116, 32,101,108,102, 54, -/* 0x01c0 */ 52, 45,120, 56, 54, 45, 54, 52, 10, 10, 83,101, 99,116,105,111, -/* 0x01d0 */ 110,115, 58, 10, 73,100,120, 32, 78, 97,109,101, 32, 32, 32, 32, -/* 0x01e0 */ 32, 32, 32, 32, 32, 32, 83,105,122,101, 32, 32, 32, 32, 32, 32, -/* 0x01f0 */ 86, 77, 65, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, -/* 0x0200 */ 32, 32, 76, 77, 65, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, -/* 0x0210 */ 32, 32, 32, 32, 70,105,108,101, 32,111,102,102, 32, 32, 65,108, -/* 0x0220 */ 103,110, 32, 32, 70,108, 97,103,115, 10, 32, 32, 48, 32, 69, 76, -/* 0x0230 */ 70, 77, 65, 73, 78, 88, 32, 32, 32, 32, 32, 32, 48, 49, 54, 97, -/* 0x0240 */ 32, 32, 48, 32, 32, 48, 32, 32, 48, 52, 48, 32, 32, 50, 42, 42, -/* 0x0250 */ 48, 32, 32, 67, 79, 78, 84, 69, 78, 84, 83, 10, 32, 32, 49, 32, -/* 0x0260 */ 69, 76, 70, 77, 65, 73, 78, 90, 32, 32, 32, 32, 32, 32, 48, 52, -/* 0x0270 */ 32, 32, 48, 32, 32, 48, 32, 32, 48, 49, 97, 99, 32, 32, 50, 42, -/* 0x0280 */ 42, 50, 32, 32, 67, 79, 78, 84, 69, 78, 84, 83, 10, 83, 89, 77, -/* 0x0290 */ 66, 79, 76, 32, 84, 65, 66, 76, 69, 58, 10, 48, 48, 48, 48, 48, -/* 0x02a0 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32,108, 32, 32, 32, -/* 0x02b0 */ 32,100, 32, 32, 69, 76, 70, 77, 65, 73, 78, 90, 32, 48, 32, 69, -/* 0x02c0 */ 76, 70, 77, 65, 73, 78, 90, 10, 48, 48, 48, 48, 48, 48, 48, 48, -/* 0x02d0 */ 48, 48, 48, 48, 48, 48, 48, 48, 32,108, 32, 32, 32, 32,100, 32, -/* 0x02e0 */ 32, 69, 76, 70, 77, 65, 73, 78, 88, 32, 48, 32, 69, 76, 70, 77, -/* 0x02f0 */ 65, 73, 78, 88, 10, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, -/* 0x0300 */ 48, 48, 48, 48, 48, 32,103, 32, 32, 32, 32, 32, 32, 32, 69, 76, -/* 0x0310 */ 70, 77, 65, 73, 78, 88, 32, 48, 32, 95,115,116, 97,114,116, 10, -/* 0x0320 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, -/* 0x0330 */ 32, 32, 32, 32, 32, 32, 32, 32, 32, 42, 85, 78, 68, 42, 32, 48, -/* 0x0340 */ 32, 79, 95, 66, 73, 78, 70, 79, 10, 10, 82, 69, 76, 79, 67, 65, -/* 0x0350 */ 84, 73, 79, 78, 32, 82, 69, 67, 79, 82, 68, 83, 32, 70, 79, 82, -/* 0x0360 */ 32, 91, 69, 76, 70, 77, 65, 73, 78, 88, 93, 58, 10, 79, 70, 70, -/* 0x0370 */ 83, 69, 84, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 84, 89, -/* 0x0380 */ 80, 69, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, -/* 0x0390 */ 86, 65, 76, 85, 69, 10, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, -/* 0x03a0 */ 48, 48, 48, 48, 53, 54, 32, 82, 95, 88, 56, 54, 95, 54, 52, 95, -/* 0x03b0 */ 80, 67, 51, 50, 32, 32, 32, 32, 32, 69, 76, 70, 77, 65, 73, 78, -/* 0x03c0 */ 90, 43, 48,120,102,102,102,102,102,102,102,102,102,102,102,102, -/* 0x03d0 */ 102,102,102, 99, 10, 10, 82, 69, 76, 79, 67, 65, 84, 73, 79, 78, -/* 0x03e0 */ 32, 82, 69, 67, 79, 82, 68, 83, 32, 70, 79, 82, 32, 91, 69, 76, -/* 0x03f0 */ 70, 77, 65, 73, 78, 90, 93, 58, 10, 79, 70, 70, 83, 69, 84, 32, -/* 0x0400 */ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 84, 89, 80, 69, 32, 32, -/* 0x0410 */ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 86, 65, 76, 85, -/* 0x0420 */ 69, 10, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, -/* 0x0430 */ 48, 48, 32, 82, 95, 88, 56, 54, 95, 54, 52, 95, 51, 50, 32, 32, -/* 0x0440 */ 32, 32, 32, 32, 32, 79, 95, 66, 73, 78, 70, 79, 10 +/* 0x0130 */ 72,139, 69, 48, 72,137, 4, 36, 72,139, 85, 32, 72,131,234, 16, +/* 0x0140 */ 84, 94, 76,137,231,106, 1, 88,232, 60, 0, 0, 0, 85, 92, 69, +/* 0x0150 */ 41,201, 77,137,224,106, 1, 65, 90, 82, 94,106, 7, 90, 41,255, +/* 0x0160 */ 106, 9, 88,232, 33, 0, 0, 0, 80, 72,137, 69, 24, 65, 80, 95, +/* 0x0170 */ 106, 3, 88, 15, 5, 88, 72,131,192, 8,255,224, 72,139, 7, 72, +/* 0x0180 */ 131,199, 8, 72,133,192,117,244,195, 80, 15, 5, 89, 72, 61, 0, +/* 0x0190 */ 240,255,255,114, 1,244,195, 72,139, 60, 36,102,175,195, 1,219, +/* 0x01a0 */ 116, 2,243,195,139, 30, 72,131,238,252, 17,219,243,195, 0, 0, +/* 0x01b0 */ 0, 0, 0, 0,102,105,108,101, 32,102,111,114,109, 97,116, 32, +/* 0x01c0 */ 101,108,102, 54, 52, 45,120, 56, 54, 45, 54, 52, 10, 10, 83,101, +/* 0x01d0 */ 99,116,105,111,110,115, 58, 10, 73,100,120, 32, 78, 97,109,101, +/* 0x01e0 */ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 83,105,122,101, 32, 32, +/* 0x01f0 */ 32, 32, 32, 32, 86, 77, 65, 32, 32, 32, 32, 32, 32, 32, 32, 32, +/* 0x0200 */ 32, 32, 32, 32, 32, 32, 76, 77, 65, 32, 32, 32, 32, 32, 32, 32, +/* 0x0210 */ 32, 32, 32, 32, 32, 32, 32, 32, 70,105,108,101, 32,111,102,102, +/* 0x0220 */ 32, 32, 65,108,103,110, 32, 32, 70,108, 97,103,115, 10, 32, 32, +/* 0x0230 */ 48, 32, 69, 76, 70, 77, 65, 73, 78, 88, 32, 32, 32, 32, 32, 32, +/* 0x0240 */ 48, 49, 54,101, 32, 32, 48, 32, 32, 48, 32, 32, 48, 52, 48, 32, +/* 0x0250 */ 32, 50, 42, 42, 48, 32, 32, 67, 79, 78, 84, 69, 78, 84, 83, 10, +/* 0x0260 */ 32, 32, 49, 32, 69, 76, 70, 77, 65, 73, 78, 90, 32, 32, 32, 32, +/* 0x0270 */ 32, 32, 48, 52, 32, 32, 48, 32, 32, 48, 32, 32, 48, 49, 98, 48, +/* 0x0280 */ 32, 32, 50, 42, 42, 50, 32, 32, 67, 79, 78, 84, 69, 78, 84, 83, +/* 0x0290 */ 10, 83, 89, 77, 66, 79, 76, 32, 84, 65, 66, 76, 69, 58, 10, 48, +/* 0x02a0 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32, +/* 0x02b0 */ 108, 32, 32, 32, 32,100, 32, 32, 69, 76, 70, 77, 65, 73, 78, 90, +/* 0x02c0 */ 32, 48, 32, 69, 76, 70, 77, 65, 73, 78, 90, 10, 48, 48, 48, 48, +/* 0x02d0 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32,108, 32, 32, +/* 0x02e0 */ 32, 32,100, 32, 32, 69, 76, 70, 77, 65, 73, 78, 88, 32, 48, 32, +/* 0x02f0 */ 69, 76, 70, 77, 65, 73, 78, 88, 10, 48, 48, 48, 48, 48, 48, 48, +/* 0x0300 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 32,103, 32, 32, 32, 32, 32, +/* 0x0310 */ 32, 32, 69, 76, 70, 77, 65, 73, 78, 88, 32, 48, 32, 95,115,116, +/* 0x0320 */ 97,114,116, 10, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, +/* 0x0330 */ 48, 48, 48, 48, 32, 32, 32, 32, 32, 32, 32, 32, 32, 42, 85, 78, +/* 0x0340 */ 68, 42, 32, 48, 32, 79, 95, 66, 73, 78, 70, 79, 10, 10, 82, 69, +/* 0x0350 */ 76, 79, 67, 65, 84, 73, 79, 78, 32, 82, 69, 67, 79, 82, 68, 83, +/* 0x0360 */ 32, 70, 79, 82, 32, 91, 69, 76, 70, 77, 65, 73, 78, 88, 93, 58, +/* 0x0370 */ 10, 79, 70, 70, 83, 69, 84, 32, 32, 32, 32, 32, 32, 32, 32, 32, +/* 0x0380 */ 32, 32, 84, 89, 80, 69, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, +/* 0x0390 */ 32, 32, 32, 32, 86, 65, 76, 85, 69, 10, 48, 48, 48, 48, 48, 48, +/* 0x03a0 */ 48, 48, 48, 48, 48, 48, 48, 48, 53, 54, 32, 82, 95, 88, 56, 54, +/* 0x03b0 */ 95, 54, 52, 95, 80, 67, 51, 50, 32, 32, 32, 32, 32, 69, 76, 70, +/* 0x03c0 */ 77, 65, 73, 78, 90, 43, 48,120,102,102,102,102,102,102,102,102, +/* 0x03d0 */ 102,102,102,102,102,102,102, 99, 10, 10, 82, 69, 76, 79, 67, 65, +/* 0x03e0 */ 84, 73, 79, 78, 32, 82, 69, 67, 79, 82, 68, 83, 32, 70, 79, 82, +/* 0x03f0 */ 32, 91, 69, 76, 70, 77, 65, 73, 78, 90, 93, 58, 10, 79, 70, 70, +/* 0x0400 */ 83, 69, 84, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 84, 89, +/* 0x0410 */ 80, 69, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, +/* 0x0420 */ 86, 65, 76, 85, 69, 10, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, +/* 0x0430 */ 48, 48, 48, 48, 48, 48, 32, 82, 95, 88, 56, 54, 95, 54, 52, 95, +/* 0x0440 */ 51, 50, 32, 32, 32, 32, 32, 32, 32, 79, 95, 66, 73, 78, 70, 79, +/* 0x0450 */ 10 }; diff --git a/src/stub/src/amd64-linux.elf-entry.S b/src/stub/src/amd64-linux.elf-entry.S index 25900574..da8e7320 100644 --- a/src/stub/src/amd64-linux.elf-entry.S +++ b/src/stub/src/amd64-linux.elf-entry.S @@ -128,7 +128,9 @@ AT_PAGESZ= 6 // /usr/include/elf.h sub %rcx,%rdi // elfaddr lea o_binfo(%rip),%rsi lodsl; xchg %eax,%ebx; mov %ebx,%r13d // O_BINFO; advance to &b_info - lodsl; xchg %eax,%edx; add $0x10,%edx; push %rdx // F_LENU = sz_unc + x86_overrun + insurance +INSURANCE= 0x10 + lodsl; xchg %eax,%edx + add $INSURANCE,%edx; push %rdx // F_LENU = sz_unc + x86_overrun + insurance push $-1 // space for F_ADRU push %rdi // F_ELFA sub %rbx,%rcx; push %rcx // F_LENX = sz_pack2 - O_BINFO @@ -235,6 +237,7 @@ eof_n2b: // Write de-compressed 'fold' to file mov F_PMASK(old_sp),%rax; mov %rax,(%rsp) // propagate PAGE_MASK mov F_LENU(old_sp),%arg3 // LENU + sub $INSURANCE,%arg3 // memcheck limit push %rsp; pop %arg2 // buffer mov %r12,%arg1 // mfd push $__NR_write; pop %rax; call sys_check diff --git a/src/stub/tmp/amd64-linux.elf-entry.bin.dump b/src/stub/tmp/amd64-linux.elf-entry.bin.dump index 5b1c0460..7d217436 100644 --- a/src/stub/tmp/amd64-linux.elf-entry.bin.dump +++ b/src/stub/tmp/amd64-linux.elf-entry.bin.dump @@ -2,8 +2,8 @@ file format elf64-x86-64 Sections: Idx Name Size VMA LMA File off Algn Flags - 0 ELFMAINX 016a 0 0 040 2**0 CONTENTS - 1 ELFMAINZ 04 0 0 01ac 2**2 CONTENTS + 0 ELFMAINX 016e 0 0 040 2**0 CONTENTS + 1 ELFMAINZ 04 0 0 01b0 2**2 CONTENTS SYMBOL TABLE: 0000000000000000 l d ELFMAINZ 0 ELFMAINZ 0000000000000000 l d ELFMAINX 0 ELFMAINX