summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* MFC r368207,368607:stable/10Martin Matuska2020-12-163-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MFC r368207: Update libarchive to 3.5.0 Relevant vendor changes: Issue #1258: add archive_read_support_filter_by_code() PR #1347: mtree digest reader support Issue #1381: skip hardlinks pointing to itself on extraction PR #1387: fix writing of cpio archives with hardlinks without file type PR #1388: fix rdev field in cpio format for device nodes PR #1389: completed support for UTF-8 encoding conversion PR #1405: more formats in archive_read_support_format_by_code() PR #1408: fix uninitialized size in rar5_read_data PR #1409: system extended attribute support PR #1435: support for decompression of symbolic links in zipx archives Issue #1456: memory leak after unsuccessful archive_write_open_filename MFC r368607: Sync libarchive with vendor. Vendor changes: Issue #1461: Unbreak build without lzma Issue #1462: warc reader: Fix build with gcc11 Issue #1463: Fix code compatibility in test_archive_read_support.c Issue #1464: Use built-in strnlen on platforms where not available Issue #1465: warc reader: fix undefined behaviour in deconst() function Notes: svn path=/stable/10/; revision=368708
* MFC r362623:Dimitry Andric2020-06-301-2/+2
| | | | | | | | | | | Fix copy/paste mistake in kvm_getswapinfo(3) It seems this manpage was copied from kvm_getloadavg(3), but the DIAGNOSTICS section was not updated completely. Update the section with correct information about a return value of -1. Notes: svn path=/stable/10/; revision=362800
* MFC r361977: libusb: improve compatibilityKyle Evans2020-06-164-1/+61
| | | | | | | | | | | | | | | Specifically, add LIBUSB_CLASS_PHYSICAL and the libusb_has_capability API. Descriptions and functionality for these derived from the documentation at [0]. The current set of capabilities are all supported by libusb. These were detected as missing after updating net/freerdp to 2.1.1, which attempted to use both. [0] http://libusb.sourceforge.net/api-1.0/group__libusb__misc.html Notes: svn path=/stable/10/; revision=362224
* MFC r361294:Martin Matuska2020-06-121-1/+5
| | | | | | | | | | | | | | | | Update libarchive to 3.4.3 Relevant vendor changes: PR #1352: support negative zstd compression levels PR #1359: improve zstd version checking PR #1348: support RHT.security.selinux from GNU tar PR #1357: support for archives compressed with pzstd PR #1367: fix issues in acl tests PR #1372: child handling cleanup PR #1378: fix memory leak from passphrase callback Notes: svn path=/stable/10/; revision=362134
* MFC r361827:Hans Petter Selasky2020-06-081-16/+18
| | | | | | | | | | | | | | | | | | USB HID descriptors may push/pop the current state to allow description of items residing in a so-called union. FreeBSD currently only supports 4 such push levels. If the push level is not restored within the processing of the same HID item, an invalid memory location may be used for subsequent HID item processing. Verify that the push level is always valid when processing HID items. Reported by: Andy Nguyen (Google) Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=361921
* MFC r358841:Hans Petter Selasky2020-03-131-0/+7
| | | | | | | | | Fix for building libusb under Linux. Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=358949
* MFC r356212,r356366,r356416,r357785Martin Matuska2020-02-191-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update libarchive to version 3.4.2 Relevant vendor changes (r356212): Issue #351: Refactor and implement private state logic for write filters PR #1252: RAR5 reader - verify window size for solid files (OSS-Fuzz 15482) PR #1255: zip writer - don't append unused NUL for directories PR #1260: Fix sparse file offset overflow on 32-bit systems PR #1263: UNICODE filename support for reading lha/lzh format Issue #1276: Bugfix and optimize archive_wstring_append_from_mbs() PR #1288: Add the "xattrhdr" option to pax write options PR #1295: 7z reader - fix reading archives with digests in PackInfo PR #1296: RAR5 reader - verify window size for multivolume archives PR #1297: ZIP reader - support LZMA_STREAM_END marker in 'lzma alone' files Issue #1298: Fix a heap-buffer-overflow in archive_string_append_from_wcs() OSS-Fuzz 19360, 19362: LHA reader - plug two memory leaks on error Fix possible off-by-one when dealing with readlink(2) Relevant vendor changes (r356366): Issue #1302: Plug memory leak on failure of archive_write_client_open() Relevant vendor changes (r356416): Issue #1302: Re-do fix for archive_write_client_open() Relevant vendor changes (r357785): PR #1289: atomic extraction support (bsdtar -x --safe-writes) PR #1308: big endian fix for UTF16 support in LHA reader PR #1326: reject RAR5 files that declare invalid header flags Issue #987: fix support 7z archive entries with Delta filter Issue #1317: fix compression output buffer handling in XAR writer Issue #1319: fix uname or gname longer than 32 characters in pax writer Issue #1325: fix use after free when archiving hardlinks in ISO9660 or XAR Use localtime_r() and gmtime_r() instead of localtime() and gmtime() Notes: svn path=/stable/10/; revision=358090
* MFC r357212: libfetch: fix urldecode buffer overrunEd Maste2020-02-051-2/+8
| | | | | | | | Reported by: Duncan Overbruck Security: CVE-2020-7450 Notes: svn path=/stable/10/; revision=357582
* MFC r357298:Hans Petter Selasky2020-02-031-1/+3
| | | | | | | | | | | | | Add missing mutex unlock in failure case. Differential Revision: https://reviews.freebsd.org/D23430 Submitted by: cem Reported by: Coverity Coverity CID: 1368773 Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=357439
* MFC r356136:Hans Petter Selasky2020-01-066-2/+73
| | | | | | | | | | | Implement new libusb v2.0 API function, libusb20_dev_get_stats(). This function is useful when debugging USB device issues. Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=356399
* r355120 | dim | 2019-11-26 23:01:09 +0100 (Tue, 26 Nov 2019) | 32 linesDimitry Andric2019-12-042-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fdlibm hypot() implementations shouldn't potentially left-shift negative numbers (invoking undefined behavior) Summary: Various paths through hypot(x, y) will multiply x and y by a power of two, perform the calculation in a range where IEEE-754 provides greater precision, then undo the multiplication to determine the true result. Undoing that multiplication is implemented as t1*w, where t1=2**k. 2**k is often computed by taking the high word of 1.0, then adding k<<20 (for doubles or long doubles) or k<<23 (for floats) to it, then overwriting that high word. But when k is negative this left-shifts a negative value -- and that's undefined behavior in many editions of C and C++. This patch should fix all hypot implementations to compute 2**k without triggering this particular bit of undefined behavior. Test Plan: I've only very lightly tested out the hypot(double, double) change, in SpiderMonkey's JavaScript engine, for consistency with prior behavior. The other functions' changes have more or less only been eyeballed. Careful examination appreciated! Do note, however, that an error in any of these changes would most likely produce a value that is incorrect by a factor of two, so any mistake would most likely be glaring if invoked. Submitted by: Jeff Walden <jwalden@mit.edu> Obtained from: https://github.com/freebsd/freebsd/pull/414 Reviewed by: dim, lwhsu Differential Revision: https://reviews.freebsd.org/D22354 Notes: svn path=/stable/10/; revision=355395
* MFC r354255:Dimitry Andric2019-11-103-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add __isnan()/__isnanf() aliases for compatibility with glibc and CUDA Even though clang comes with a number of internal CUDA wrapper headers, compiling sample CUDA programs will result in errors similar to: In file included from <built-in>:1: In file included from /usr/lib/clang/9.0.0/include/__clang_cuda_runtime_wrapper.h:204: /usr/home/arr/cuda/var/cuda-repo-10-0-local-10.0.130-410.48/usr/local/cuda-10.0//include/crt/math_functions.hpp:2910:7: error: no matching function for call to '__isnan' if (__isnan(a)) { ^~~~~~~ /usr/lib/clang/9.0.0/include/__clang_cuda_device_functions.h:460:16: note: candidate function not viable: call to __device__ function from __host__ function __DEVICE__ int __isnan(double __a) { return __nv_isnand(__a); } ^ CUDA expects __isnan() and __isnanf() declarations to be available, which are glibc specific extensions, equivalent to the regular isnan() and isnanf(). To provide these, define __isnan() and __isnanf() as aliases of the already existing static inline functions __inline_isnan() and __inline_isnanf() from math.h. Reported by: arrowd PR: 241550 Notes: svn path=/stable/10/; revision=354596
* MFC r352710:Dimitry Andric2019-09-284-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not left-shift a negative number (inducing undefined behavior in C/C++) in exp(3), expf(3), expm1(3) and expm1f(3) during intermediate computations that compute the IEEE-754 bit pattern for |2**k| for integer |k|. The implementations of exp(3), expf(3), expm1(3) and expm1f(3) need to compute IEEE-754 bit patterns for 2**k in certain places. (k is an integer and 2**k is exactly representable in IEEE-754.) Currently they do things like 0x3FF0'0000+(k<<20), which is to say they take the bit pattern representing 1 and then add directly to the exponent field to get the desired power of two. This is fine when k is non-negative. But when k<0 (and certain classes of input trigger this), this left-shifts a negative number -- an operation with undefined behavior in C and C++. The desired semantics can be achieved by instead adding the possibly-negative k to the IEEE-754 exponent bias to get the desired exponent field, _then_ shifting that into its proper overall position. (Note that in case of s_expm1.c and s_expm1f.c, there are SET_HIGH_WORD and SET_FLOAT_WORD uses further down in each of these files that perform shift operations involving k, but by these points k's range has been restricted to 2 < k <= 56, and the shift operations under those circumstances can't do anything that would be UB.) Submitted by: Jeff Walden, https://github.com/jswalden Obtained from: https://github.com/freebsd/freebsd/pull/411 Obtained from: https://github.com/freebsd/freebsd/pull/412 Notes: svn path=/stable/10/; revision=352835
* MFC r349527,349538:Martin Matuska2019-07-111-0/+1
| | | | | | | | | | | | Sync libarchive with vendor. Relevant vendor changes: PR #1217: RAR5 reader - fix ARM filter going beyond window buffer boundary (OSS-Fuzz 15431) PR #1218: Fixes to sparse file handling Notes: svn path=/stable/10/; revision=349901
* MFC r349409 and r349410:Hans Petter Selasky2019-07-032-13/+26
| | | | | | | | | | | | Fix support for LIBUSB_HOTPLUG_ENUMERATE in libusb. Currently all devices are enumerated regardless of of the LIBUSB_HOTPLUG_ENUMERATE flag. Make sure when the flag is not specified no arrival events are generated for currently enumerated devices. Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=349669
* MFC r348993,349135:Martin Matuska2019-06-282-0/+3
| | | | | | | | | | | | | | | | | | Sync libarchive with vendor including security fixes r348993: - version bumped to 3.4.0 - check_symlinks_fsobj() without chdir() and fchdir() - bsdtar.1 manpage fixes - patches from OpenBSD to libarchive_fe/passphrase.c r349135: PR #1212: RAR5 reader - window_mask was not updated correctly (OSS-Fuzz 15278) OSS-Fuzz 15120: RAR reader - extend use after free bugfix Notes: svn path=/stable/10/; revision=349525
* MFC r348797:Hans Petter Selasky2019-06-111-0/+8
| | | | | | | | | | | | Fix for reading the configuration descriptor in libusb. Catch invalid configuration descriptor reads early on to avoid issues with devices that don't check for a valid USB configuration read request. Submitted by: takahiro.kurosawa@gmail.com PR: 238412 Notes: svn path=/stable/10/; revision=348895
* MFC r347990:Martin Matuska2019-06-042-5/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sync libarchive with vendor. Relevant vendor changes: Issue #795: XAR - do not try to add xattrs without an allocated name PR #812: non-recursive option for extract and list PR #958: support reading metadata from compressed files PR #999: add --exclude-vcs option to bsdtar Issue #1062: treat empty archives with a GNU volume header as valid PR #1074: Handle ZIP files with trailing 0s in the extra fields (Android APK archives) PR #1109: Ignore padding in Zip extra field data (Android APK archives) PR #1167: fix problems related to unreadable directories Issue #1168: fix handling of strtol() and strtoul() PR #1172: RAR5 - fix invalid window buffer read in E8E9 filter PR #1174: ZIP reader - fix of MSZIP signature parsing PR #1175: gzip filter - fix reading files larger than 4GB from memory PR #1177: gzip filter - fix memory leak with repeated header reads PR #1180: ZIP reader - add support for Info-ZIP Unicode Path Extra Field PR #1181: RAR5 - fix merge_block() recursion (OSS-Fuzz 12999, 13029, 13144, 13478, 13490) PR #1183: fix memory leak when decompressing ZIP files with LZMA PR #1184: fix RAR5 OSS-Fuzz issues 12466, 14490, 14491, 12817 OSS-Fuzz 12466: RAR5 - fix buffer overflow when parsing huffman tables OSS-Fuzz 14490, 14491: RAR5 - fix bad shift-left operations OSS-Fuzz 12817: RAR5 - handle a case with truncated huffman tables PR #1186: RAR5 - fix invalid type used for dictionary size mask (OSS-Fuzz 14537) PR #1187: RAR5 - fix integer overflow (OSS-Fuzz 14555) PR #1190: RAR5 - RAR5 don't try to unpack entries marked as directories (OSS-Fuzz 14574) PR #1196: RAR5 - fix a potential SIGSEGV on 32-bit builds OSS-Fuzz 2582: RAR - fix use after free if there is an invalid entry OSS-Fuzz 14331: RAR5 - fix maximum owner name length OSS-Fuzz 13965: RAR5 - use unsigned int for volume number + range check Additional RAR5 reader changes: - support symlinks, hardlinks, file owner, file group, versioned files - change ARCHIVE_FORMAT_RAR_V5 to 0x100000 - set correct mode for readonly directories - support readonly, hidden and system Windows file attributes MFC r347999: Install missing data file for lib.libarchive.functional_test.test_read_format_zip_utf8_paths Notes: svn path=/stable/10/; revision=348608
* MF11 r347561.David E. O'Brien2019-05-141-0/+2
| | | | | | | MFC r344085: Note that readpassphrase() came into FreeBSD's libc at 4.6. Notes: svn path=/stable/10/; revision=347562
* MFC r347234:Cy Schubert2019-05-101-1/+3
| | | | | | | | Improve the legibility of the login.access.5 man page by separating each argument into its own paragraph. Notes: svn path=/stable/10/; revision=347420
* MFC r345497:Martin Matuska2019-04-101-0/+3
| | | | | | | | | | | | | | | | Sync libarchive with vendor. Relevant vendor changes: PR #1153: fixed 2 bugs in ZIP reader [1] PR #1143: ensure archive_read_disk_entry_from_file() uses ARCHIVE_READ_DISK Changes to file flags code, support more file flags on FreeBSD: UF_OFFLINE, UF_READONLY, UF_SPARSE, UF_REPARSE, UF_SYSTEM UF_ARCHIVE is not supported by intention (yet) PR: 236300 [1] Notes: svn path=/stable/10/; revision=346105
* MFC r344795:Hans Petter Selasky2019-03-261-2/+2
| | | | | | | | | | Fix typos in libusb. Found by: Denis Ahrens <denis@h3q.com> Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=345541
* MFC r344063,r344088:Martin Matuska2019-02-282-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | MFC r344063: Sync libarchive with vendor. Relevant vendor changes: PR #1085: Fix a null pointer dereference bug in zip writer PR #1110: ZIP reader added support for XZ, LZMA, PPMD8 and BZIP2 decopmpression PR #1116: Add support for 64-bit ar format PR #1120: Fix a 7zip crash [1] and a ISO9660 infinite loop [2] PR #1125: RAR5 reader - fix an invalid read and a memory leak PR #1131: POSIX reader - do not fail when tree_current_lstat() fails due to ENOENT [3] PR #1134: Delete unnecessary null pointer checks before calls of free() OSS-Fuzz 10843: Force intermediate to uint64_t to make UBSAN happy. OSS-Fuzz 11011: Avoid buffer overflow in rar5 reader MFC r344088: archive_read_disk_posix.c: initialize delayed_errno PR: 233006 [3] Security: CVE-2019-1000019 [1], CVE-2019-1000020 [2] Notes: svn path=/stable/10/; revision=344674
* MFC r343572:Hans Petter Selasky2019-02-081-0/+18
| | | | | | | | | | | | Add support for Audio Sink and Audio Source profiles to sdpd(8). This allows user-space programs like virtual_oss(8) to act as a Bluetooth speaker device. Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=343902
* MFC: 325765 (imp) Add notes about overlapping copies.Rodney W. Grimes2019-01-223-0/+25
| | | | | | | | | | | | | | Add notes to each of these that specifically state that results are undefined if the strings overlap. In the case of memcpy, we document the overlapping behavior on FreeBSD (pre-existing). For str*, it is left unspecified, however, since the default (and x86) implementations do not handle overlapping strings properly. PR: 223653 Approved by: phk (mentor) Notes: svn path=/stable/10/; revision=343326
* MFC r343023:Pedro F. Giffuni2019-01-212-10/+12
| | | | | | | | | msun: reduce diff between src/e_j0.c and src/e_j0f.c PR: 229501 Notes: svn path=/stable/10/; revision=343258
* MFC r339746,339751,339794,340866,340939,342042:Martin Matuska2018-12-212-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sync libarchive with vendor. Relevant vendor changes: PR #1013: Add missing h_base offset when performing absolute seeks in xar decompression PR #1023: Support extracting extattrs as non-root on non-user-writeable files PR #1061: Add support for extraction of RAR v5 archives PR #1066: Fix out of bounds read on empty string filename for gnutar, pax and v7tar PR #1067: Fix temporary file path buffer overflow in tests IS #1068: Correctly process and verify integer arguments passed to bsdcpio and bsdtar PR #1070: Don't default XAR entry atime/mtime to the current time PR #1080: Spelling fixes PR #1084: RAR5 reader bugfixes PR #1091: fix use-after-free in delayed newc link processing PR #1092: Fix a few obvious resource leaks and strcpy() misuses IS #1096: Support extracting ACLs with in-entry comments (GNU tar) PR #1102: RAR5 reader - fix big-endian problems PR #1105: Fix various crash, memory corruption and infinite loop conditions RAR5 reader: FreeBSD build platform fixes for powerpc(64), mips(64), sparc64 and riscv64 RAR5 reader: more maybe-uninitialized size_t fixes for riscv64 FreeBSD build Notes: svn path=/stable/10/; revision=342361
* MFC r338993:Hans Petter Selasky2018-10-051-0/+6
| | | | | | | | | | | | | | When multiple threads are involved receiving completion events in LibUSB make sure there is always a master polling thread, by setting the "ctx_handler" field in the context. Else the reception of completion events can stop. This happens if event threads are created and destroyed during runtime. Found by: Ludovic Rousseau <ludovic.rousseau+freebsd@gmail.com> PR: 231742 Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=339190
* MFC r338679:Hans Petter Selasky2018-09-192-19/+36
| | | | | | | | | | | | | Improve LibUSB debugging by simultaneously allowing both function and transfer prints. Make sure the debug level comes from the correct USB context. Found by: Ludovic Rousseau <ludovic.rousseau+freebsd@gmail.com> PR: 231264 Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=338792
* MFC r338616:Hans Petter Selasky2018-09-193-43/+91
| | | | | | | | | | | | | | | | | Fix issues about cancelling USB transfers in LibUSB when the USB device has been detached. When a USB device has been detached the kernel file handle stops responding to commands. USB applications which continue to run after the USB device has been detached, depend on LibUSB generated events to tear down its pending USB transfers. Add code to handle the needed cleanup when processing the USB transfer(s) fails and prevent new USB transfer(s) from being submitted. Found by: Ludovic Rousseau <ludovic.rousseau+freebsd@gmail.com> PR: 231076 Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=338789
* Load filesystem modules associated with allow.mount permissions.Jamie Gritton2018-08-151-1/+12
| | | | | | | PR: 192092 Notes: svn path=/stable/10/; revision=337880
* MFC r331332:Jamie Gritton2018-08-151-0/+32
| | | | | | | | | If a jail parameter isn't found, try loading a related kernel module. PR: 192092 Notes: svn path=/stable/10/; revision=337876
* MFC r321333:Bryan Drewery2018-08-081-1/+1
| | | | | | | Properly set userid for truncate_test. Notes: svn path=/stable/10/; revision=337491
* MFC r334547:Alan Somers2018-08-031-1/+16
| | | | | | | | | | | | | pty.3: Add a HISTORY section These functions were first added in 4.3 BSD-Reno, according to http://unix.superglobalmegacorp.com/ and the CSRG svn repository. Reviewed by: bcr, bjk Differential Revision: https://reviews.freebsd.org/D15652 Notes: svn path=/stable/10/; revision=337254
* MFC r328266:Alan Somers2018-08-031-3/+3
| | | | | | | | | | | | | | | | mlock(2): correct documentation for error conditions. The man page is years out of date regarding errors. Our implementation _does_ allow unaligned addresses, and it _does_not_ check for negative lengths, because the length is unsigned. It checks for overflow instead. Update the tests accordingly. Reviewed by: bcr Differential Revision: https://reviews.freebsd.org/D13826 Notes: svn path=/stable/10/; revision=337244
* MFC r335669:Hans Petter Selasky2018-07-301-9/+12
| | | | | | | | | | | Improve the userspace USB string reading function in LibUSB. Some USB devices does not allow a partial descriptor readout. Found by: bz @ Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=336884
* MFC r336115;Pedro F. Giffuni2018-07-161-2/+2
| | | | | | | | | | | | | | libiconv: correct undefined behavior. Detected on NetBSD: # nm /usr/lib/libc.so|grep sanit /public/src.git/lib/libc/citrus/modules/citrus_mapper_std.c:173:8: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' Obtained from: NetBSD (CVS Rev. 1.11) Notes: svn path=/stable/10/; revision=336324
* MFC r335921:Jamie Gritton2018-07-061-8/+35
| | | | | | | | | | | | | Allow jail names (not just IDs) to be specified for: cpuset(1), ipfw(8), sockstat(1), ugidfw(8) These are the last of the jail-aware userland utilities that didn't work with names. PR: 229266 Differential Revision: D16047 Notes: svn path=/stable/10/; revision=336039
* MFC r306098 (br): Use kqueue(2) instead of select(2).Ed Maste2018-07-041-5/+18
| | | | | | | | | This helps to ensure we will not lose SIGINT sent by parent to child. PR: 212562, 228492 Notes: svn path=/stable/10/; revision=335965
* MFC r327317:Bartek Rutkowski2018-07-033-287/+290
| | | | | | | | | | | | | | | | | | | | | humanize_number(3): fix math edge case in rounding large numbers Fix for remainder overflow, when in rare cases adding remainder to divider exceeded 1 and turned the total to 1000 in final formatting, taking up the space for the unit character. The fix continues the division of the original number if the above case happens -- added the appropriate check to the for loop performing the division. This lowers the value shown, to make it fit into the buffer space provided (1.0M for 4+1 character buffer, as used by ls). Add test case for the reported bug and extend test program to support providing buffer length (ls -lh uses 5, tests hard-coded 4). PR: 224498 Notes: svn path=/stable/10/; revision=335891
* dpv(3): MFC r330943, r335264Devin Teske2018-06-203-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | r330943: Fix bad error messages from dpv(3) Before = dpv: <__func__>: posix_spawnp(3): No such file or directory After = dpv: <path/cmd>: No such file or directory Most notably, show the 2nd argument being passed to posix_spawnp(3) so we know what path/cmd failed. Also, we don't need to have "posix_spawnp(3)" in the error message nor the function because that can [a] change and [b] traversed using a debugger if necessary. r335264: Fix comparison between pointer and char literal PR: misc/204252 Reported by: David Binderman <dcb314@hotmail.com> Sponsored by: Smule, Inc. Notes: svn path=/stable/10/; revision=335407
* MFC r292268, r334176Brooks Davis2018-05-315-10/+20
| | | | | | | | | | | | | | | | | | | | | | r292268: Remove sys/types.h due to STANDARDS and unistd.h also includes sys/types.h. r334176: Indicate the brk/sbrk are deprecated and not portable. More firmly suggest mmap(2) instead. Include the history of arm64 and riscv shipping without brk/sbrk. Mention that sbrk(0) produces unreliable results. Reviewed by: emaste, Marcin Cieślak Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D15535 Notes: svn path=/stable/10/; revision=334440
* MFC 331324: Ensure thread library is initialized in pthread_testcancel().John Baldwin2018-04-161-1/+3
| | | | | | | | | | | | | | | Call _thr_check_init() before reading curthread in pthread_testcancel(). If a constructor in a library creates a semaphore via sem_init() and then waits for it via sem_wait(), the program can core dump in _pthread_testcancel() called from sem_wait(). This is because the semaphore implementation lives in libc, so the library's constructors can be run before libthr's constructors. Sponsored by: DARPA / AFRL Notes: svn path=/stable/10/; revision=332633
* MFC r322665Sevan Janiyan2018-03-251-1/+8
| | | | | | | | Add caveat to kinfo_getvmmap(3) explaining high CPU utilisation. Based on kib's reply on https://lists.freebsd.org/pipermail/freebsd-hackers/2016-July/049710.html Notes: svn path=/stable/10/; revision=331517
* MFC: r328834Marius Strobl2018-03-191-5/+3
| | | | | | | | | | | | | | | | | | o Let rtld(1) set up psABI user trap handlers prior to executing the objects' init functions instead of doing the setup via a constructor in libc as the init functions may already depend on these handlers to be in place. This gets us rid of: - the undefined order in which libc constructors as __guard_setup() and jemalloc_constructor() are executed WRT __sparc_utrap_setup(), - the requirement to link libc last so __sparc_utrap_setup() gets called prior to constructors in other libraries (see r122883). For static binaries, crt1.o still sets up the user trap handlers. o Move misplaced prototypes for MD functions in to the MD prototype section of rtld.h. o Sprinkle nitems(). Notes: svn path=/stable/10/; revision=331206
* MFC r330409:Brooks Davis2018-03-123-30/+36
| | | | | | | | | | | | | | | Refer to SysV IPC permissions as numeric constants. POSIX defines no macros for these permissions. Also remove unneeded headers from synopsis. PR: 225905 Reviewed by: wblock Differential Revision: https://reviews.freebsd.org/D14461 Notes: svn path=/stable/10/; revision=330801
* MFC 328630:John Baldwin2018-02-281-5/+10
| | | | | | | Clarify that the additional arguments to makecontext() are of type int. Notes: svn path=/stable/10/; revision=330133
* MFC r329848:Pedro F. Giffuni2018-02-281-2/+2
| | | | | | | | | | | | __printf_render_int(): small type change to match use. Variable l is consistently used as an int rather than a char. Sort names while here. Obtained from: Apple's Libc-1244.30.3 Notes: svn path=/stable/10/; revision=330097
* MFC r329846:Pedro F. Giffuni2018-02-281-2/+4
| | | | | | | | | | | | | getpeereid(3): Fix behavior on failure to match documentation. According to the getpeereid(3) documentation, on failure the value -1 is returned and the global variable errno is set to indicate the error. We were returning the error instead. Obtained from: Apple's Libc-1244.30.3 Notes: svn path=/stable/10/; revision=330095
* MFC of 328304 and 328382.Kirk McKusick2018-02-062-2/+19
| | | | | | | Do not dedup egid (group entry 0) Notes: svn path=/stable/10/; revision=328943