]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Accept linkers representation for ELF segments with zero on-disk length.
authorKonstantin Belousov <kib@FreeBSD.org>
Sun, 12 Mar 2017 13:51:13 +0000 (13:51 +0000)
committerKonstantin Belousov <kib@FreeBSD.org>
Sun, 12 Mar 2017 13:51:13 +0000 (13:51 +0000)
commit9bcf2f2da04b041c899650780b3530507f3504e9
tree3fea19738eb17dec563404c00446f474ddd983f8
parent973d67c40781e293b04e52dad5866c45d1d9dfb7
Accept linkers representation for ELF segments with zero on-disk length.

For such segments, GNU bfd linker writes knowingly incorrect value
into the the file offset field of the program header entry, with the
motivation that file should not be mapped for creation of this segment
at all.

Relax checks for the ELF structure validity when on-disk segment
length is zero, and explicitely set mapping length to zero for such
segments to avoid validating rounding arithmetic.

PR: 217610
Reported by: Robert Clausecker <fuz@fuz.su>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
sys/kern/imgact_elf.c