summaryrefslogtreecommitdiffstats
path: root/lib/libc (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Use recallocarray() to avoid leaving detritus in memory when resizingmillert2017-03-171-2/+3
| | | | the string buffer used by asprintf() and vasprintf(). OK deraadt@
* recallocarray() the string buffer, to avoid leaving such contentsderaadt2017-03-171-5/+6
| | | | | | around in the address space. Don't bother doing so for the buffer which contains aslr'd pointers... ok millert
* Use recallocarray() to avoid leaving detritus in memory when resizingderaadt2017-03-174-8/+12
| | | | | | buffers. We don't bother doing this for objects containing pointers, but focus on controllable data. ok millert
* sync the vfs bits as best i can;jmc2017-03-161-25/+17
|
* Only reallocate the buffer to fit for medium-size allocations wheremillert2017-03-162-18/+28
| | | | | we expanded the buffer to a single page. The final realloc() can be expensive for large buffers and is not realled needed. OK deraadt@
* bit more consistent;jmc2017-03-161-5/+4
|
* When reallocating the buffer for asprintf(), just round up to themillert2017-03-161-6/+5
| | | | | nearest page instead of doubling the old size until it is large enough. OK deraadt@
* use recallocarray to resize buffer - ensures that detritus from previousderaadt2017-03-151-2/+2
| | | | | lookups isn't left lying around the address space. ok eric
* Use a macro for the initial length of the buffer instead of 127; OK deraadt@millert2017-03-142-6/+10
|
* don't need to handle the malloc case special, since realloc worksderaadt2017-03-141-9/+1
| | | | | with NULL ok eric
* - no KERN_RND: from schwarzejmc2017-03-131-13/+1
| | | | - remove some XXX i no longer need
* for each sysctl name, attach the variable name as seen by sysctl(8);jmc2017-03-131-370/+353
| | | | | | includes some fixes from schwarze, as well as some general tweaking; ok deraadt schwarze
* shuffle back: wxabort is described in sysctl(3);jmc2017-03-112-4/+4
|
* repair Xr, and point to sysctl(8) instead because sysctl(3) fails toderaadt2017-03-112-6/+8
| | | | | document kern.wxabort from michael reed
* Correct arm64 sigprocmask parameter passing in setjmp/longjmp calls.drahn2017-03-081-14/+11
| | | | | Always return nonzero as the return code from longjmp. ok guenther@ patrick@
* If tcsetpgrp() is called by a background process and there is amillert2017-03-071-2/+6
| | | | | SIGTTOU handler installed without SA_RESTART set, tcsetpgrp() will return -1 and set errno to EINTR. OK deraadt@
* Some tweaks from jmc@ and describe better what recallocarray does;otto2017-03-071-7/+16
| | | | help and ok from tom@ and deraadt@
* recallocarray bumpotto2017-03-061-1/+1
|
* Introducing recallocarray(3), a blend of calloc(3) and reallocarray(3)otto2017-03-065-8/+150
| | | | | with the added feature that released memory is cleared. Much input from various developers. ok deraadt@ tom@
* size is unsigned so using ==0 not <=0 when checking for buffer exhaustionmillert2017-03-061-4/+4
|
* Pull in a change from the bind 8 resolver that fixes a potentialmillert2017-03-061-10/+16
| | | | | crash when given a large hex number as part of the dotted quad. OK deraadt@ jsg@
* document EPERM error when connect(2)ing.benno2017-03-021-2/+5
| | | | ok bluhm@ jmc@ renato@
* use Dv, for consistency; from bruno flueckigerjmc2017-02-271-3/+3
|
* Add support for RES_USE_DNSSECjca2017-02-275-18/+24
| | | | | | | | | | | | RES_USE_DNSSEC is implemented by setting the DNSSEC DO bit in outgoing queries. The resolver is then supposed to set the AD bit in the reply if it managed to validate the answer through DNSSEC. Useful when the application doesn't implement validation internally. This scheme assumes that the validating resolver is trusted and that the communication channel between the validating resolver and and the client is secure. ok eric@ gilles@
* Recognize and allow bits AD and CD in DNS replies.jca2017-02-272-6/+9
| | | | | | Needed for RES_USE_DNSSEC support. ok eric@ gilles@
* Put a common flags field in the query struct, rather than in somejca2017-02-275-21/+19
| | | | | | | | | elements of the union. This field is for internal asr flags. The flags in "struct rrset" and "struct ni" are different kinds of flags. ok eric@
* RELRO means the __{got,plt}_{start,end} symbols are superfluousguenther2017-02-273-6/+0
| | | | ok kettenis@
* The assembly for sigpending(2) wasn't correctly implemented either. Ipatrick2017-02-231-2/+3
| | | | | | | suppose this still stems from the first steps where we tried to get at least some userland stuff to compile. This change properly saves the pointer before doing the syscall and stores the return value in the pointer on return. This makes sigpending regress pass.
* SHA-1 collisions have now been found so update some man pages. As noted bydaniel2017-02-231-5/+9
| | | | | | | | minek van on misc@. Thanks. ok tb@, tj@ (and jmc@ is ok with the diff but can't ok the technical content).
* Replace use of mathematical minus with an em-dash (from tb@) and break updaniel2017-02-231-5/+5
| | | | a long sentence (from tj@).
* Put a common subq pointer in the query struct, rather than one in eacheric2017-02-238-53/+40
| | | | | | element of the union. ok gilles@ millert@ krw@
* The assembly for sigprocmask(2) had a tiny typo which made it jump topatrick2017-02-221-4/+4
| | | | | | | the wrong location, thus not making it set SIG_BLOCK with a zero mask when attempting to read the signal mask (if set ptr is NULL). Instead an attempt to read the mask actually told the syscall to set the mask to zero.
* missing breakseric2017-02-212-2/+4
| | | | ok jca@ krw@ gilles@
* Report the errno set by getifaddrs(3) if the setup for AI_ADDRCONFIG fails,eric2017-02-211-4/+5
| | | | | | | rather than a non-informative EAI_FAIL. Compare to -1 for error detection while here. ok jca@ gilles@
* __tfork(3) returns the thread ID of the new thread in x0, not x1. Thepatrick2017-02-201-2/+2
| | | | | value returned in x1 on __tfork(3) is always zero, which made the code always fall into the child case.
* Use T_OPT instead of literal "41".jca2017-02-191-2/+2
| | | | Requested earlier by eric@
* Use more specific error codes for invalid packets.eric2017-02-181-4/+15
| | | | | | | | In particular, truncated packets without the TC flag set (non-compliant server sending too large packets) now fail with EOVERFLOW instead of EINVAL, so the TCP fallback mechanism can work. feedback and ok krw@ jca@ benno@
* Add EDNS0 support.jca2017-02-187-16/+42
| | | | | | | EDNS allows for various DNS extensions, among which UDP DNS packets size bigger than 512 bytes. The default is still to not advertize anything. ok eric@
* use common errnos instead of random strings as error indicators ineric2017-02-173-15/+16
| | | | | | pack/unpack contexts. ok krw@ deraadt@
* Increase UDP packet buffer to 4096 bytes from 512. There are some reallykrw2017-02-171-2/+4
| | | | | | | | | | broken DNS servers out there that send packets >512 bytes w/o even the courtesy of trying to use EDNS0. A partial workaround as more complete packet parsing solutions are worked on. ok jca@ eric@
* Style improvement, no functional change.schwarze2017-02-151-8/+7
| | | | | | | | | | As reported by Yuri Pankov, some versions of GCC whine that "tmp" might be used uninitialized in fts_open(3). Clearly, that cannot actually happen, but explicitly setting it to NULL is safer anyway. While here, rename the badly named variable "tmp" and make the inner "if" easier to understand. Feedback and OK guenther@
* Add a NULL test to wrterror() to avoid a NULL deref when called from ajsg2017-02-151-2/+2
| | | | | | free() error path. ok otto@
* Missing opening brace. Spotted by Hiltjo Posthuma.tb2017-02-141-3/+3
|
* malloc does not *need* to return page-aligned objects for size >=otto2017-02-121-5/+2
| | | | | a page. This is not required by any standard and other malloc implementation do not document (or implement) this. ok deraadt@
* fix a comment and rm some dead code as a result of the previous diffotto2017-02-021-8/+5
|
* Let realloc handle and produce moved pointers for allocations betweenotto2017-02-011-20/+37
| | | | half a page and a page. ok jmatthew@ tb@
* return the sio_open notes to the audio section; from michael reedjmc2017-01-291-6/+6
|
* __errno() returns a 32-bit pointer, so make sure we write a 32-bitpatrick2017-01-251-2/+2
| | | | value to and not overwrite other bits by writing a 64-bit value.
* in resolver(3), document that _EDNS0 and _DNSSEC are no ops;jmc2017-01-241-6/+17
| | | | | | | diff from kirill miazine while here, bump all the no op texts to one standard blurb; help/ok jca
* whitespace between macro args and punctuation, and zap a tonjmc2017-01-231-42/+42
| | | | of unneccessary quoting; ok deraadt