summaryrefslogtreecommitdiffstats
path: root/lib/libc (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Split pledge "ioctl" into "tape" and "bpf", and allow SIOCGIFGROUP onlyderaadt2017-01-231-24/+28
| | | | upon "inet". Adjust the 4 programs that care about this.
* Link libc with compiler_rt not libgcc if COMPILER_VERSION is clang.jsg2017-01-221-2/+7
| | | | | | | | This is not a list of archs with compiler_rt as it is intended that any arch switching to clang will have the required md bits added to compiler_rt first. ok kettenis@ patrick@
* Nuke whitespace foolish enough to expose itself during the greatkrw2017-01-213-12/+12
| | | | "warning:" rectification.
* 1. When shrinking a chunk allocation, compare the size of the currentotto2017-01-211-46/+87
| | | | | | | | | | allocation to the size of the new allocation (instead of the requested size). 2. Previously realloc takes the easy way and always reallocates if C is active. This commit fixes by carefully updating the recorded requested size in all cases, and writing the canary bytes in the proper location after reallocating. 3. Introduce defines to test if MALLOC_MOVE should be done and to compute the new value.
* Add support for AArch64.patrick2017-01-1142-0/+1789
|
* Remove unnecessary casts of 'a' to char * since 'a' is already char *.millert2017-01-041-10/+10
| | | | | This is a remnant from the original 4.4BSD code that had 'a' as void * in the function args. No binary change. OK bluhm@
* gcc says "if you define labels and don't use them, I will whine."krw2016-12-251-2/+1
| | | | ok tom@
* Clarify code by eliminating unused #define's MUSTSEE, MUSTNOTSEE and inliningkrw2016-12-221-6/+3
| | | | | | MUSTEAT. ok tom@
* Adopt relevant part of NetBSD's r1.7 commit to discard unused results of thekrw2016-12-211-2/+2
| | | | | | | expressions generated by the REQUIRE() macro. Thus eliminating from build output 100 lines or so of gcc complaints about "computed but not used". cluebat & ok tom@
* Add 'default:' cases to switch statements that gcc whines about.krw2016-12-204-4/+13
| | | | ok jung@
* Another whitespace nit that wandered into my sights.krw2016-12-181-2/+2
|
* Remove prototype for static function _asr_resolver. Eliminates gcckrw2016-12-181-2/+1
| | | | | | | whining about undefined static in all the .c files that include asr_private.h. _asr_resolver() is defined and used in asr.c only. ok kettenis@
* Eliminate some gcc warnings about 'unused variables', mostly bykrw2016-12-161-2/+2
| | | | | | adding appropriate #ifdef's around declarations. ok millert@ (with a tweak I will commit separately)
* Nuke some trailing tabs.krw2016-12-151-3/+3
|
* Fix regressions introduce in the fix for CVE-2016-6559.millert2016-12-081-6/+5
| | | | From FreeBSD (glebius)
* Fix a typo, decrement rem, don't increment for single digit hex bytes.millert2016-12-071-2/+2
| | | | From Henri Kemppainen
* CVE-2016-6559: fix potential buffer overflow(s) in link_ntoa(3).millert2016-12-061-19/+35
| | | | | | | A specially crafted struct sockaddr_dl argument can trigger a stack overflow of a static buffer in libc. An attacker may be able to use this to write to arbitrary locations in the data segment. From FreeBSD (glebius); OK deraadt@ mestre@
* the referred to EXAMPLES section is now in strncpy(3);jmc2016-11-121-3/+3
| | | | | | issue reported by scott cheloha ok otto
* Fix a use after free error introduced in rev 1.18 by only callingmillert2016-11-091-8/+11
| | | | closedir() outside the loop. OK deraadt@ guenther@ markus@
* MALLOC_STATS tweaks, by default not compiled inotto2016-11-041-13/+29
|
* small tweak to also check canaries if F is in effectotto2016-11-031-3/+5
|
* remove some old option letters and also make P non-settable. It hasotto2016-10-311-24/+6
| | | | | been the default for ages, and I see no valid reason to be able to disable it. ok natano@
* include float.h for the LDBL_MAX_EXP cpp test in floatio.hjsg2016-10-302-2/+4
|
* Pages in the malloc cache are either reused quickly or unmappedotto2016-10-281-14/+1
| | | | | | quickly. In both cases it does not make sense to set hints on them. So remove that option, which is just a remainder of old times when malloc used to hold on to pages. ok stefan@
* For consistency, allow symlinkat(2) in the same way as symlink(2);schwarze2016-10-271-4/+5
| | | | | | no need to wait until the first program using it breaks... "could make sense" semarie@ (and thanks for the cluestick) OK deraadt@
* $OpenBSD$tb2016-10-223-0/+3
|
* - fix MALLOC_STATS compileotto2016-10-221-3/+6
| | | | - redundant cast is redundant
* fix some void * arithmetic by castingotto2016-10-211-4/+4
|
* and recommit with fixed GCotto2016-10-211-103/+112
|
* backout for now; flag combination GC is not okotto2016-10-201-110/+103
|
* avoid sentence splicing;jmc2016-10-201-2/+2
|
* canary corruption message changed a bitotto2016-10-201-5/+5
|
* Also place canaries in > page sized objects (if C is in effect); ok tb@otto2016-10-201-103/+110
|
* Remove the save_errno dance inside strerror_r(3). It is from thebluhm2016-10-191-5/+3
| | | | | time when we had national language support. OK millert@
* Use the reentrant strerror_r() instead of strerror() to expand %m.millert2016-10-191-10/+5
| | | | | Previously, syslog_r() would avoid calling strerror() since the latter is not reentrant. OK bluhm@
* note that SO_REUSEADDR is restricted to callers with the same uid or root;jmc2016-10-191-4/+5
| | | | | | | while there, super-user -> superuser for internal consistency; diff from kirill miazine, tweaked by myself; ok deraadt millert guenther
* Avoid generate SIGTTOU when restoring the terminal mode. If we getmillert2016-10-181-1/+5
| | | | | | | | | SIGTTOU it means the process is not in the foreground process group which, in most cases, means that the shell has taken control of the tty. Requiring the user the fg the process in this case doesn't make sense and can result in both SIGTSTP and SIGTTOU being sent which can lead to the process being suspended again immediately after being brought into the foreground.
* Roll back uintptr_t cast changes after discussions with tedu, otto anddtucker2016-10-163-24/+7
| | | | | | | | | | | | | others. C11 6.5.6.9 says: When two pointers are subtracted, both shall point to elements of the same array object, or one past the last element of the array object; the result is the difference of the subscripts of the two array elements. In these cases the objects are arrays of char so the result is defined, and we believe that the report is based on a compiler incorrectly trapping on defined behaviour.
* Wrap _malloc_init() so internal calls go directlyguenther2016-10-152-2/+6
| | | | | prodded by otto@ ok kettenis@ otto@
* Cast pointers to uintptr_t to avoid potential signedness errors.dtucker2016-10-143-7/+24
| | | | | Based on patch from yuanjie.huang at windriver.com via OpenSSH bz#2608, with & ok millert, ok deraadt.
* 0xd0 -> 0xdb; ok deraadt@ millert@ tedu@otto2016-10-141-3/+3
|
* optimize canary code a bit by storing offset of sizes table instead ofotto2016-10-121-5/+7
| | | | recomputing it all the time
* make clear the length printed is the requested lengthotto2016-10-081-3/+3
|
* sort;jmc2016-10-071-5/+5
|
* introduce a sysctl to hijack dns sockets. when set to a port number,tedu2016-10-071-2/+6
| | | | | | | all dns socket connections will be redirected to localhost:port. this could be a sockopt on the listening socket, but sysctl is an easier interface to work with right now. ok deraadt
* rss limit is no longer enforced. noticed by Raimo Niskanentedu2016-10-071-5/+3
|
* grammar fix previous;jmc2016-10-071-2/+2
|
* document "chunk canary corrupted" errorotto2016-10-071-2/+7
|
* stray tabotto2016-10-071-2/+2
|
* Beter implementation of chunk canaries: store size in chunk meta dataotto2016-10-071-61/+63
| | | | instead of chunk itself; does not change actual allocated size; ok tedu@