summaryrefslogtreecommitdiff
path: root/lib/libc
AgeCommit message (Collapse)Author
2017-01-21Nuke whitespace foolish enough to expose itself during the greatKenneth R Westerback
"warning:" rectification.
2017-01-211. When shrinking a chunk allocation, compare the size of the currentOtto Moerbeek
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.
2017-01-11Add support for AArch64.Patrick Wildt
2017-01-04Remove unnecessary casts of 'a' to char * since 'a' is already char *.Todd C. Miller
This is a remnant from the original 4.4BSD code that had 'a' as void * in the function args. No binary change. OK bluhm@
2016-12-25gcc says "if you define labels and don't use them, I will whine."Kenneth R Westerback
ok tom@
2016-12-22Clarify code by eliminating unused #define's MUSTSEE, MUSTNOTSEE and inliningKenneth R Westerback
MUSTEAT. ok tom@
2016-12-21Adopt relevant part of NetBSD's r1.7 commit to discard unused results of theKenneth R Westerback
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@
2016-12-20Add 'default:' cases to switch statements that gcc whines about.Kenneth R Westerback
ok jung@
2016-12-18Another whitespace nit that wandered into my sights.Kenneth R Westerback
2016-12-18Remove prototype for static function _asr_resolver. Eliminates gccKenneth R Westerback
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@
2016-12-16Eliminate some gcc warnings about 'unused variables', mostly byKenneth R Westerback
adding appropriate #ifdef's around declarations. ok millert@ (with a tweak I will commit separately)
2016-12-15Nuke some trailing tabs.Kenneth R Westerback
2016-12-08Fix regressions introduce in the fix for CVE-2016-6559.Todd C. Miller
From FreeBSD (glebius)
2016-12-07Fix a typo, decrement rem, don't increment for single digit hex bytes.Todd C. Miller
From Henri Kemppainen
2016-12-06CVE-2016-6559: fix potential buffer overflow(s) in link_ntoa(3).Todd C. Miller
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@
2016-11-12the referred to EXAMPLES section is now in strncpy(3);Jason McIntyre
issue reported by scott cheloha ok otto
2016-11-09Fix a use after free error introduced in rev 1.18 by only callingTodd C. Miller
closedir() outside the loop. OK deraadt@ guenther@ markus@
2016-11-04MALLOC_STATS tweaks, by default not compiled inOtto Moerbeek
2016-11-03small tweak to also check canaries if F is in effectOtto Moerbeek
2016-10-31remove some old option letters and also make P non-settable. It hasOtto Moerbeek
been the default for ages, and I see no valid reason to be able to disable it. ok natano@
2016-10-30include float.h for the LDBL_MAX_EXP cpp test in floatio.hJonathan Gray
2016-10-28Pages in the malloc cache are either reused quickly or unmappedOtto Moerbeek
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@
2016-10-27For consistency, allow symlinkat(2) in the same way as symlink(2);Ingo Schwarze
no need to wait until the first program using it breaks... "could make sense" semarie@ (and thanks for the cluestick) OK deraadt@
2016-10-22$OpenBSD$Theo Buehler
2016-10-22- fix MALLOC_STATS compileOtto Moerbeek
- redundant cast is redundant
2016-10-21fix some void * arithmetic by castingOtto Moerbeek
2016-10-21and recommit with fixed GCOtto Moerbeek
2016-10-20backout for now; flag combination GC is not okOtto Moerbeek
2016-10-20avoid sentence splicing;Jason McIntyre
2016-10-20canary corruption message changed a bitOtto Moerbeek
2016-10-20Also place canaries in > page sized objects (if C is in effect); ok tb@Otto Moerbeek
2016-10-19Remove the save_errno dance inside strerror_r(3). It is from theAlexander Bluhm
time when we had national language support. OK millert@
2016-10-19Use the reentrant strerror_r() instead of strerror() to expand %m.Todd C. Miller
Previously, syslog_r() would avoid calling strerror() since the latter is not reentrant. OK bluhm@
2016-10-19note that SO_REUSEADDR is restricted to callers with the same uid or root;Jason McIntyre
while there, super-user -> superuser for internal consistency; diff from kirill miazine, tweaked by myself; ok deraadt millert guenther
2016-10-18Avoid generate SIGTTOU when restoring the terminal mode. If we getTodd C. Miller
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.
2016-10-16Roll back uintptr_t cast changes after discussions with tedu, otto andDarren Tucker
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.
2016-10-15Wrap _malloc_init() so internal calls go directlyPhilip Guenther
prodded by otto@ ok kettenis@ otto@
2016-10-14Cast pointers to uintptr_t to avoid potential signedness errors.Darren Tucker
Based on patch from yuanjie.huang at windriver.com via OpenSSH bz#2608, with & ok millert, ok deraadt.
2016-10-140xd0 -> 0xdb; ok deraadt@ millert@ tedu@Otto Moerbeek
2016-10-12optimize canary code a bit by storing offset of sizes table instead ofOtto Moerbeek
recomputing it all the time
2016-10-08make clear the length printed is the requested lengthOtto Moerbeek
2016-10-07sort;Jason McIntyre
2016-10-07introduce a sysctl to hijack dns sockets. when set to a port number,Ted Unangst
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
2016-10-07rss limit is no longer enforced. noticed by Raimo NiskanenTed Unangst
2016-10-07grammar fix previous;Jason McIntyre
2016-10-07document "chunk canary corrupted" errorOtto Moerbeek
2016-10-07stray tabOtto Moerbeek
2016-10-07Beter implementation of chunk canaries: store size in chunk meta dataOtto Moerbeek
instead of chunk itself; does not change actual allocated size; ok tedu@
2016-10-04Use the userspace-visible thread register directly in __cerror insteadPhilip Guenther
of indirecting through __errno(). Register naming tweaks and clang testing by patrick@ and jsg@ ok kettenis@
2016-09-30Make read(2) return EISDIR on directories.Jeremie Courreges-Anglas
Years ago Theo made read(2) return 0 on directories, instead of dumping the directory content. Another behavior is allowed as an extension by POSIX, returning an EISDIR error, as used on a few other systems. This behavior is deemed more useful as it helps spotting errors. This implies that it might break some setups. Ports bulk builds by ajacoutot@ and naddy@, ok millert@ bluhm@ naddy@ deraadt@