root@ee-dwz:~# apt install ./gzip_1.10-0ubuntu3.1_amd64.deb
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'gzip' instead of './gzip_1.10-0ubuntu3.1_amd64.deb'
gzip is already the newest version (1.10-0ubuntu3.1).
The following package was automatically installed and is no longer required:
libdumbnet1
Use 'apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
root@ee-dwz:~# FILE=/usr/bin/gzip; readelf -W --program-headers $FILE | awk -v size=$(stat -c %s $FILE) '/^ LOAD/ {if (strtonum($2) > size) {print "wrong offset ("$2" ("strtonum($2)") points past EOF:" size; exit 1;}}'
root@ee-dwz:~# echo $?
0
root@ee-dwz:~# FILE=/usr/bin/gzip; readelf -W --program-headers $FILE
Elf file type is DYN (Shared object file)
Entry point 0x4190
There are 14 program headers, starting at offset 64
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
PHDR 0x000040 0x0000000000000040 0x0000000000000040 0x000310 0x000310 R 0x8
INTERP 0x000350 0x0000000000000350 0x0000000000000350 0x00001c 0x00001c R 0x1
[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
LOAD 0x000000 0x0000000000000000 0x0000000000000000 0x0027a0 0x0027a0 R 0x1000
LOAD 0x003000 0x0000000000003000 0x0000000000003000 0x00ea05 0x00ea05 R E 0x1000
LOAD 0x012000 0x0000000000012000 0x0000000000012000 0x003e80 0x003e80 R 0x1000
LOAD 0x016690 0x0000000000017690 0x0000000000017690 0x000d70 0x000d70 RW 0x1000
LOAD 0x000000 0x000000000001a000 0x000000000001a000 0x000000 0x0ca048 RW 0x1000
DYNAMIC 0x016b80 0x0000000000017b80 0x0000000000017b80 0x0001f0 0x0001f0 RW 0x8
NOTE 0x000370 0x0000000000000370 0x0000000000000370 0x000020 0x000020 R 0x8
NOTE 0x000390 0x0000000000000390 0x0000000000000390 0x000044 0x000044 R 0x4
GNU_PROPERTY 0x000370 0x0000000000000370 0x0000000000000370 0x000020 0x000020 R 0x8
GNU_EH_FRAME 0x01433c 0x000000000001433c 0x000000000001433c 0x000404 0x000404 R 0x4
GNU_STACK 0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RW 0x10
GNU_RELRO 0x016690 0x0000000000017690 0x0000000000017690 0x000970 0x000970 R 0x1
Verified binutils 2.33-2ubuntu1.2 by rebuilding gzip in the Bileto PPA with new binutils and checking the rebuilt gzip binary:
root@ee-dwz:~# wget https:/ /launchpad. net/~ci- train-ppa- service/ +archive/ ubuntu/ 3878/+build/ 18334107/ +files/ gzip_1. 10-0ubuntu3. 1_amd64. deb /launchpad. net/~ci- train-ppa- service/ +archive/ ubuntu/ 3878/+build/ 18334107/ +files/ gzip_1. 10-0ubuntu3. 1_amd64. deb 1560:8003: :8003, ... net)|91. 189.89. 222|:443. .. connected. /launchpadlibra rian.net/ 456546671/ gzip_1. 10-0ubuntu3. 1_amd64. deb [following] /launchpadlibra rian.net/ 456546671/ gzip_1. 10-0ubuntu3. 1_amd64. deb ian.net (launchpadlibra rian.net) ... 91.189.89.228, 91.189.89.229, 2001:67c: 1560:8003: :8007, ... ian.net (launchpadlibra rian.net) |91.189. 89.228| :443... connected. x-debian- package] 10-0ubuntu3. 1_amd64. deb’
--2019-12-20 17:50:02-- https:/
Resolving launchpad.net (launchpad.net)... 91.189.89.222, 91.189.89.223, 2001:67c:
Connecting to launchpad.net (launchpad.
HTTP request sent, awaiting response... 303 See Other
Location: https:/
--2019-12-20 17:50:03-- https:/
Resolving launchpadlibrar
Connecting to launchpadlibrar
HTTP request sent, awaiting response... 200 OK
Length: 95292 (93K) [application/
Saving to: ‘gzip_1.
gzip_1. 10-0ubuntu3. 1_amd64. deb 100%[== ======= ======= ======= ======= ======= ======= ======= ======= ======= ======= ======= ======= ===>] 93.06K --.-KB/s in 0.1s
2019-12-20 17:50:03 (715 KB/s) - ‘gzip_1. 10-0ubuntu3. 1_amd64. deb’ saved [95292/95292]
root@ee-dwz:~# apt install ./gzip_ 1.10-0ubuntu3. 1_amd64. deb 1.10-0ubuntu3. 1_amd64. deb'
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'gzip' instead of './gzip_
gzip is already the newest version (1.10-0ubuntu3.1).
The following package was automatically installed and is no longer required:
libdumbnet1
Use 'apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
root@ee-dwz:~# FILE=/usr/bin/gzip; readelf -W --program-headers $FILE | awk -v size=$(stat -c %s $FILE) '/^ LOAD/ {if (strtonum($2) > size) {print "wrong offset ("$2" ("strtonum($2)") points past EOF:" size; exit 1;}}'
root@ee-dwz:~# echo $?
0
root@ee-dwz:~# FILE=/usr/bin/gzip; readelf -W --program-headers $FILE
Elf file type is DYN (Shared object file)
Entry point 0x4190
There are 14 program headers, starting at offset 64
Program Headers: ld-linux- x86-64. so.2]
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
PHDR 0x000040 0x0000000000000040 0x0000000000000040 0x000310 0x000310 R 0x8
INTERP 0x000350 0x0000000000000350 0x0000000000000350 0x00001c 0x00001c R 0x1
[Requesting program interpreter: /lib64/
LOAD 0x000000 0x0000000000000000 0x0000000000000000 0x0027a0 0x0027a0 R 0x1000
LOAD 0x003000 0x0000000000003000 0x0000000000003000 0x00ea05 0x00ea05 R E 0x1000
LOAD 0x012000 0x0000000000012000 0x0000000000012000 0x003e80 0x003e80 R 0x1000
LOAD 0x016690 0x0000000000017690 0x0000000000017690 0x000d70 0x000d70 RW 0x1000
LOAD 0x000000 0x000000000001a000 0x000000000001a000 0x000000 0x0ca048 RW 0x1000
DYNAMIC 0x016b80 0x0000000000017b80 0x0000000000017b80 0x0001f0 0x0001f0 RW 0x8
NOTE 0x000370 0x0000000000000370 0x0000000000000370 0x000020 0x000020 R 0x8
NOTE 0x000390 0x0000000000000390 0x0000000000000390 0x000044 0x000044 R 0x4
GNU_PROPERTY 0x000370 0x0000000000000370 0x0000000000000370 0x000020 0x000020 R 0x8
GNU_EH_FRAME 0x01433c 0x000000000001433c 0x000000000001433c 0x000404 0x000404 R 0x4
GNU_STACK 0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RW 0x10
GNU_RELRO 0x016690 0x0000000000017690 0x0000000000017690 0x000970 0x000970 R 0x1
Section to Segment mapping:
Segment Sections...
00
01 .interp
02 .interp .note.gnu.property .note.gnu.build-id .note.ABI-tag .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rela.dyn .rela.plt
03 .init .plt .plt.got .plt.sec .text .fini
04 .rodata .eh_frame_hdr .eh_frame
05 .init_array .fini_array .data.rel.ro .dynamic .got .data
06 .bss
07 .dynamic
08 .note.gnu.property
09 .note.gnu.build-id .note.ABI-tag
10 .note.gnu.property
11 .eh_frame_hdr
12
13 .init_array .fini_array .data.rel.ro .dynamic .got
root@ee-dwz:~#