]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
rtld: Round down relro_size
authorKonstantin Belousov <kib@FreeBSD.org>
Thu, 12 Aug 2021 02:45:15 +0000 (05:45 +0300)
committerKonstantin Belousov <kib@FreeBSD.org>
Fri, 13 Aug 2021 09:58:53 +0000 (12:58 +0300)
commitc9f833abf1d76ea194b82caafa06a0627790ad97
tree35cbdfe8979c84e9f2d0673ef92fa9259d1cae74
parent44d4804d1945435745518cd09eb8ae6ab22ecef4
rtld: Round down relro_size

lld rounds up p_memsz(PT_GNU_RELRO) to satisfy common-page-size. If the
page size is smaller than common-page-size, rounding up relro_size may
incorrectly make some RW pages read-only.

GNU ld, gold, and ld.lld ensures p_vaddr+p_memsz is a multiple of
common-page-size. While max-page-size >= system the page size,
common-page-size can be smaller than the system page size.

Submitted by: MaskRay
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D31498
libexec/rtld-elf/map_object.c
libexec/rtld-elf/rtld.c