freebsd-skq/sys/compat
Mark Johnston 9f9c9b22ec Reimplement brk() and sbrk() to avoid the use of _end.
Previously, libc.so would initialize its notion of the break address
using _end, a special symbol emitted by the static linker following
the bss section.  Compatibility issues between lld and ld.bfd could
cause the wrong definition of _end (libc.so's definition rather than
that of the executable) to be used, breaking the brk()/sbrk()
interface.

Avoid this problem and future interoperability issues by simply not
relying on _end.  Instead, modify the break() system call to return
the kernel's view of the current break address, and have libc
initialize its state using an extra syscall upon the first use of the
interface.  As a side effect, this appears to fix brk()/sbrk() usage
in executables run with rtld direct exec, since the kernel and libc.so
no longer maintain separate views of the process' break address.

PR:		228574
Reviewed by:	kib (previous version)
MFC after:	2 months
Differential Revision:	https://reviews.freebsd.org/D15663
2018-06-04 19:35:15 +00:00
..
cloudabi Eliminate the overhead of gratuitous repeated reinitialization of cap_rights 2018-05-09 18:47:24 +00:00
cloudabi32 Don't use an .OBJDIR for 'make sysent'. 2018-01-29 19:14:15 +00:00
cloudabi64 Don't use an .OBJDIR for 'make sysent'. 2018-01-29 19:14:15 +00:00
freebsd32 Reimplement brk() and sbrk() to avoid the use of _end. 2018-06-04 19:35:15 +00:00
ia32 Move most of the contents of opt_compat.h to opt_global.h. 2018-04-06 17:35:35 +00:00
linprocfs UDP: further performance improvements on tx 2018-05-23 21:02:14 +00:00
linsysfs Make it easier for filesystems to count themselves as jail-enabled, 2018-05-04 20:54:27 +00:00
linux UDP: further performance improvements on tx 2018-05-23 21:02:14 +00:00
linuxkpi/common Implement the __sg_alloc_table_from_pages() function based on the existing 2018-06-01 12:09:07 +00:00
ndis Revert r327828, r327949, r327953, r328016-r328026, r328041: 2018-01-21 15:42:36 +00:00
netbsd sys/compat: further adoption of SPDX licensing ID tags. 2017-11-27 15:13:23 +00:00
x86bios x86bios: spelling fix in a comment. 2016-04-30 00:34:04 +00:00