Date: Mon, 15 May 2017 18:47:26 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318312 - head/libexec/rtld-elf Message-ID: <201705151847.v4FIlQln069987@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Mon May 15 18:47:25 2017 New Revision: 318312 URL: https://svnweb.freebsd.org/changeset/base/318312 Log: Fix the AT_EXECFD functionality. If the mapped object is linked at specific address, we must obey it. If AT_EXECFD is not used, only in-kernel ELF image activator needed to keep the mapping address, since only binaries are linked at the fixed address, and binaries are mapped by kernel in this case. Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 2 weeks X-Differential revision: https://reviews.freebsd.org/D10701 Modified: head/libexec/rtld-elf/map_object.c Modified: head/libexec/rtld-elf/map_object.c ============================================================================== --- head/libexec/rtld-elf/map_object.c Mon May 15 18:41:12 2017 (r318311) +++ head/libexec/rtld-elf/map_object.c Mon May 15 18:47:25 2017 (r318312) @@ -193,6 +193,8 @@ map_object(int fd, const char *path, con base_flags = MAP_PRIVATE | MAP_ANON | MAP_NOCORE; if (npagesizes > 1 && round_page(segs[0]->p_filesz) >= pagesizes[1]) base_flags |= MAP_ALIGNED_SUPER; + if (base_vaddr != 0) + base_flags |= MAP_FIXED | MAP_EXCL; mapbase = mmap(base_addr, mapsize, PROT_NONE, base_flags, -1, 0); if (mapbase == (caddr_t) -1) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705151847.v4FIlQln069987>