summaryrefslogtreecommitdiffstats
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* MFC r320737, r320914asomers2017-08-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | r320737: Fix cleanup in lib/libc/gen/setdomainname_test ATF cleanup routines run in separate processes from the tests themselves, so they can't share global variables. Also, setdomainname_test needs to be is_exclusive because the test cases access a global resource. PR: 219967 Reviewed by: ngie Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D11188 r320914: Remove an extraneous strlen from t_setdomainname.c Reported by: Coverity CID: 1377568 X-MFC-With: 320737 Sponsored by: Spectra Logic Corp
* Clarify usage of aio(4) with kqueue(2)asomers2017-07-311-26/+11
| | | | | | Reviewed by: jhb MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D11299
* Merge MAP_GUARD.kib2017-07-302-6/+45
| | | | | | | | MFC r316687 (by markj), r320314, r320317, r320338, r320339, r320344, r320430, r320560 (by alc), r320801, r320843, r321173, r321230. Tested by: pho Sponsored by: The FreeBSD Foundation
* MFC note: content changes of r317315 were reversed. .Dd is being updatedngie2017-07-191-1/+1
| | | | | | | | | | | | | | for diff reduction purposes. MFC r317315,r317437: r317315: Note that getpagesize(3) can return -1 on failure r317437 (by kib): getpagesize(3) cannot fail.
* MFC r318706:ngie2017-07-181-1/+2
| | | | localeconv(3): start sentences on new lines
* MFC r318712:ngie2017-07-181-1/+1
| | | | | | xdr(3): add missing comma after xdr_sizeof(3) in SYNOPSIS This unbreaks the .Nm declaration
* MFC r318703:ngie2017-07-181-1/+1
| | | | __iconv_get_list: separate .Nm entries with commas
* MFC r318707:ngie2017-07-181-2/+2
| | | | sctp_send(3): start sentences on new lines
* MFC r318704,r318708,r318709:ngie2017-07-183-4/+5
| | | | | | | | | | | | | | r318704: posix1e(3): reference using the section (3) when referencing libbsm with .Xr r318708: acl_create_entry(3): separate .Nm entries with commas in SYNOPSIS r318709: acl_to_text(3): start sentences on new lines
* MFC r318710:ngie2017-07-181-3/+3
| | | | quick_exit(3): delete trailing whitespace in licensing tort
* MFC r318718,r318719,r318720,r318721:ngie2017-07-184-17/+18
| | | | | | | | | | | | | | | | | | | | | | | r318718: rctl_add_rule(2): fix manlint warnings - Fix commas (either missing or misused) after .Nm entries in SYNOPSIS r318719: open(2): fix manlint warnings - Sort SEE ALSO .Xr entries. - Sort sections (HISTORY comes after STANDARDS). r318720: ptrace(2): clean up trailing whitespace r318721: kill(2): add missing section for sysctl(9)
* MFC r319048,r319049,r319051,r319054:ngie2017-07-183-35/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r319048: Push `snapshot_file` copying down into run_tests function, and mark snapshot_file const char *. This fixes a bogus set of errors from gcc about strdup not being allowed a NULL argument. r319049: Bump WARNS from 1 to 3 after recent commits to fix warnings in the directory. Tested with: clang 4.0, gcc 4.2.1, gcc 6.3.0 r319051: hostent_test_getnameinfo_eq(..): initialize found_a_host to false CID: 1368943 r319054: hostent_test_getaddrinfo_eq(..): call freeaddrinfo on `ai` when done This plugs a leak of memory allocated via getaddrinfo. CID: 1346866
* MFC r319842:ngie2017-07-181-2/+3
| | | | | | | | | getbsize(3): clarify that underflow/overflow warnings in regard to $BLOCKSIZE gets output via warnx(3) This helps set expectations for how one might deal with those messages, i.e., mute output from /dev/stderr today, since that's where vwarn(3) outputs messages to today.
* MFC r318695:ngie2017-07-181-4/+4
| | | | | | err(3): use `NULL`, aka `(void*)0` per POSIX instead of `(FILE *)0` This is being done to aid humans and static analysis checkers.
* MFC r318705:ngie2017-07-181-5/+10
| | | | | | | | fopen(3): make manlint fixes - Break on new lines. - Use .Dv with NULL. - Rewrap lines as necessary/when possible.
* MFC r320472,r320508,r320509:kib2017-07-1739-139/+191
| | | | | | Make stdio deferred cancel-safe. Requested by: eugen
* MFC r320570:kib2017-07-091-4/+5
| | | | Correct signatures of several pthreads stubs.
* MFC r320494: Fix double free by reverting r300385 and r300624 which wasdelphij2017-07-031-3/+1
| | | | false positive reported by cppcheck.
* MFC r320216: Fix use-after-free introduced in r300388.delphij2017-06-251-1/+2
| | | | | | | | | | | In r300388, endnetconfig() was called on nc_handle which would release the associated netconfig structure, which means tmpnconf->nc_netid would be a use-after-free. Solve this by doing endnetconfig() in return paths instead. Reported by: jemalloc via kevlo Reviewed by: cem, ngie (earlier version)
* MFC r320052:kib2017-06-241-21/+25
| | | | Do not leak syslog_mutex on cancellation.
* MFC 319490: Remove stale cap_rights_get(2) manpage.jhb2017-06-201-1/+0
| | | | | | | | The documentation moved to section 3 several years ago, but 'man cap_rights_get' pulls up cap_rights_limit(2) (which is MLINKed to cap_rights_get.2) instead of cap_rights_get(3). Approved by: re (gjb)
* MFC r319369:delphij2017-06-064-17/+47
| | | | | | | | | | | | | * limit size of buffers to RPC_MAXDATASIZE * don't leak memory * be more picky about bad parameters From: https://raw.githubusercontent.com/guidovranken/rpcbomb/master/libtirpc_patch.txt https://github.com/guidovranken/rpcbomb/blob/master/rpcbind_patch.txt via NetBSD.
* MFC r318450:kib2017-06-012-0/+103
| | | | | | Add tests for some cases in r318298. PR: 219154
* MFC r319086:kib2017-05-311-2/+5
| | | | Mention that the basep argument to getdirentries(2) can be NULL.
* MFC ↵ngie2017-05-319-97/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r319027,r319028,r319029,r319030,r319031,r319033,r319034,r319035,r319036,r319037,r319038,r319039,r319040,r319041,r319042,r319043,r319044,r319045,r319046: r319027: lib/libc/tests/nss: use calloc appropriately The pattern used prior to this commit was `calloc(1, n * sizeof(type))`; the pattern that should be used however is `calloc(n, sizeof(type))`. r319028: Sort make variables to suit style.Makefile(5) This is being done prior to functional changes. r319029: Staticize functions and remove unused variables to aid with bumping WARNS r319030: Fix -Wsign-compare warnings r319031: getusershell_test: staticize run_tests(..) to fix warnings r319033: getserv_test: fix -Wsign-compare and -Wmissing-prototypes warnings r319034: getaddrinfo_test: fix -Wsign-compare warnings r319035: getrpc_test: fix -Wmissing-prototypes and -Wsign-compare warnings r319036: getproto_test: fix -Wmissing-prototypes and -Wsign-compare warnings r319037: getaddrinfo_test: mark unused function parameters __unused to fix -Wunused warnings r319038: getusershell_test: mark mdata parameter in compare_usershell __unused r319039: getserv_test: mark unused parameters __unused to fix corresponding warnings r319040: getrpc_test: fix -Wunused warnings - Mark unused function parameters unused. - Remove an unused function prototype. r319041: getproto_test: fix -Wunused warnings Mark unused parameters __unused in functions. r319042: gethostby_test: fix multiple warning types - Fix -Wmissing-declaration warning by staticizing run_tests. - Fix -Wsign-compare warnings by casting size_t types to int for comparisons. Reindent some of the code in sdump_hostent(..) to accomodate the overall changes. r319043: getpw_test: fix -Wunused warnings - Mark unused parameters __unused. - Put dump_passwd under DEBUG as it's only used in that case. r319044: getgr_test: fix -Wunused warnings r319045: Fix -Wunused and -Wshadow warnings r319046: Fix a -Wunused-but-set-variable warning reported by gcc 6.3.0
* MFC r318514-r318515, r318517, r318917delphij2017-05-311-18/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r318514: Use size_t. Inspired by: OpenBSD src/lib/libc/stdlib/qsort.c,v 1.11 r318515: The current qsort(3) implementation ignores the sizes of partitions, and always perform recursion on the left partition, then use a tail call to handle the right partition. In the worst case this could require O(N) levels of recursions. Reduce the possible recursion level to log2(N) by always recursing on the smaller partition instead. Obtained from: PostgreSQL 9d6077abf9d6efd992a59f05ef5aba981ea32096 r318517: Sync qsort.c with userland r318515. (Note that MIN macro is removed in favor of sys/param.h's version). PR: 213922 r318917: Disconnect heimdal version of qsort.c from build because we are already using libc's version of qsort. PR: bin/213922
* Partial MFC r288030 (rodrigc):delphij2017-05-311-3/+1
| | | | Use ANSI C prototypes. Eliminates -Wold-style-definition warnings.
* MFC r279663,r279666 (pfg):delphij2017-05-311-22/+31
| | | | | | | | | | | | | | | | | | | | r279663: qsort(3): enhance to handle 32-bit aligned data on 64-bit systems Implement a small enhancement to the original qsort implementation: If the data is 32 bit aligned we can side-step the long type version and use int instead. The change brings a modest but significant improvement in 32 bit workloads. r279666: qsort(3): small style(9) cleanups. Basically spaces vs. tabs. No functional change.
* MFC r315272, r315370delphij2017-05-311-1/+13
| | | | | | | | | | | | | | | | | | | | | | | r315272: Implement INHERIT_ZERO for minherit(2). INHERIT_ZERO is an OpenBSD feature. When a page is marked as such, it would be zeroed upon fork(). This would be used in new arc4random(3) functions. PR: 182610 Reviewed by: kib (earlier version) Differential Revision: https://reviews.freebsd.org/D427 r315370: The adj_free and max_free values of new_entry will be calculated and assigned by subsequent vm_map_entry_link(), therefore, remove the pointless copying. Submitted by: alc
* MFC r315032-r315036, r315039, r315041asomers2017-05-302-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r315032: Increase WARNS for iconv tests ATF tests have a default WARNS of 0, unlike other usermode programs. Reviewed by: ngie Sponsored by: Spectra Logic Corporation Differential Revision: https://reviews.freebsd.org/D9933 r315033: Increase WARNS for nss tests ATF tests have a default WARNS of 0, unlike other usermode programs. Reviewed by: ngie Sponsored by: Spectra Logic Corporation Differential Revision: https://reviews.freebsd.org/D9933 r315034: Document that the msun tests require WARNS=0 ATF tests have a default WARNS of 0, unlike other usermode programs. This change is technically a noop, but it documents that the msun tests don't work with any warnings enabled, at least not on all architectures. Reviewed by: ngie Sponsored by: Spectra Logic Corporation Differential Revision: https://reviews.freebsd.org/D9933 r315035: Increase WARNS for libcrypt tests ATF tests have a default WARNS of 0, unlike other usermode programs. Reviewed by: ngie, julian Sponsored by: Spectra Logic Corporation Differential Revision: https://reviews.freebsd.org/D9933 r315036: Increase WARNS for libmp tests ATF tests have a default WARNS of 0, unlike other usermode programs. Reviewed by: ngie, julian Sponsored by: Spectra Logic Corporation Differential Revision: https://reviews.freebsd.org/D9933 r315039: Increase WARNS for libutil tests ATF tests have a default WARNS of 0, unlike other usermode programs. Reviewed by: ngie, julian Sponsored by: Spectra Logic Corporation Differential Revision: https://reviews.freebsd.org/D9933 r315041: Increase WARNS for pw tests ATF tests have a default WARNS of 0, unlike other usermode programs. Reviewed by: ngie, julian Sponsored by: Spectra Logic Corporation Differential Revision: https://reviews.freebsd.org/D9933
* MFC r318303:kib2017-05-291-9/+7
| | | | Style.
* MFC r318299:kib2017-05-291-44/+31
| | | | Simplify cleanup on failure in realpath(3).
* MFC r318298:kib2017-05-291-19/+27
| | | | | | Fix several buffer overflows in realpath(3), and other minor issues. PR: 219154
* MFC r317660, r317710brooks2017-05-151-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | r317660: Support clnt_raw's use of FD_SETSIZE as a fake file descriptor. Accomplish this by allocating space for it in __svc_xports and allowing it to be registered. The failure to allocate space was causing an out-of-bounds read in svc_getreq_common(). The failure to register caused PR 211804. The bug was found with CHERI bounds checking. PR: 211804 Obtained from: CheriBSD Sponsored by: DARPA, AFRL Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D10528 r317710: Remove expected failure now that it was fixed in r317660. PR: 211804 Reviewed by: ngie Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D10576
* MFC r317845-r317846brooks2017-05-151-2/+16
| | | | | | | | | | | | | | | | | | | | | | r317845: Provide a freebsd32 implementation of sigqueue() The previous misuse of sys_sigqueue() was sending random register or stack garbage to 64-bit targets. The freebsd32 implementation preserves the sival_int member of value when signaling a 64-bit process. Document the mixed ABI implementation of union sigval and the incompability of sival_ptr with pointer integrity schemes. Reviewed by: kib, wblock Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D10605 r317846: Regen post r317845. MFC with: r317845 Sponsored by: DARPA, AFRL
* MFC r306771:bdrewery2017-05-091-1/+1
| | | | Improve grammar.
* MFC r317707:brooks2017-05-091-0/+4
| | | | | | | | | | | | | | | | | | | Correct an out-of-bounds read in regcomp when the RE is bad. When passed the invalid regular expression "a**", the error is eventually detected and seterr() is called. It sets p->error appropriatly and p->next and p->end to nuls which is a never used char nuls[10] which is zeros due to .bss initialization. Unfortunatly, p_ere_exp() and p_simp_re() both have fall through cases where they set the error, decrement p->next and access it which means a read from whatever .bss variable comes before nuls. Found with regex_test:repet_multi and CHERI bounds checking. Reviewed by: ngie, pfg, emaste Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D10541
* MFC r317611:kib2017-05-071-5/+1
| | | | Make semaphore names list mutex non-recursive.
* MFC r317610:kib2017-05-071-12/+10
| | | | Restructure normal (non-error) control flow in sem_close().
* MFC r317606:kib2017-05-071-22/+24
| | | | Style.
* MFC r317436:kib2017-05-031-1/+1
| | | | getpagesize(3) cannot fail.
* MFC r317064: Optimize pathologic case of telldir() for Samba.mav2017-05-011-4/+14
| | | | | | | | | | When application reads large directory, calling telldir() for each entry, like Samba does, it creates exponential performance drop as number of entries reach tenths to hundreds of thousands. It is caused by full search through the internal list, that never finds matches in that scenario, but creates O(n^2) delays. This patch optimizes that search, limiting it to entries of the same buffer, turning time closer to O(n) in case of linear directory scan.
* MFC r316768:brooks2017-04-241-0/+4
| | | | | | | | | | Fix an out-of-bounds write when a zero-length buffer is passed. Found with ttyname_test and CHERI bounds checking. Reviewed by: emaste Obtained from: CheriBSD Sponsored by: DARPA, AFRL
* MFC r316739:kib2017-04-191-6/+3
| | | | Fix reporting of _SC_SEM_NSEMS_MAX and _SC_SEM_VALUE_MAX.
* MFC r315734:ngie2017-03-301-5/+5
| | | | style(9): sort #includes
* MFC r315187:pfg2017-03-161-1/+1
| | | | | | libc: mall cleanup. Let calloc(3) do the multiplication.
* MFC r314954:ngie2017-03-161-1/+1
| | | | style(9): sort the #includes
* MFC r315225:delphij2017-03-141-1/+1
| | | | | | | | Discard first 3072 bytes of RC4 keystream, this is a bandaid that allows us to work on switching to a more modern PRNG. Submitted by: Steven Chamberlain <steven pyro eu org> Approved by: so
* MFC r314807:ngie2017-03-131-1/+1
| | | | Move ATF_TC_WITHOUT_HEAD(getgrent) near the testcase it annotates
* MFC r314055vangyzen2017-03-101-58/+54
| | | | | | Make several improvements and corrections in the kenv(2) man page Sponsored by: Dell EMC
OpenPOWER on IntegriCloud