Hello, When using cpio to extract some archives recently, an error occurred.
I tried to compile a cpio binary with symbols from the source and figure it out, it seems the binary compiled from the source doesn't suffer from the issue. But it indeed affects the binary installed from the .deb file (or "apt-get isntall" command). I have tested it on both Ubuntu 16.04 and Kali 2018: - cpio 2.11 on Ubuntu 16.04 (x86-64) - cpio 2.12 on Kali 2018 (x86-64) To reproduce, just run the command: cpio -i < ./cpio_512 . (PS: try to run multiple times if it fails.) The related files are attached. Thanks!
*** Error in `cpio': realloc(): invalid pointer: 0x0000000000622280 *** ======= Backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f110953a7e5] /lib/x86_64-linux-gnu/libc.so.6(+0x85d80)[0x7f1109548d80] /lib/x86_64-linux-gnu/libc.so.6(realloc+0x22f)[0x7f11095478ef] cpio[0x4171d9] cpio[0x40443d] cpio[0x402981] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f11094e3830] cpio[0x402a19] ======= Memory map: ======== 00400000-00421000 r-xp 00000000 08:01 282957 /bin/cpio 00620000-00621000 r--p 00020000 08:01 282957 /bin/cpio 00621000-00623000 rw-p 00021000 08:01 282957 /bin/cpio 01468000-01489000 rw-p 00000000 00:00 0 [heap] 7f1104000000-7f1104021000 rw-p 00000000 00:00 0 7f1104021000-7f1108000000 ---p 00000000 00:00 0 7f11085e2000-7f11085f8000 r-xp 00000000 08:01 398143 /lib/x86_64-linux-gnu/libgcc_s.so.1 7f11085f8000-7f11087f7000 ---p 00016000 08:01 398143 /lib/x86_64-linux-gnu/libgcc_s.so.1 7f11087f7000-7f11087f8000 rw-p 00015000 08:01 398143 /lib/x86_64-linux-gnu/libgcc_s.so.1 7f11087f8000-7f1108803000 r-xp 00000000 08:01 396449 /lib/x86_64-linux-gnu/libnss_files-2.23.so 7f1108803000-7f1108a02000 ---p 0000b000 08:01 396449 /lib/x86_64-linux-gnu/libnss_files-2.23.so 7f1108a02000-7f1108a03000 r--p 0000a000 08:01 396449 /lib/x86_64-linux-gnu/libnss_files-2.23.so 7f1108a03000-7f1108a04000 rw-p 0000b000 08:01 396449 /lib/x86_64-linux-gnu/libnss_files-2.23.so 7f1108a04000-7f1108a0a000 rw-p 00000000 00:00 0 7f1108a0a000-7f1108a15000 r-xp 00000000 08:01 396435 /lib/x86_64-linux-gnu/libnss_nis-2.23.so 7f1108a15000-7f1108c14000 ---p 0000b000 08:01 396435 /lib/x86_64-linux-gnu/libnss_nis-2.23.so 7f1108c14000-7f1108c15000 r--p 0000a000 08:01 396435 /lib/x86_64-linux-gnu/libnss_nis-2.23.so 7f1108c15000-7f1108c16000 rw-p 0000b000 08:01 396435 /lib/x86_64-linux-gnu/libnss_nis-2.23.so 7f1108c16000-7f1108c2c000 r-xp 00000000 08:01 396445 /lib/x86_64-linux-gnu/libnsl-2.23.so 7f1108c2c000-7f1108e2b000 ---p 00016000 08:01 396445 /lib/x86_64-linux-gnu/libnsl-2.23.so 7f1108e2b000-7f1108e2c000 r--p 00015000 08:01 396445 /lib/x86_64-linux-gnu/libnsl-2.23.so 7f1108e2c000-7f1108e2d000 rw-p 00016000 08:01 396445 /lib/x86_64-linux-gnu/libnsl-2.23.so 7f1108e2d000-7f1108e2f000 rw-p 00000000 00:00 0 7f1108e2f000-7f1108e37000 r-xp 00000000 08:01 396457 /lib/x86_64-linux-gnu/libnss_compat-2.23.so 7f1108e37000-7f1109036000 ---p 00008000 08:01 396457 /lib/x86_64-linux-gnu/libnss_compat-2.23.so 7f1109036000-7f1109037000 r--p 00007000 08:01 396457 /lib/x86_64-linux-gnu/libnss_compat-2.23.so 7f1109037000-7f1109038000 rw-p 00008000 08:01 396457 /lib/x86_64-linux-gnu/libnss_compat-2.23.so 7f1109038000-7f11094c3000 r--p 00000000 08:01 348 /usr/lib/locale/locale-archive 7f11094c3000-7f1109683000 r-xp 00000000 08:01 396455 /lib/x86_64-linux-gnu/libc-2.23.so 7f1109683000-7f1109883000 ---p 001c0000 08:01 396455 /lib/x86_64-linux-gnu/libc-2.23.so 7f1109883000-7f1109887000 r--p 001c0000 08:01 396455 /lib/x86_64-linux-gnu/libc-2.23.so 7f1109887000-7f1109889000 rw-p 001c4000 08:01 396455 /lib/x86_64-linux-gnu/libc-2.23.so 7f1109889000-7f110988d000 rw-p 00000000 00:00 0 7f110988d000-7f11098b3000 r-xp 00000000 08:01 396427 /lib/x86_64-linux-gnu/ld-2.23.so 7f1109a8a000-7f1109a8d000 rw-p 00000000 00:00 0 7f1109ab1000-7f1109ab2000 rw-p 00000000 00:00 0 7f1109ab2000-7f1109ab3000 r--p 00025000 08:01 396427 /lib/x86_64-linux-gnu/ld-2.23.so 7f1109ab3000-7f1109ab4000 rw-p 00026000 08:01 396427 /lib/x86_64-linux-gnu/ld-2.23.so 7f1109ab4000-7f1109ab5000 rw-p 00000000 00:00 0 7ffd9e97e000-7ffd9e9a0000 rw-p 00000000 00:00 0 [stack] 7ffd9e9a2000-7ffd9e9a5000 r--p 00000000 00:00 0 [vvar] 7ffd9e9a5000-7ffd9e9a7000 r-xp 00000000 00:00 0 [vdso] ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall] Aborted (core dumped)
cpio_512
Description: Binary data