summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Deduplicate fsid comparisonsRyan Moeller2020-05-211-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Comparing fsid_t objects requires internal knowledge of the fsid structure and yet this is duplicated across a number of places in the code. Simplify by creating a fsidcmp function (macro). Reviewed by: mjg, rmacklem Approved by: mav (mentor) MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D24749 Notes: svn path=/head/; revision=361313
* | | Change the samantic of struct link_map l_addr member.Konstantin Belousov2020-05-201-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It previously returned the object map base address, while all other ELF operating systems return load offset, i.e. the difference between map base and the link base. Explain the meaning of the field in the man page. Stop filling the mips-only l_offs member, which is apparently unused. PR: 246561 Requested by: Damjan Jovanovic <damjan.jov@gmail.com> Reviewed by: emaste, jhb, cem (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24918 Notes: svn path=/head/; revision=361303
* | | MFV r361280:Martin Matuska2020-05-201-2/+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=/head/; revision=361294
* | | Fix a typo: argments -> argumentsBenedict Reuschling2020-05-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | PR: 243294 Submitted by: Igor Ostapenko MFC after: 5 days Notes: svn path=/head/; revision=361249
* | | procctl(2): correct a minor cut-n-pastoKyle Evans2020-05-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is clearly describing PROC_PROTMAX_FORCE_DISABLE, rather than PROC_ASL_FORCE_DISABLE. Submitted by: sigsys@gmail.com Notes: svn path=/head/; revision=361105
* | | libalias: retire cuseeme supportEd Maste2020-05-163-24/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The CU-SeeMe videoconferencing client and associated protocol is at this point a historical artifact; there is no need to retain support for this protocol today. Reviewed by: philip, markj, allanjude Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24790 Notes: svn path=/head/; revision=361099
* | | vmm(4), bhyve(8): Expose kernel-emulated special devices to userspaceConrad Meyer2020-05-152-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Expose the special kernel LAPIC, IOAPIC, and HPET devices to userspace for use in, e.g., fallback instruction emulation (when userspace has a newer instruction decode/emulation layer than the kernel vmm(4)). Plumb the ioctl through libvmmapi and register the memory ranges in bhyve(8). Reviewed by: grehan Differential Revision: https://reviews.freebsd.org/D24525 Notes: svn path=/head/; revision=361082
* | | Fix SYNPOSIS section to point to the proper include directive.Benedict Reuschling2020-05-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | netgraph(3) points to #include <netgraph/netgraph.h>, which is kernel only. The man page refers to the user-space part of the netgraph module, which is located in <netgraph.h>. Submitted by: lutz_donnerhacke.de Approved by: bcr Differential Revision: https://reviews.freebsd.org/D23814 Notes: svn path=/head/; revision=361074
* | | Implement RTLD_DEEPBIND.Konstantin Belousov2020-05-151-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR: 246462 Tested by: Martin Birgmeier <d8zNeCFG@aon.at> Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24841 Notes: svn path=/head/; revision=361073
* | | Add memalign(3), mostly for glibc compatibility.Konstantin Belousov2020-05-143-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed by: emaste, imp (previous version) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D24307 Notes: svn path=/head/; revision=361060
* | | [PowerPC] Fix wrong instructions in _savegpr_X.Brandon Bergren2020-05-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were accidentally using stfd instead of stw in our SAVEGPR macro. This has almost certainly been causing crashes when compiling with -Os. Reviewed by: jhibbits (in irc) MFC after: 3 days Sponsored by: Tag1 Consulting, Inc. Notes: svn path=/head/; revision=361024
* | | Re-enable proc_test:symbol_lookup after r360979.Mark Johnston2020-05-121-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | PR: 244732 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=360980
* | | librtld_db: Fix shlib mapping offsets.Mark Johnston2020-05-121-8/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | kve_offset gives the offset into the backing file, which is not what we want since different segments may map the same page. Use the base of the mapping to determine the offset exported by librtld_db instead. PR: 244732 Reported by: Jenkins, Nicolò Mazzucato <nicomazz97@gmail.com> MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=360979
* | | Remove tests for obsolete compilers in the build systemEric van Gyzen2020-05-123-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Assume gcc is at least 6.4, the oldest xtoolchain in the ports tree. Assume clang is at least 6, which was in 11.2-RELEASE. Drop conditions for older compilers. Reviewed by: imp (earlier version), emaste, jhb MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D24802 Notes: svn path=/head/; revision=360964
* | | Generate zlib.pc from source.Xin LI2020-05-122-14/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed by: bapt MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D24806 Notes: svn path=/head/; revision=360952
* | | Use -fno-asynchronous-unwind-tables to compile lib/csuDimitry Andric2020-05-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In r209294 kib added -fno-asynchronous-unwind-tables to the compile flags for the GNU C startup components. This was done to work around a BFD ld assertion, "no .eh_frame_hdr table will be created", which is produced because of the layout of the startup objects. Add the same flag to lib/csu too, for the same reason. And similarly to r209294, also add -fno-omit-frame-pointer. This is primarily meant to quickly MFC to stable/11, so it can end up in the 11.4 release, as a fix for https://bugs.freebsd.org/246322. PR: 246322 MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D24797 Notes: svn path=/head/; revision=360915
* | | Add HISTORY sections to document when thisBenedict Reuschling2020-05-058-8/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | functionality first appeared in FreeBSD. Submitted by: Gordon Bergling gbergling_gmail.com Approved by: bcr Differential Revision: https://reviews.freebsd.org/D24677 Notes: svn path=/head/; revision=360670
* | | strdup.3: Slightly canonicalize OOM return/error statusConrad Meyer2020-05-051-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Attempted to clean up the language around "this is a malloc'd object." May be passed as a parameter to free(3) is a bit obtuse. Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=360664
* | | Initial support for bhyve save and restore.John Baldwin2020-05-052-0/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Save and restore (also known as suspend and resume) permits a snapshot to be taken of a guest's state that can later be resumed. In the current implementation, bhyve(8) creates a UNIX domain socket that is used by bhyvectl(8) to send a request to save a snapshot (and optionally exit after the snapshot has been taken). A snapshot currently consists of two files: the first holds a copy of guest RAM, and the second file holds other guest state such as vCPU register values and device model state. To resume a guest, bhyve(8) must be started with a matching pair of command line arguments to instantiate the same set of device models as well as a pointer to the saved snapshot. While the current implementation is useful for several uses cases, it has a few limitations. The file format for saving the guest state is tied to the ABI of internal bhyve structures and is not self-describing (in that it does not communicate the set of device models present in the system). In addition, the state saved for some device models closely matches the internal data structures which might prove a challenge for compatibility of snapshot files across a range of bhyve versions. The file format also does not currently support versioning of individual chunks of state. As a result, the current file format is not a fixed binary format and future revisions to save and restore will break binary compatiblity of snapshot files. The goal is to move to a more flexible format that adds versioning, etc. and at that point to commit to providing a reasonable level of compatibility. As a result, the current implementation is not enabled by default. It can be enabled via the WITH_BHYVE_SNAPSHOT=yes option for userland builds, and the kernel option BHYVE_SHAPSHOT. Submitted by: Mihai Tiganus, Flavius Anton, Darius Mihai Submitted by: Elena Mihailescu, Mihai Carabas, Sergiu Weisz Relnotes: yes Sponsored by: University Politehnica of Bucharest Sponsored by: Matthew Grooms (student scholarships) Sponsored by: iXsystems Differential Revision: https://reviews.freebsd.org/D19495 Notes: svn path=/head/; revision=360648
* | | Remove support for IPsec algorithms deprecated in r348205 and r360202.John Baldwin2020-05-021-25/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Examples of depecrated algorithms in manual pages and sample configs are updated where relevant. I removed the one example of combining ESP and AH (vs using a cipher and auth in ESP) as RFC 8221 says this combination is NOT RECOMMENDED. Specifically, this removes support for the following ciphers: - des-cbc - 3des-cbc - blowfish-cbc - cast128-cbc - des-deriv - des-32iv - camellia-cbc This also removes support for the following authentication algorithms: - hmac-md5 - keyed-md5 - keyed-sha1 - hmac-ripemd160 Reviewed by: cem, gnn (older verisons) Relnotes: yes Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D24342 Notes: svn path=/head/; revision=360557
* | | Remove the SYMVER build option.John Baldwin2020-04-307-33/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This option was added as a transition aide when symbol versioning was first added. It was enabled by default in 2007 and is supported even by the old GPLv2 binutils. Trying to disable it currently fails to build in libc and at this point it isn't worth fixing the build. Reported by: Michael Dexter Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D24637 Notes: svn path=/head/; revision=360511
* | | liblua: ensure that "require" will fail in bootstrap fluaEd Maste2020-04-292-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We do not want to support bootstrapping lua modules, so ensure that require will fail by providing a nonexistent path. Reviewed by: kevans MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24610 Notes: svn path=/head/; revision=360460
* | | Document handling of connection-mode sockets by sendto(2).Mark Johnston2020-04-271-4/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sendto(2), sendmsg(2) and sendmmsg(2) return ENOTCONN if a destination address is specified and the socket is not connected and the socket protocol does not automatically connect ("implied connect"). Document that. Also document the fact that the destination address is ignored for connection-mode sockets if the socket is already connected. PR: 245817 Submitted by: Erik Inge Bolsø <knan-bfo@modirum.com> MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D24530 Notes: svn path=/head/; revision=360384
* | | Fix handling of EV_EOF for named pipes.Mark Johnston2020-04-271-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Contrary to the kevent man page, EV_EOF on a fifo is not cleared by EV_CLEAR. Modify the read and write filters to clear EV_EOF when the fifo's PIPE_EOF flag is clear, and update the man page to document the new behaviour. Modify the write filter to return the amount of buffer space available even if no readers are present. This matches the behaviour for sockets. When reading from a pipe, only call pipeselwakeup() if some data was actually read. This prevents the continuous re-triggering of a EVFILT_READ event on EOF when in edge-triggered mode. PR: 203366, 224615 Submitted by: Jan KokemĂĽller <jan.kokemueller@gmail.com> MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D24528 Notes: svn path=/head/; revision=360380
* | | libc: partially revert r326576Conrad Meyer2020-04-253-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In r326576 ("use @@@ instead of @@ in __sym_default"), an earlier version of the phabricator-discussed patch was inadvertently committed. The commit message claims that @@@ means that weak is not needed, but that was due to a misunderstanding of the use of weak symbols in this context by the submitted in the first draft of the patch; the description text was not updated to match the discussion. As discussed in phabricator, weak is needed for symbol interposing because of the behavior of our rtld, and is widely used elsewhere in libc. This partial revert restores the approved version of the patch and permits symbol interposing for openat. Reported by: Raymond Ramsden <rramsden AT isilon.com> Reviewed by: dim, emaste, kib (2017) Discussed with: kib (2020) Differential Revision: https://reviews.freebsd.org/D11653 Notes: svn path=/head/; revision=360306
* | | Fix a typoMateusz Piotrowski2020-04-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Reported by: pstef MFC after: 2 days Notes: svn path=/head/; revision=360284
* | | Map family 0x5F (Denverton) to goldmont.Alexander Motin2020-04-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | According to the 325462-071US document, they should be the same. MFC after: 1 week Notes: svn path=/head/; revision=360269
* | | Update jemalloc to version 5.2.1Eric van Gyzen2020-04-231-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert r354606 to restore r354605. Apply one line from jemalloc commit d01b425e5d1e1 in hash_x86_128() to fix the build with gcc, which only allows a fallthrough attribute to appear before a case or default label. Submitted by: jasone in r354605 Discussed with: jasone Reviewed by: bdrewery MFC after: never, due to gcc 4.2.1 Relnotes: yes Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D24522 Notes: svn path=/head/; revision=360233
* | | libc: Shortcut if_indextoname() if index == 0Kristof Provost2020-04-231-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the index we're trying to convert is 0 we can avoid a potentially expensive call to getifaddrs(). No interface has an ifindex of zero, so we can handle this as an error: set the errno to ENXIO and return NULL. Submitted by: Nick Rogers Reviewed by: lutz at donnerhacke.de MFC after: 2 weeks Sponsored by: RG Nets Differential Revision: https://reviews.freebsd.org/D24524 Notes: svn path=/head/; revision=360231
* | | kqueue(2): de-vandalize the random sentence in the middleKyle Evans2020-04-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A last minute change appears to have inadvertently vandalized unrelated parts of the manpage with the date. =-( Reported by: rpokala Notes: svn path=/head/; revision=360183
* | | kqueue(2): add a note about EV_RECEIPTKyle Evans2020-04-221-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the below-referenced PR, a case is attached of a simple reproducer that exhibits suboptimal behavior: EVFILT_READ and EVFILT_WRITE being set in the same kevent(2) call will only honor the first one. This is, in-fact, how it's supposed to work. A read of the manpage leads me to believe we could be more clear about this; right now there's a logical leap to make in the relevant statement: "When passed as input, it forces EV_ERROR to always be returned." -- the logical leap being that this indicates the caller should have allocated space for the change to be returned with EV_ERROR indicated in the events, or subsequent filters will get dropped on the floor. Another possible workaround that accomplishes similar effect without needing space for all events is just setting EV_RECEIPT on the final change being passed in; if any errored before it, the kqueue would not be drained. If we made it to the final change with EV_RECEIPT set, then we would return that one with EV_ERROR and still not drain the kqueue. This would seem to not be all that advisable. PR: 229741 MFC after: 1 week Notes: svn path=/head/; revision=360182
* | | Map negative types passed to vm_capability_type2name to NULL.John Baldwin2020-04-211-1/+1
| | | | | | | | | | | | | | | | | | | | | Submitted by: vangyzen Notes: svn path=/head/; revision=360178
* | | Check the magic value in longjmp() before calling sigprocmask().John Baldwin2020-04-211-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This avoids passing garbage to sigprocmask() if the jump buffer is invalid. Reviewed by: mhorne Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D24483 Notes: svn path=/head/; revision=360169
* | | Add description string for VM_CAP_BPT_EXIT.John Baldwin2020-04-211-19/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While here, replace the array of mapping structures with an array of string pointers where the index is the capability value. Submitted by: Rob Fairbanks <rob.fx907@gmail.com> Reviewed by: rgrimes MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D24289 Notes: svn path=/head/; revision=360166
* | | libauditd: make it a PRIVATELIBAlan Somers2020-04-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the upstream man page (which we don't install), none of libauditd's symbols are intended to be public. Also, I can't find any evidence for a port that uses libauditd. Therefore, we should treat it like other such libraries and use PRIVATELIB. Reported by: phk Reviewed by: cem, emaste MFC after: 2 weeks Notes: svn path=/head/; revision=360088
* | | libbsm: fix some MLINKSAlan Somers2020-04-191-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add missing MLINKS entries for a few functions. Remove some old typo entries. Reported by: phk Reviewed by: cem MFC after: 2 weeks Notes: svn path=/head/; revision=360087
* | | cap_dns.3: fix some orphan .Xr linksAlan Somers2020-04-181-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | Reported by: phk MFC after: 2 weeks Notes: svn path=/head/; revision=360079
* | | Attempt to use AT_PS_STRINGS to get the ps_strings pointer.Brooks Davis2020-04-151-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This saves a system call and avoids one of the (relatively rare) cases of the kernel exporting pointers via sysctl. As a temporary measure, keep the sysctl support to allow limited compatability with old kernels. Fail gracefully if ps_strings can't be found (should never happen). Reviewed by: kib Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D24407 Notes: svn path=/head/; revision=359991
* | | Support AT_PS_STRINGS in _elf_aux_info().Brooks Davis2020-04-151-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will be used by setproctitle(). Reviewed by: kib Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D24407 Notes: svn path=/head/; revision=359990
* | | Fix -Wvoid-pointer-to-enum-cast warnings.Brooks Davis2020-04-157-41/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This pattern is used in callbacks with void * data arguments and seems both relatively uncommon and relatively harmless. Silence the warning by casting through uintptr_t. This warning is on by default in Clang 11. Reviewed by: arichardson Obtained from: CheriBSD (partial) MFC after: 1 week Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D24425 Notes: svn path=/head/; revision=359978
* | | Remove support for geli(4) algorithms deprecated in r348206.John Baldwin2020-04-152-42/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes support for reading and writing volumes using the following algorithms: - Triple DES - Blowfish - MD5 HMAC integrity In addition, this commit adds an explicit whitelist of supported algorithms to give a better error message when an invalid or unsupported algorithm is used by an existing volume. Reviewed by: cem Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D24343 Notes: svn path=/head/; revision=359945
* | | closefrom: clamp lowfd to >= 0; close_range's parameters are unsigned.Kyle Evans2020-04-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Pointy hat: kevans Reported by: CI (lwhsu) Notes: svn path=/head/; revision=359943
* | | Mark closefrom(2) COMPAT12, reimplement in libc to wrap close_rangeKyle Evans2020-04-144-2/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Include a temporarily compatibility shim as well for kernels predating close_range, since closefrom is used in some critical areas. Reviewed by: markj (previous version), kib Differential Revision: https://reviews.freebsd.org/D24399 Notes: svn path=/head/; revision=359930
* | | Make sonewconn() overflow messages have per-socket rate-limits and values.Jonathan T. Looney2020-04-141-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sonewconn() emits debug-level messages when a listen socket's queue overflows. Currently, sonewconn() tracks overflows on a global basis. It will only log one message every 60 seconds, regardless of how many sockets experience overflows. And, when it next logs at the end of the 60 seconds, it records a single message referencing a single PCB with the total number of overflows across all sockets. This commit changes to per-socket overflow tracking. The code will now log one message every 60 seconds per socket. And, the code will provide per-socket queue length and overflow counts. It also provides a way to change the period between log messages using a sysctl. Reviewed by: jhb (previous version), bcr (manpages) MFC after: 2 weeks Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D24316 Notes: svn path=/head/; revision=359923
* | | libc: remove shm_open(2)'s compat fallbackKyle Evans2020-04-131-15/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This had been introduced to ease any pain for using slightly older kernels with a newer libc, e.g., for bisecting a kernel across the introduction of shm_open2(2). 6 months has passed, retire the fallback and let shm_open() unconditionally call shm_open2(). Stale includes are removed as well. Notes: svn path=/head/; revision=359865
* | | Sync with OpenBSD:Xin LI2020-04-133-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | arc4random.c: In the incredibly unbelievable circumstance where _rs_init() fails to allocate pages, don't call abort() because of corefile data leakage concerns, but simply _exit(). The reasoning is _rs_init() will only fail if someone finds a way to apply specific pressure against this failure point, for the purpose of leaking information into a core which they can read. We don't need a corefile in this instance to debug that. So take this "lever" away from whoever in the future wants to do that. arc4random.3: reference random(4) arc4random_uniform.c: include stdint.h over sys/types.h Notes: svn path=/head/; revision=359849
* | | Implement a close_range(2) syscallKyle Evans2020-04-123-2/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | close_range(min, max, flags) allows for a range of descriptors to be closed. The Python folk have indicated that they would much prefer this interface to closefrom(2), as the case may be that they/someone have special fds dup'd to higher in the range and they can't necessarily closefrom(min) because they don't want to hit the upper range, but relocating them to lower isn't necessarily feasible. sys_closefrom has been rewritten to use kern_close_range() using ~0U to indicate closing to the end of the range. This was chosen rather than requiring callers of kern_close_range() to hold FILEDESC_SLOCK across the call to kern_close_range for simplicity. The flags argument of close_range(2) is currently unused, so any flags set is currently EINVAL. It was added to the interface in Linux so that future flags could be added for, e.g., "halt on first error" and things of this nature. This patch is based on a syscall of the same design that is expected to be merged into Linux. Reviewed by: kib, markj, vangyzen (all slightly earlier revisions) Differential Revision: https://reviews.freebsd.org/D21627 Notes: svn path=/head/; revision=359836
* | | Introduce nexthop objects and new routing KPI.Alexander V. Chernikov2020-04-121-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the foundational change for the routing subsytem rearchitecture. More details and goals are available in https://reviews.freebsd.org/D24141 . This patch introduces concept of nexthop objects and new nexthop-based routing KPI. Nexthops are objects, containing all necessary information for performing the packet output decision. Output interface, mtu, flags, gw address goes there. For most of the cases, these objects will serve the same role as the struct rtentry is currently serving. Typically there will be low tens of such objects for the router even with multiple BGP full-views, as these objects will be shared between routing entries. This allows to store more information in the nexthop. New KPI: struct nhop_object *fib4_lookup(uint32_t fibnum, struct in_addr dst, uint32_t scopeid, uint32_t flags, uint32_t flowid); struct nhop_object *fib6_lookup(uint32_t fibnum, const struct in6_addr *dst6, uint32_t scopeid, uint32_t flags, uint32_t flowid); These 2 function are intended to replace all all flavours of <in_|in6_>rtalloc[1]<_ign><_fib>, mpath functions and the previous fib[46]-generation functions. Upon successful lookup, they return nexthop object which is guaranteed to exist within current NET_EPOCH. If longer lifetime is desired, one can specify NHR_REF as a flag and get a referenced version of the nexthop. Reference semantic closely resembles rtentry one, allowing sed-style conversion. Additionally, another 2 functions are introduced to support uRPF functionality inside variety of our firewalls. Their primary goal is to hide the multipath implementation details inside the routing subsystem, greatly simplifying firewalls implementation: int fib4_lookup_urpf(uint32_t fibnum, struct in_addr dst, uint32_t scopeid, uint32_t flags, const struct ifnet *src_if); int fib6_lookup_urpf(uint32_t fibnum, const struct in6_addr *dst6, uint32_t scopeid, uint32_t flags, const struct ifnet *src_if); All functions have a separate scopeid argument, paving way to eliminating IPv6 scope embedding and allowing to support IPv4 link-locals in the future. Structure changes: * rtentry gets new 'rt_nhop' pointer, slightly growing the overall size. * rib_head gets new 'rnh_preadd' callback pointer, slightly growing overall sz. Old KPI: During the transition state old and new KPI will coexists. As there are another 4-5 decent-sized conversion patches, it will probably take a couple of weeks. To support both KPIs, fields not required by the new KPI (most of rtentry) has to be kept, resulting in the temporary size increase. Once conversion is finished, rtentry will notably shrink. More details: * architectural overview: https://reviews.freebsd.org/D24141 * list of the next changes: https://reviews.freebsd.org/D24232 Reviewed by: ae,glebius(initial version) Differential Revision: https://reviews.freebsd.org/D24232 Notes: svn path=/head/; revision=359823
* | | Add HISTORY section to getc(3)Sergio Carlavilla Delgado2020-04-101-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | PR: 240269 Submitted by: Gordon Bergling Differential Revision: https://reviews.freebsd.org/D24295 Notes: svn path=/head/; revision=359773
* | | exit(3): Add HISTORY sectionSergio Carlavilla Delgado2020-04-101-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR: 240259 Submitted by: Gordon Bergling Obtained from: OpenBSD Differential Revision: https://reviews.freebsd.org/D24146 Notes: svn path=/head/; revision=359772