summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Update file(1) to new version with security update. [EN-18:02.file]gordon2018-03-071-3/+3
| | | | | | Approved by: so Security: FreeBSD-EN-18:02.file Security: CVE-2017-1000249
* - Switch releng/11.1 to -RELEASE.gjb2017-07-201-1/+1
| | | | | | | | - Add the anticipated 11.1-RELEASE date to UPDATING. - Set a static __FreeBSD_version. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation
* MFS 320866grehan2017-07-132-1/+46
| | | | | | | | | | | | MFC 313727, 317483 In addition, replace the missing caph routines with small helper functions (bhyverun.c) or an open-coded replacement (uart_emul.c) 313727 Capsicumize bhyve 317483 Allow CAP_MMAP_RW on memfd for PCI passthru Approved by: re (kib)
* MFC r320801 MFS r320887:kib2017-07-111-3/+5
| | | | | | Simplify language. Approved by: re (delphij)
* MFC r320570 MFS r320822:kib2017-07-091-4/+5
| | | | | | Correct signatures of several pthreads stubs. Approved by: re (gjb)
* Add MAP_GUARD and use it for stack grow area protection.kib2017-07-072-2/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Bump __FreeBSD_version. This is an MFS of stable/11 r320666. MFC r320317: Implement address space guards. MFC r320338: Remove stale part of the comment. MFC r320339: Correctly handle small MAP_STACK requests. MFC r320344: For now, allow mprotect(2) over the guards to succeed regardless of the requested protection. MFC r320430: Treat the addr argument for mmap(2) request without MAP_FIXED flag as a hint. MFC r320560 (by alc): Modify vm_map_growstack() to protect itself from the possibility of the gap entry in the vm map being smaller than the sysctl-derived stack guard size. Approved by: re (delphij)
* MF11 r320685: Update to ELF Tool Chain snapshot at r3561emaste2017-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | This update is primarily bug fixes in C++ symbol demangling, including: - rvalue reference - builtin type auto and decltype(auto) - revamped support for function return types - formatting fixes - omit void when its the only param - ref-qualifiers and others in function types - type qualifiers in pointer-to-member function types - incorrect handling regarding CV-qualifiers in function types - ref-qualifier found in nested-name - properly handle <name> ::= <substitute><template-args> - make sure that nested function name is not a substitute candidate - correctly handle expression in template args - skip unknown substitution abbreviations Also r320663 libelftc: bump version, tracking import in r320343 Approved by: re (gjb) Sponsored by: The FreeBSD Foundation
* MFS r320581: MFC r320494: Fix double free by reverting r300385 anddelphij2017-07-031-3/+1
| | | | | | r300624 which was false positive reported by cppcheck. Approved by: re (kib)
* MFC r320314:kib2017-06-271-4/+1
| | | | | | Remove the description of MAP_HASSEMAPHORE. Approved by: re (marius)
* MFC r320313:kib2017-06-271-1/+1
| | | | | | Fix typo. Approved by: re (marius)
* 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) Approved by: re (kib)
* MFC r320052:kib2017-06-241-21/+25
| | | | | | Do not leak syslog_mutex on cancellation. Approved by: re (marius)
* MFC r320206,r320207:bdrewery2017-06-231-8/+10
| | | | | | | | | | r320206: Follow-up r308602: Don't add missing headers to .depend.tables.h. r320207: Tweak r320206: Still create the TABLE but not the .depend entry for missing headers. Approved by: re (gjb)
* 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 r320035:kib2017-06-191-4/+5
| | | | | | | Move the description of kern.kq_calloutmax sysctl into a new paragraph for better presentation. Approved by: re (delphij)
* MFC r320034:kib2017-06-191-1/+2
| | | | | | Start a new sentence on the new line. Approved by: re (delphij)
* MFC r318765:allanjude2017-06-111-1/+7
| | | | | | Allow cpuset_{get,set}affinity in capabilities mode Approved by: re (marius)
* MFC r319473:dim2017-06-081-5/+6
| | | | | | | | | | | | | | | | | | | | For arm targets, place ABI at the end of the target triple For some reason, we have been inserting the ABI specification into the middle of the target triple, when building LLVM, like so: armv6-gnueabi-freebsd12.0 This is the wrong way around. LLVM even auto-canonicalizes it to: armv6--freebsd12.0-gnueabi Let's do this the right way in llvm.build.mk instead. While here, define a proper VENDOR macro which can be overridden easily. Approved by: re (gjb) Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D10846
* MFC r318816:trasz2017-06-065-5/+5
| | | | | | Don't end up manpage titles with a full stop. Approved by: re (marius)
* 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. Approved by: re (kib)
* MFC r318582vangyzen2017-06-015-19/+10
| | | | | | | | | | | Remove old spinlock_debug code from libc This no longer seems useful. Remove it. This was prompted by a "cast discards volatile qualifier" warning in libthr when WARNS=6. Sponsored by: Dell EMC
* MFC r318539 r318580 r318581 r318584 r318749 r318952 r318953 r318955vangyzen2017-06-0118-68/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libthr: fix warnings at WARNS=6 Fix warnings about the following when WARNS=6 (which I will commit soon): - casting away const - no previous 'extern' declaration for non-static variable - others as explained by #pragmas and comments - unused parameters libthr: disable thread-safety warnings These warnings don't make sense for code that implements the locking primitives. libthr: change CHECK_AND_INIT_RWLOCK to an inline function This was prompted by a compiler warning about 'ret' shadowing a local variable in the callers of the macro. libthr: Use CLI flags instead of pragmas to disable warnings People tweaking the build system or compilers tend to look into the Makefile and not into the source. Having some warning controls in the Makefile and some in the source code is surprising. Pragmas have the advantage that they leave the warnings enabled for more code, but that advantage isn't very relevant in these cases. libthr: fix warnings from GCC when WARNS=6 Fix warnings about: - redundant declarations - a local variable shadowing a global function (dlinfo) - an old-style function definition (with an empty parameter list) - a variable that is possibly used uninitialized libthr: prevent setcontext() from masking SIGTHR __thr_setcontext() mistakenly tested for the presence of SIGCANCEL in its local ucontext_t instead of the parameter. Therefore, if a thread calls setcontext() with a context whose signal mask contains SIGTHR (a.k.a. SIGCANCEL), that signal will be blocked, preventing the thread from being cancelled or suspended. Sponsored by: Dell EMC
* MFC r318450:kib2017-06-012-0/+103
| | | | | | Add tests for some cases in r318298. PR: 219154
* MFC r317730:tuexen2017-06-015-0/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for listen() call. MFC r317731: Add Socklent for handling args of type socklen_t. MFC r317732: Decode the third argument of socket(). MFC r317736: Add support for [gs]etsockopt(). MFC r317737: Decode the fourth argument of sendto and recvfrom call. MFC r317739: Add support for sendmsg() and recvmsg(). MFC r317747: Add support for socket option names related to the IPPROTO_SCTP level. MFC r317748: Add support for socket option names related to the IPPROTO_IPV6 level. MFC r317750: Add support for sctp_generic_sendmsg() and sctp_generic_recvmsg(). MFC r317789: Add support for socket option names related to the level IPPROTO_UDPLITE. MFC r318879: Improve the decoding of the third argument of the socket() call. Decoding of the third argument depends on the first one. For doing this, add a corresponding function to libsysdecode. Thanks to jhb@ for suggesting this.
* MFC r319157:ngie2017-06-011-1/+2
| | | | | | | | fma_test: mute a warning about unreachable code on amd64 by restructuring the #ifdef block to only handle the rest of the logic in the loop in the #else case. CID: 1346844
* MFC r319158:ngie2017-06-011-1/+1
| | | | | | | | logarithm_test: assert that feclearexcept succeeds This helps ensure that test preconditons are fulfilled. CID: 1346572
* MFC r319156,r319159:ngie2017-06-012-1/+2
| | | | | | | | | | | | | | | | | | r319156: :nvlist_unpack__duplicate_key : check the result of nvlist_pack(3) This fixes a potential NULL pointer dereference. CID: 1362051 r319159: :dnvlist_get_string__default_value: fix a bogus string comparison test Check actual_value vs "5", not "5" vs itself. CID: 1362021
* MFC r319086:kib2017-05-311-2/+5
| | | | Mention that the basep argument to getdirentries(2) can be NULL.
* MFC r317311,r317312,r319019:ngie2017-05-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | | r317311: Check for failures from getpagesize(3) Return errno on failure, similar to the open(2) call above it. CID: 1193753 r317312: Fix type for `pagesize` to match the return type for getpagesize(3) to fix the build Pointyhat to: ngie r319019: Remove getpagesize(3) error checking added in r317312 getpagesize(3) no longer fails as of r317436.
* MFC ↵ngie2017-05-319-98/+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 r304106:delphij2017-05-317-5/+196
| | | | | | | Add timingsafe_bcmp and timingsafe_memcmp. Obtained from: OpenBSD Reviewed by: trasz
* MFC r316649 (kan):delphij2017-05-311-1/+1
| | | | Add missing double quote to fix r316635 commit.
* 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
* MFC r316635:delphij2017-05-311-13/+3
| | | | | | Enable 16-bit longest_match for x86. This gives a ~2% improvement in compression tests.
* MFC r313695, r313760, r314769, r314863, r314865, r316125delphij2017-05-313-71/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r313695: MFV r313676: libpcap 1.8.1 r313760: MFV r313759: license change for a few headers (4 clause BSD to 3 clause BSD). X-MFC-with: r313695 r314769: Remove compatibility with old libpcap. Differential Revision: https://reviews.freebsd.org/D9606 r314863: Stop installing pcap-int.h, which is the internal interface for libpcap. Reference: https://github.com/the-tcpdump-group/libpcap/issues/560 PR: 217221 r314865: Bump __FreeBSD_version for removal of pcap-int.h. PR: 217221 r316125: MFV r316124: Fix build when WITHOUT_INET6. Reported by: Randy Westlund <rwestlun gmail com>
* 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 r315615:delphij2017-05-311-2/+2
| | | | Make space style consistent with earlier entries.
* MFC r312703:andrew2017-05-301-1/+1
| | | | | | Fix the error value we write in cerror. __error returns an int *, however we were writing a 64 bit value meaning the 32 bits after this would be trashed.
* MFC r306375,r307802:ngie2017-05-301-1/+2
| | | | | | | | | | | | | | | | | | r306375 (by emaste): Add a WITHOUT_DIALOG src.conf(5) knob It also turns off dependencies (bsdinstall, bsdconfig, dpv, tzsetup). r307802 (by bapt): Fix build of tzsetup when WITHOUT_DIALOG is set Hide dialog specific code behind HAVE_DIALOG. It allows to build a stripped down version (missing the dialog UI) but perfectly function tzsetup when world is built WITHOUT_DIALOG Reorganise a bit the code to limit the number of blocks under HAVE_DIALOG
* 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 r315698:ngie2017-05-281-1/+1
| | | | | | libkvm: bump WARNS to 6 after recent commits done to resolve warnings issues Tested with: make tinderbox; clang 4.0.0 (amd64), gcc 4.2.1/6.3.0 (amd64)
* MFC r316131:ngie2017-05-281-27/+27
| | | | | | | | | | | | | | | | | | | Fix up r316081 by using nitems(cam_errbuf) instead of sizeof(cam_errbuf) Part of my original reasoning as far as converting the snprintf calls was to permit switching over from char[] to wchar_t[] in the future, as well as futureproof in case cam_errbuf's size was ever changed. Unfortunately, my approach was bugged because it conflated the number of items with the size of the buffer, instead of the number of elements being a fixed size != 1 byte. Use nitems(..) instead which counts the quantity of items of a specific type, as opposed to an unqualified sizeof(..) (which assumes that the number of characters is equal to the buffer size). Noted by: cem
* MFC r317310,r317316:ngie2017-05-282-18/+15
| | | | | | | | | | | | | | | | | | r317310: Minor style(9) fixups Delete trailing whitespace and sort headers. Leave libgeom.h's placement alone, per reasoning in r317289. r317316: Minor style(9) fixups Delete trailing whitespace and sort headers. Leave libgeom.h's placement alone, per reasoning in r317289.
* MFC r319010:ngie2017-05-271-2/+2
| | | | | | | | Fix #if conditional added in r319008 I committed an earlier version of the file by accident This is a no-op on ^/head and ^/stable/11.
* MFC r319008:ngie2017-05-271-0/+5
| | | | | | | | | kvm_geterr_test: Compile out the portions that require kvm_open2(3) on systems that lack the libcall, based on __FreeBSD_version. kvm_open2(3) wasn't made available until r291406, which is in ^/stable/11, but not ^/stable/10. This makes some of kvm_geterr_test available for testing on ^/stable/10.
* MFC r316099:ngie2017-05-278-0/+533
| | | | | | | | | | | | | | | | | | | | | lib/libkvm: start adding basic tests for kvm(3) - kvm_close: add a testcase to verify support for errno = EINVAL / -1 (see D10065) when kd == NULL is provided to the libcall. - kvm_geterr: -- Add a negative testcase for kd == NULL returning "" (see D10022). -- Add two positive testcases: --- test the error case using kvm_write on a O_RDONLY descriptor. --- test the "no error" case using kvm_read(3) and kvm_nlist(3) as helper routines and by injecting a bogus error message via _kvm_err (an internal API) _kvm_err was used as there isn't a formalized way to clear the error output, and because kvm_nlist always returns ENOENT with the NULL terminator today. - kvm_open, kvm_open2: -- Add some basic negative tests for kvm_open(3) and kvm_open2(3). Testing positive cases with a specific `corefile`/`execfile`/`resolver` requires more work and would require user intervention today in order to reliably test this out.
* MFC r317288,r317289:ngie2017-05-271-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | r317288: libgeom(3): apply minor polish - Use .Dv when mentioning NULL per mdoc(7). - Reword `g_device_path`, `g_open_by_ident`, and `g_providername`'s descriptions so they're less wordy. - Fix a typo in `g_device_path` (can not -> cannot). Tested with: igor, make manlint r317289: libgeom(3): note that stdio.h is required when referencing gctl_dump(3) gctl_dump(3) is only exposed when stdio.h is #include'd first, per its addition in r112510. The reasoning noted for the conditional "exposure" of the function was to "limit #include pollution". This addresses an issue I found with the documentation when looking at bug 218809, which in turn addresses a -Wimplicit-function-declaration compiler warning in `tools/regression/geom_gpt/test.c` (it uses gctl_dump(3)).
* MFC r318794, r318795:gjb2017-05-272-4/+4
| | | | | | Update the "first appeared in" version in several manual pages. Sponsored by: The FreeBSD Foundation
OpenPOWER on IntegriCloud