aboutsummaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* 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/8/; revision=362800
* 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/8/; revision=352835
* MFC r305284:Hans Petter Selasky2016-09-091-2/+13
| | | | | | | | | | Fix array size issue when using the pre-scaling feature for ISOCHRONOUS USB transfers. Make sure enough length and buffer pointers are allocated when setting up the libusb transfer structure to support the maximum number of frames the kernel can handle. Notes: svn path=/stable/8/; revision=305643
* MFC r301842:Hans Petter Selasky2016-06-291-2/+14
| | | | | | | | | | | Implement code to stop all USB endpoints before executing a USB device reset command, alternate setting command or set configuration command. Else LibUSB v1.0 will not re-open the endpoints which the kernel closes and the USB application might wait infinitely for transfers to complete. Notes: svn path=/stable/8/; revision=302274
* MFC r293856:Brooks Davis2016-01-221-1/+1
| | | | | | | | | | | | | | | Avoid reading pass the end of the source buffer when it is not NUL terminated. If this buffer is adjacent to an unmapped page or a version of C with bounds checked is used this may result in a crash. PR: 206178 Submitted by: Alexander Cherepanov <cherepan@mccme.ru> Requested by: danfe Notes: svn path=/stable/8/; revision=294538
* MFC r293855:Brooks Davis2016-01-221-1/+1
| | | | | | | | | | | | | | | Avoid reading pass the end of the source buffer when it is not NUL terminated. If this buffer is adjacent to an unmapped page or a version of C with bounds checked is used this may result in a crash. PR: 206177 Submitted by: Alexander Cherepanov <cherepan@mccme.ru> Requested by: danfe Notes: svn path=/stable/8/; revision=294537
* MFC r286515:Dimitry Andric2015-08-121-2/+2
| | | | | | | | | | In libm's exp2(3), avoid left-shifting a negative integer, which is undefined. Replace it with the intended value, in a defined way. Reviewed by: bde Notes: svn path=/stable/8/; revision=286688
* MFC: libsm/path.c is about to disappear in the merge of sendmail 8.15.2. ItGregory Neil Shapiro2015-07-111-1/+1
| | | | | | | is an empty file now so it is safe to remove before the merge. Notes: svn path=/stable/8/; revision=285368
* MFC r284237,r284277:Xin LI2015-06-241-3/+15
| | | | | | | file 5.23. Notes: svn path=/stable/8/; revision=284782
* MFC r284346:Dimitry Andric2015-06-201-12/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the following clang 3.7.0 warnings in lib/libfetch/http.c: lib/libfetch/http.c:1628:26: error: address of array 'purl->user' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion] aparams.user = purl->user ? ~~~~~~^~~~ ~ lib/libfetch/http.c:1630:30: error: address of array 'purl->pwd' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion] aparams.password = purl->pwd? ~~~~~~^~~~ lib/libfetch/http.c:1657:25: error: address of array 'url->user' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion] aparams.user = url->user ? ~~~~~^~~~ ~ lib/libfetch/http.c:1659:29: error: address of array 'url->pwd' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion] aparams.password = url->pwd ? ~~~~~^~~ ~ lib/libfetch/http.c:1669:25: error: address of array 'url->user' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion] aparams.user = url->user ? ~~~~~^~~~ ~ lib/libfetch/http.c:1671:29: error: address of array 'url->pwd' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion] aparams.password = url->pwd ? ~~~~~^~~ ~ Since url->user and url->pwd are arrays, they can never be NULL, so the checks can be removed. Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D2673 Notes: svn path=/stable/8/; revision=284643
* MFC r284229: Add support for '_' occurring at the beginning orHajimu UMEMOTO2015-06-181-3/+3
| | | | | | | | | | end of a name component. PR: 176093 Submitted by: landonf__at__bikemonkey.org Notes: svn path=/stable/8/; revision=284561
* MFC 281887:John Baldwin2015-06-023-3/+3
| | | | | | | | Reassign copyright statements on several files from Advanced Computing Technologies LLC to Hudson River Trading LLC. Notes: svn path=/stable/8/; revision=283927
* MFC 282417:John Baldwin2015-06-021-7/+19
| | | | | | | | | | | | | | | | | | | Various updates to the ftruncate(2) documentation: - Note that ftruncate(2) can operate on shared memory objects and cross reference shm_open(2). - Note that ftruncate(2) does not change the file position pointer (aka seek pointer) of the file descriptor. - ftruncate(2) will fail with EINVAL for all sorts of other fd types than just sockets, so instead note that it fails for all but regular files and shared memory objects. - Note that ftruncate(2) also appeared in 4.2BSD along with truncate(2). (Or at least the manpage for both appeared in 4.2, I did not check the kernel code itself to see if either predated 4.2.) PR: 199472 Notes: svn path=/stable/8/; revision=283916
* MFC 281170:John Baldwin2015-06-021-2/+2
| | | | | | | | | | vfork() first appeared in 3BSD which pre-dates 2.9BSD. Verified via the copy of 3BSD on disc 1 of "The CSRG Archives". PR: 198612 Notes: svn path=/stable/8/; revision=283912
* MFC: file 5.22.Xin LI2015-05-192-69/+203
| | | | Notes: svn path=/stable/8/; revision=283135
* MFC r278530:Bryan Drewery2015-04-031-0/+1
| | | | | | | | | | | When catopen(3) returns an error, it caches the result of that error from r202992. The refcount on the cache entry is not initialized, so any attempt to clean the cache will skip over this item since it likely has a >0 value. This change is currently a NOP. Notes: svn path=/stable/8/; revision=281035
* MFC r272291:Bryan Drewery2015-04-031-1/+3
| | | | | | | Document [EPERM] for UNIX sockets. Notes: svn path=/stable/8/; revision=281032
* MFC r278739:Xin LI2015-02-171-0/+17
| | | | | | | | | | | Disallow pattern spaces which would cause intermediate calculations to overflow size_t. Obtained from: DragonFly (2841837793bd095a82f477e9c370cfe6cfb3862c dillon) Security: CERT VU#695940 Notes: svn path=/stable/8/; revision=278912
* MFC r277245:Hans Petter Selasky2015-01-282-0/+8
| | | | | | | | Add more USB request definitions. The values are described in section 9.4.11 and 9.4.12 of the "Universal Serial Bus 3.0 Specification" Notes: svn path=/stable/8/; revision=277849
* MFC r275930:Xin LI2015-01-021-1/+3
| | | | | | | | | Plug a memory leak. Obtained from: DragonFlyBSD (commit 5119ece) Notes: svn path=/stable/8/; revision=276555
* Fix multiple vulnerabilities in file(1) and libmagic(3).Xin LI2014-12-101-1/+2
| | | | | | | | | | | | | Security: FreeBSD-SA-14:28.file Security: CVE-2014-3710, CVE-2014-8116, CVE-2014-8117 Fix BIND remote denial of service vulnerability. Security: FreeBSD-SA-14:29.bind Security: CVE-2014-8500 Notes: svn path=/stable/8/; revision=275669
* MFC r273837:Dimitry Andric2014-11-011-5/+5
| | | | | | | | | | | | Fix a clang 3.5 warning about abs(3) being given an argument of type quad_t in setusercontext(). While here, sanitize the clamping of the priority value, and use the correct type for the return value of login_getcapnum(). Reviewed by: kib Notes: svn path=/stable/8/; revision=273931
* MFH (r272280, r272281, r272348): allow use with null user and rhostDag-Erling Smørgrav2014-10-011-4/+8
| | | | | | | PR: 83099 193927 Notes: svn path=/stable/8/; revision=272353
* MFH (r271256, r271617): avoid segfault if PAM_RHOST nor PAM_TTY are unset.Dag-Erling Smørgrav2014-09-181-7/+10
| | | | | | | PR: 83099 Notes: svn path=/stable/8/; revision=271768
* MFC r270133:Hans Petter Selasky2014-08-271-0/+8
| | | | | | | Add more USB class codes. Notes: svn path=/stable/8/; revision=270716
* Fix cut/paste brain-o. Spell #endif correctly.Peter Wemm2014-08-071-1/+1
| | | | Notes: svn path=/stable/8/; revision=269684
* Like on stable/9 and later, don't redefine MALLOC_PRODUCTIONPeter Wemm2014-08-071-0/+2
| | | | Notes: svn path=/stable/8/; revision=269683
* MFC r227519, r227520:Xin LI2014-06-121-71/+62
| | | | | | | | | | | | | | | | | | | | | | r227519 (das) Sync the style, comments, and variable names of arc4random.c with OpenBSD's version (r1.22). No functional changes, as verified with md5. r227520 (das) Further reduce diffs with OpenBSD's arc4random. The main functional change here is to ensure that when a process forks after arc4random is seeded, the parent and child don't observe the same random sequence. OpenBSD's fix introduces some additional overhead in the form of a getpid() call. The only significant remaining difference between our arc4random and OpenBSD's is in how we seed the generator in arc4_stir(). Notes: svn path=/stable/8/; revision=267380
* MFC r266664:Hans Petter Selasky2014-06-041-0/+2
| | | | | | | | | | Add empty LIBUSB_CALL macro, to be compatible to the libusb 1.0-API from sourceforge. PR: usb/190204 Notes: svn path=/stable/8/; revision=267048
* MFC r265534:Peter Holm2014-05-231-5/+7
| | | | | | | | | | | msync(2) must return ENOMEM and not EINVAL when the address is outside the allowed range or when one or more pages are not mapped. This according to The Open Group Base Specifications Issue 7. Sponsored by: EMC / Isilon storage division Notes: svn path=/stable/8/; revision=266574
* MFC: r265238Christian Brueffer2014-05-161-8/+6
| | | | | | | | | | Properly free resources in case of error. CID: 1007032 Found with: Coverity Prevent(tm) Notes: svn path=/stable/8/; revision=266250
* MFC r265464:Xin LI2014-05-091-1/+1
| | | | | | | | | | | | | Sort .ALLSRC before concatenating files together. This makes sure that the file are always built the same. (Note that Header and Localstuff must appear first and in that order, the sorting does not affect as a coincident effect). Submitted by: sjg Notes: svn path=/stable/8/; revision=265759
* MFC: r264585Christian Brueffer2014-04-241-0/+1
| | | | | | | | | Add a missing break in the TCP case. Reviewed by: bms Notes: svn path=/stable/8/; revision=264872
* MFC r264344:Hans Petter Selasky2014-04-182-0/+5
| | | | | | | | Tune buffer sizes for SuperSpeed USB when using LibUSB v0.1 and v1.0 APIs to increase the maximum bandwidth limit. Notes: svn path=/stable/8/; revision=264639
* MFC r263778:Dimitry Andric2014-04-091-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a SUBDIR_PARALLEL option to bsd.subdir.mk, to allow make to process all the SUBDIR entries in parallel, instead of serially. Apply this option to a selected number of Makefiles, which can greatly speed up the build on multi-core machines, when using make -j. This can be extended to more Makefiles later on, whenever they are verified to work correctly with parallel building. I tested this on a 24-core machine, with make -j48 buildworld (N = 6): before stddev after stddev ======= ====== ======= ====== real time 1741.1 16.5 959.8 2.7 user time 12468.7 16.4 14393.0 16.8 sys time 1825.0 54.8 2110.6 22.8 (user+sys)/real 8.2 17.1 E.g. the build was approximately 45% faster in real time. On machines with less cores, or with lower -j settings, the speedup will not be as impressive. But at least you can now almost max out a machine with buildworld! Submitted by: jilles MFC r263833: Enable parallel building for gnu/usr.bin and usr.bin/clang too. Notes: svn path=/stable/8/; revision=264303
* MFC r263021:Bryan Drewery2014-03-191-0/+6
| | | | | | | Support Last-Modified behind proxies which return UTC instead of GMT. Notes: svn path=/stable/8/; revision=263327
* MFC: r253983-253984Erwin Lansing2014-03-037-6/+358
| | | | | | | | | | | | | MFV: r262443 Update BIND to 9.8.7 Note this is a commit straight to stable as BIND no longer exists in head. Sponsored by: DK Hostmaster A/S Notes: svn path=/stable/8/; revision=262707
* MFC: r262296Christian Brueffer2014-02-281-3/+3
| | | | | | | | | | Match the correct variable to the variable description. PR: 121173 Submitted by: Thomas Mueller <tmueller at sysgo.com> Notes: svn path=/stable/8/; revision=262590
* MFC 250691:John Baldwin2014-02-191-4/+7
| | | | | | | | Return one-based key so that user can check if the key is ever allocated in the first place. Notes: svn path=/stable/8/; revision=262221
* MFC r260315:Hans Petter Selasky2014-02-044-11/+66
| | | | | | | | | Implement two new libusb API functions. PR: usb/185454 Notes: svn path=/stable/8/; revision=261484
* MFC r261224:Hans Petter Selasky2014-02-041-7/+3
| | | | | | | | Comply to the official LibUSB v1.0 API: "It is legal to attempt to claim an already-claimed interface." Notes: svn path=/stable/8/; revision=261473
* MFC: Add new sendmail 8.14.8 fileGregory Neil Shapiro2014-02-021-1/+1
| | | | Notes: svn path=/stable/8/; revision=261378
* MFC r261075: Update EINVAL description.Sergey Kandaurov2014-01-301-2/+2
| | | | Notes: svn path=/stable/8/; revision=261282
* MFC r259921,259950:Sergey Kandaurov2014-01-142-1/+154
| | | | | | | Provide the manual page for aio_fsync(2). Notes: svn path=/stable/8/; revision=260625
* MFC r235128:Hans Petter Selasky2014-01-054-1/+28
| | | | | | | Add missing LibUSB 1.0 API function: libusb_get_string_descriptor(). Notes: svn path=/stable/8/; revision=260317
* MFC r259872:Sergey Kandaurov2014-01-021-5/+1
| | | | | | | | | The compile time constant limit on number of swap devices was removed in 5.2. As such, remove the EINVAL error saying so. Currently the vm.nswapdev sysctl just represents the number of added swap devices. Notes: svn path=/stable/8/; revision=260200
* MFC 253656: Enhance the description of NOTE_TRACK:John Baldwin2013-11-051-6/+11
| | | | | | | | | | | | | | | - NOTE_TRACK has never triggered a NOTE_TRACK event from the parent pid. If NOTE_FORK is set, the listener will get a NOTE_FORK event from the parent pid, but not a separate NOTE_TRACK event. - Explicitly note that the event added to monitor the child process preserves the fflags from the original event. - Move the description of NOTE_TRACKERR under NOTE_TRACK as it is not a bit for the user to set (which is what this list pupports to be). Also, explicitly note that if an error occurs, the NOTE_CHILD event will not be generated. Notes: svn path=/stable/8/; revision=257717
* MFC r255891:Xin LI2013-09-291-0/+3
| | | | | | | Import NetBSD readline.c,v 1.104: do not crash with add_history(NULL). Notes: svn path=/stable/8/; revision=255934
* MFC 236106:John Baldwin2013-09-091-1/+1
| | | | | | | | Passing NULL as a key casues a segfault when loading SSH 1 keys. Use an empty string instead. Notes: svn path=/stable/8/; revision=255423
* MFC 250421: posix_spawn_file_actions_adddup2(3): Document difference withJilles Tjoelker2013-08-251-2/+23
| | | | | | | | | | | dup2(). The ability to clear a file descriptor's close-on-exec flag via posix_spawn_file_actions_adddup2() is in fact proposed in Austin Group issue #411. Notes: svn path=/stable/8/; revision=254872