summaryrefslogtreecommitdiff
path: root/lib/libc
AgeCommit message (Collapse)Author
2014-07-11clean up after previous: zap rfc 4620 from sysctl(3) too.Sebastian Benoit
ok jmc
2014-07-11Add locking for __cxa_finalize() as it modifies the page permissions of theMark Kettenis
__atexit tables and touches global variables. From Srinavasa Nagaraju through Android/Elliott Hughes. ok tedu@, guenther@
2014-07-11better document perils of setuid getenv and xr with issetugidTed Unangst
ok deraadt
2014-07-10as noted by google/android via kettenis, atexit handlers can install newTed Unangst
handlers. if this happens, restart the loop. ok kettenis matthew millert miod
2014-07-10Add MAP_ANONYMOUS as a synonym for MAP_ANON, per POSIX proposalMatthew Dempsky
ok miod
2014-07-10__tfork_thread is in libc, so move the manpage over tooPhilip Guenther
ok deraadt@
2014-07-10posix_madvise() should return the errno value on error, not -1Philip Guenther
ok tedu@ jmc@
2014-07-10sprinkle in -Werror-implicit-function-declaration to disable one of theTed Unangst
worst C misfeatures. ok deraadt miod
2014-07-10prototype for _thread_sys_madviseTed Unangst
2014-07-10Don't document the guts of struct syslog_data. This man page only needsTheo de Raadt
to demonstrate to use it with syslog_r. pointed out by millert
2014-07-09reduce obvious dependency on global g_pool by moving to local aliasesTed Unangst
ok otto
2014-07-09rephrase the stpcpy() warningChristian Weisgerber
new wording agreed by at least kettenis@ millert@ otto@
2014-07-09Clean up after arc4random u_int32_t uint32_t changeBob Beck
ok jsing@
2014-07-09changes to improve portabilitybcook
ok beck@ deraadt@ jsing@ guenther@
2014-07-08decouple struct uvmexp into a new file, so that uvm_extern.h and sysctl.hTheo de Raadt
don't need to be married. ok guenther miod beck jsing kettenis
2014-07-08Document that shm_open() et al have been available since OpenBSD 5.4Matthew Dempsky
2014-07-03rework some fflush text, as requestedJason McIntyre
From: Edward tweaks From: Tim van der Molen
2014-07-02Various small typographic fixes for mman.h manual pages:Matthew Dempsky
Use .Fn instead of .Nm as appropriate Use .In for include lines Use .Rv -std where possible Use .Xr to refer to functions from other manual pages Remove extraneous sys/types.h include More substantive changes to follow. Discussed with schwarze
2014-07-02Sync description of PROT_* flags between mmap.2 and mprotect.2Matthew Dempsky
ok guenther
2014-06-27zap unneccessary punctuation;Jason McIntyre
2014-06-27re-init and init code paths are now more shared, so the getpid()-basedTheo de Raadt
portable code path must handle that; with brent cook
2014-06-27Cleanup ioctl.2 slightly:Matthew Dempsky
- Markup ioctl argument types with Fa - Be clearer that ioctl arguments are pointers to ints. Similar changes to follow for manual pages that describe device-specific ioctl commands. Discussed with jmc and schwarze.
2014-06-27OpenBSD supports mmap() on block special files too.Matthew Dempsky
2014-06-27Split out mmap's compatibility flags into a separate section, so usersMatthew Dempsky
aren't misled into thinking they're useful on OpenBSD.
2014-06-27Revise wording to reflect that callers should always specify (exactly)Matthew Dempsky
one of MAP_PRIVATE or MAP_SHARED, as required by POSIX. However, also caveat that currently OpenBSD doesn't strictly enforce this behavior.
2014-06-27extra evil spaces snuck in over the last whileTheo de Raadt
2014-06-27Move to a smaller rbytes buffer and skip a random part. Not toOtto Moerbeek
improve the random stream itself (it doesn't), but to introduce noise in the arc4random calling pattern. Thanks to matthew@ who pointed out bias in a previous diff, ok deraadt@ matthew@
2014-06-26Add back an #ifndef MAP_INHERIT_ZERO chunk to support the old getpid()Theo de Raadt
mechanism, to aid in portability to other systems as requested. ok matthew
2014-06-26Document that mmap() confirms to POSIX 2008, except that we generateMatthew Dempsky
SIGSEGV instead of SIGBUS for page references beyond the end of a mapped object.
2014-06-25document why we explicit_bzeroTheo de Raadt
2014-06-21loosen the spec for timingsafe functions slightly, so as to notTed Unangst
artificially constrain alternative implementations. ok deraadt
2014-06-15occured -> occurred;Jason McIntyre
2014-06-14Change return value of getentropy() to int 0 for success. MaximumTheo de Raadt
buffersize is enforced strictly, this supplies sufficient entropy payload to act as seed material. Discourage general use of this API, but lock down this function name as the go-to for userland PRNG seeding. Improve documentation. ok miod matthew
2014-06-13typo; Piotr SikoraTheo de Raadt
2014-06-21Protect explicit_bzero() from link-time optimizationMatthew Dempsky
Modern compiler toolchains are capable of optimizing even across translation unit boundaries, so simply moving the memory clearing into a separate function is not guaranteed to clear memory. To avoid this, we take advantage of ELF weak symbol semantics, and insert a call to an empty, weakly named function. The semantics of calling this function aren't determinable until load time, so the compiler and linker need to keep the memset() call. There are still ways a toolchain might defeat this trick (e.g., optimistically expecting the weak symbol to not be overloaded, and only calling memset() if it is; promoting weak symbols to strong symbols at link-time when emitting a static binary because they won't be interposed; implementing load-time optimizations). But at least for the foreseeable future, these seem unlikely. ok deraadt
2014-06-20arc4random: hard fail with raise(SIGKILL) if getentropy() returns -1Matthew Dempsky
Allow other non-zero return values in case we change our mind to return an ssize_t byte count instead of simple success/fail. ok deraadt, djm
2014-06-19Move rs_chacha and rs_buf into the same memory page and don't mark itMatthew Dempsky
MAP_INHERIT_ZERO anymore. This restores arc4random's previous behavior where fork children would mix in some randomness from the parent process. New behavior noticed by deraadt ok deraadt, tedu
2014-06-18Always call atexit handlers as if they were registered with __cxa_atexit.Mark Kettenis
The extra argument doesn't hurt genuine atexit handlers and this fixes a bug where we didn't provide the argument (effectively passing garbage) for functions registered with __cxa_atexit in the main executable. Pointed out by Dmitriy Ivanov <dimitry@google.com> and Elliott Hughes <enh@google.com>. ok matthew@
2014-06-17Use MAP_INHERIT_ZERO in arc4random(3)Matthew Dempsky
Now instead of calling getpid() each time a user invokes arc4random(), we're able to rely on the kernel zero'ing out the RNG state if the process forks. ok deraadt, djm
2014-06-15oops, typo. James Hartley is fast at trying -currentTheo de Raadt
2014-06-15In srandomdev(), use arc4random_buf() instead of from the kernel.Theo de Raadt
discussion with matthew
2014-06-13For now... assume success of getentropy() just like we assumed successTheo de Raadt
of sysctl(). Mark it with XXX while we consider.
2014-06-13Remove deprecated RFC2292 ancillary data convenience functions.Christopher Zimmermann
They are obsoleted by the RFC3542 api. ok mpi@
2014-06-13use getgentropy() call. If it fails, things are pretty bad --Theo de Raadt
call abort(). this direction discussed at length with miod beck tedu matthew etc
2014-06-13use getentropy; from matthewTheo de Raadt
2014-06-13delete a lie; replace with a truthTheo de Raadt
2014-06-13Add new getentropy() system call. Code and pressure from matthew.Theo de Raadt
I accepted that he's right (again) to seperate this out from heavy sysctl API and this will simply a variety of things. Functionname is not used by anyone in the ports tree, so we guess we can use it. Shocking that no application has a function called this. ok matthew & others who pushed him to start this early on
2014-06-13crank majorTheo de Raadt
2014-06-13Add timingsafe_memcmp().Matthew Dempsky
ok deraadt, jmc, tedu
2014-06-13Add support for MAP_INHERIT_ZERO.Matthew Dempsky
This provides a way for a process to designate pages in its address space that should be replaced by fresh, zero-initialized anonymous memory in forked child processes, rather than being copied or shared. ok jmc, kettenis, tedu, deraadt; positive feedback from many more