bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/22829] objcopy/strip: PT_GNU_RELRO is removed when it's no


From: ngg at tresorit dot com
Subject: [Bug binutils/22829] objcopy/strip: PT_GNU_RELRO is removed when it's not placed before read-only section
Date: Mon, 12 Feb 2018 06:51:23 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=22829

--- Comment #7 from NGG <ngg at tresorit dot com> ---
Thank you for the quick response and patch proposal.

Sorry for overreacting. I assigned it to critical due to its possible security
implications and because of the wide range of products it might affect. I
should have either written this at my initial description or leave it at normal
and let you decide its severity.

Your patch seems to work in my case, I've tried it with a few examples with all
of ld.bfd, ld.gold, ld.lld.

Although it is strange that for example on my sample input the
Type           Offset   VirtAddr           PhysAddr           FileSiz  MemSiz  
Flg Align
GNU_RELRO      0x003000 0x0000000000203000 0x0000000000203000 0x0001a0 0x001000
R   0x1
becomes (after stripping)
GNU_RELRO      0x003000 0x0000000000203000 0x0000000000203000 0x001000 0x001000
R   0x1

The whole file is smaller than 0x4000 so p_filesz cannot be correct.
It's working because the glibc dynamic linker only checks p_vaddr, p_memsz
(https://sourceware.org/git/?p=glibc.git;a=blob;f=elf/dl-load.c;hb=7bb087bd7bfe3616c4c0974a3f7352b593353ea5#l1095)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]