summaryrefslogtreecommitdiff
path: root/lib/libc
AgeCommit message (Collapse)Author
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
2014-06-12Disable the "switch to insertion sort" optimization to avoid quadraticTodd C. Miller
behavior for certain inputs. From NetBSD. OK tedu@
2014-06-11Really remove the obsolete manpages left by earlier commitChristopher Zimmermann
which just emptied the file but didn't remove it.
2014-06-11Remove manpages about deprecated RFC2292 ancillary data convenience functions.Christopher Zimmermann
They are obsoleted by the RFC3542 api. ok mpi@
2014-06-10mop up ifndef KERNEL goo; ok miodTheo de Raadt
2014-06-09Nuke the machinery to sync libkern with libc, it's not been used in theMiod Vallat
last 15 years and there is no point to use it in the future. From Jean-Philippe Ouellet
2014-06-07remove last few uses of __PTheo de Raadt
2014-06-07Fix modf() on sparcTobias Ulmer
For large integral values, modf returned uninitialized data in iptr since 1992. Found while debugging python segfaults. ok miod
2014-06-04Apply "unifdef -D__STDC__" to libc/arch/*/SYS.hMatthew Dempsky
A while back, pascal@ converted our system call stubs from using "cpp | as" to "cc -x assembler-with-cpp", so there's no need to stay compatible with ancient preprocessor semantics. ok miod
2014-06-04Remove assigned but unused local variables and macro from vfwprintf().Stefan Sperling
Found by Elliott @ google ok mpi@
2014-06-02move random bytes buffer to be part of mmaped pages; ok tedu@Otto Moerbeek
2014-05-31Delete the extraneous "return" statement at the end of a void function.Jeremie Courreges-Anglas
From Fritjof Bornebusch.
2014-05-30Add definitions for Process and (finally!) ThreadPhilip Guenther
Tweak some error descriptions based on that Completely reword ETXTBSY description based on a suggestion from millert@ tweaks and oks jmc@ millert@ sobrado@
2014-05-30A program is the thing you run; a process is an instance of somethingPhilip Guenther
running ok millert@ sobrado@
2014-05-29Use .Er for errnosPhilip Guenther
2014-05-29GrammarPhilip Guenther
2014-05-26move all stats collecting under MALLOC_STATS; ok krw@Otto Moerbeek