]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add a WITH_BIND_NOW build knob
authorEd Maste <emaste@FreeBSD.org>
Thu, 26 Sep 2019 15:50:18 +0000 (15:50 +0000)
committerEd Maste <emaste@FreeBSD.org>
Thu, 26 Sep 2019 15:50:18 +0000 (15:50 +0000)
commit8ea39e8febbba976e91b5f93e68cfcc36b3c68f0
tree2ad828cce355105f1d0303d29cfc7df9e11a76c0
parentdb63b9b9b9aa0912b15c1325e4903c4cb308da52
Add a WITH_BIND_NOW build knob

MFC r340186: Add a WITH_BIND_NOW build knob

The linker's -z now flag sets the DF_BIND_NOW flag, which signals to the
runtime loader that all relocation processing should be performed at
process startup rather than on demand.  In combination with lld's
default of enabling relro this causes the GOT to be made read-only when
the process starts, preventing straightforward GOT overwrite attacks.

MFC r341429: disable BIND_NOW in libc, libthr, and rtld

An issue remains with BIND_NOW and processes using threads.  For now,
restore libc's BIND_NOW disable, and also disable BIND_NOW in rtld and
libthr.

MFC r345625: revert r341429 "disable BIND_NOW in libc, libthr, and rtld"

r345620 by kib@ fixed the rtld issue that caused a crash at startup
during resolution of libc's ifuncs with BIND_NOW.

MFC r345638: Revert change accidentally committed along with r345625

MFC r345640: Revert other accidentally committed part of r345625

Sponsored by: The FreeBSD Foundation
share/mk/bsd.lib.mk
share/mk/bsd.opts.mk
share/mk/bsd.prog.mk
tools/build/options/WITHOUT_BIND_NOW [new file with mode: 0644]
tools/build/options/WITH_BIND_NOW [new file with mode: 0644]