]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agoMFC r362452, r362478: liblzma: Make liblzma use libmd implementation of SHA256.
Xin LI [Sat, 4 Jul 2020 03:26:17 +0000 (03:26 +0000)]
MFC r362452, r362478: liblzma: Make liblzma use libmd implementation of SHA256.

3 years agoMFC r362611
Pawel Biernacki [Fri, 3 Jul 2020 11:44:43 +0000 (11:44 +0000)]
MFC r362611

man page of select(2) should mention pselect(2)

Reviewed by: bcr (manpages), kib, trasz
Approved by: kib (mentor)
MFC after: 7 days
Sponsored by: Mysterious Code Ltd.

3 years agoMFC r362642: Don't log normal login_getpwclass(3) result.
Xin LI [Fri, 3 Jul 2020 07:22:34 +0000 (07:22 +0000)]
MFC r362642: Don't log normal login_getpwclass(3) result.

3 years agoMFC r362379:
Tom Jones [Thu, 2 Jul 2020 18:40:22 +0000 (18:40 +0000)]
MFC r362379:

Fix typo in apic.4

Reviewed by:    bcr (manpages)
Approved by:    jtl (co-mentor)
Differential Revision:  https://reviews.freebsd.org/D2535

3 years agoMFC 362324:
Mateusz Piotrowski [Thu, 2 Jul 2020 16:16:01 +0000 (16:16 +0000)]
MFC 362324:

Clean up and improve manual page for fuser(1)

- Mention option's arguments in the list of options (so that now we mention
  "-N system" instead of just "-N").
- Stylize signals and other constants like O_APPEND with Dv.
- Sort options.
- Change indentation width for readability.
- Fix a couple of typos.
- Sort symbols list.
- Use Sy instead of Cm for symbols. They are not command modifiers.
- Use Ex -std in the EXIT STATUS section for consistency with other manual
  pages.
- Use Ql instead of Dq Li for inline code examples as Li has recently been
  deprecated by mdoc.

Reviewed by: bcr
Differential Revision: https://reviews.freebsd.org/D25332

3 years agoMFC 362325:
Mateusz Piotrowski [Thu, 2 Jul 2020 16:12:52 +0000 (16:12 +0000)]
MFC 362325:

Fix the --guid flag description

3 years agoMFC 362321:
Mateusz Piotrowski [Thu, 2 Jul 2020 16:10:34 +0000 (16:10 +0000)]
MFC 362321:

Improve periodic(8) manual page presentation

- Update synopsis to present all available arguments.
- Consistently call the argument specifying an arbitrary directory a
  "directory".
- Do not put macros into -width argument to Bl. They do not expand there.
- Stylize command modifiers like "daily" with Cm instead of Pa. While
  technically periodic(8) operates on directories with such names, it is
  confusing from the perspective of the manual page reader as Pa and Ar are
  stylized the same way. Also, I cannot recall a single manual page where
  Pa would be used to describe the syntax of command-line arguments.

3 years agoMFC r362630: Fix few panics on NVMe's timing out initialization requests.
Alexander Motin [Thu, 2 Jul 2020 01:02:40 +0000 (01:02 +0000)]
MFC r362630: Fix few panics on NVMe's timing out initialization requests.

3 years agoMFC r349893:
Michael Tuexen [Wed, 1 Jul 2020 23:47:51 +0000 (23:47 +0000)]
MFC r349893:

This commit updates rack to what is basically being used at NF as
well as sets in some of the groundwork for committing BBR. The
hpts system is updated as well as some other needed utilities
for the entrance of BBR. This is actually part 1 of 3 more
needed commits which will finally complete with BBRv1 being
added as a new tcp stack.

Merge conflics were manually resolved.

Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D20834

3 years agoMFC r356796:
Michael Tuexen [Wed, 1 Jul 2020 22:31:37 +0000 (22:31 +0000)]
MFC r356796:
Remove debug code not needed anymore.

Submitted by: rscheff
Reviewed by: tuexen
Differential Revision: https://reviews.freebsd.org/D23208

3 years agoMFC r356663:
Michael Tuexen [Wed, 1 Jul 2020 22:22:26 +0000 (22:22 +0000)]
MFC r356663:

Fix race when accepting TCP connections.

When expanding a SYN-cache entry to a socket/inp a two step approach was
taken:
1) The local address was filled in, then the inp was added to the hash
   table.
2) The remote address was filled in and the inp was relocated in the
   hash table.
Before the epoch changes, a write lock was held when this happens and
the code looking up entries was holding a corresponding read lock.
Since the read lock is gone away after the introduction of the
epochs, the half populated inp was found during lookup.
This resulted in processing TCP segments in the context of the wrong
TCP connection.
This patch changes the above procedure in a way that the inp is fully
populated before inserted into the hash table.

Thanks to Paul <devgs@ukr.net> for reporting the issue on the net@
mailing list and for testing the patch!

Reviewed by: rrs@
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D22971

3 years agoMFC r356660:
Michael Tuexen [Wed, 1 Jul 2020 22:00:35 +0000 (22:00 +0000)]
MFC r356660:
Fix division by zero issue.

Thanks to Stas Denisov for reporting the issue for the userland stack
and providing a fix.

3 years agoMFC r356378:
Michael Tuexen [Wed, 1 Jul 2020 21:59:18 +0000 (21:59 +0000)]
MFC r356378:
Don't mark the sendall iterator as being up if it could not be started.

3 years agoMFC r356377:
Michael Tuexen [Wed, 1 Jul 2020 21:57:40 +0000 (21:57 +0000)]
MFC r356377:
Return -1 consistently if an error occurs.

3 years agoMFC r356376:
Michael Tuexen [Wed, 1 Jul 2020 21:56:20 +0000 (21:56 +0000)]
MFC r356376:
Ensure that we don't miss a trigger for kicking off the SCTP iterator.

Reported by: nwhitehorn

3 years agoMFC r356357:
Michael Tuexen [Wed, 1 Jul 2020 21:54:39 +0000 (21:54 +0000)]
MFC r356357:

Make the message size limit used for SCTP_SENDALL configurable via
a sysctl variable instead of a compiled in constant.

This is based on a patch provided by nwhitehorn.

3 years agoMFC r356270:
Michael Tuexen [Wed, 1 Jul 2020 21:52:14 +0000 (21:52 +0000)]
MFC r356270:
Improve input validation of the spp_pathmtu field in the
SCTP_PEER_ADDR_PARAMS socket option. The code in the stack assumes
sane values for the MTU.

This issue was found by running an instance of syzkaller.

MFC r356271:
Remove empty line which was added in previous commit by accident.

3 years agoMFC r355272:
Michael Tuexen [Wed, 1 Jul 2020 21:48:17 +0000 (21:48 +0000)]
MFC r355272:
Make the TF_* flags easier readable by humans by adding leading zeroes
to make them aligned.

Submitted by: rscheff
Reviewed by: rgrimes, rrs, tuexen
Differential Revision: https://reviews.freebsd.org/D22428

3 years agoMFC r356227:
Michael Tuexen [Wed, 1 Jul 2020 21:42:52 +0000 (21:42 +0000)]
MFC r356227:
Add flags for upcoming patches related to improved ECN handling.
No functional change.

Submitted by: rscheff
Reviewed by: rgrimes, tuexen
Differential Revision: https://reviews.freebsd.org/D22429

3 years agoMFC r356226:
Michael Tuexen [Wed, 1 Jul 2020 21:40:27 +0000 (21:40 +0000)]
MFC r356226:
Clear the flag indicating that the last received packet was marked CE also
in the case where a packet not marked was received.

Submitted by: rscheff
Reviewed by: rgrimes, tuexen
Differential Revision: https://reviews.freebsd.org/D19143

3 years agoMFC r355931:
Michael Tuexen [Wed, 1 Jul 2020 21:37:32 +0000 (21:37 +0000)]
MFC r355931:
Improve input validation for some parameters having a too small
reported length.

Thanks to Natalie Silvanovich from Google for finding one of these
issues in the SCTP userland stack and reporting it.

3 years agoMFC r355268:
Michael Tuexen [Wed, 1 Jul 2020 20:45:26 +0000 (20:45 +0000)]
MFC r355268:
Add a description for the TCP sysctl variable rfc6675_pipe.
It was introduced by r290122, but no documentation was provided.
This is taken from https://reviews.freebsd.org/D21798, since it
is not related to the feature added there.

Submitted by: rscheff

3 years agoMFC r355266:
Michael Tuexen [Wed, 1 Jul 2020 20:41:23 +0000 (20:41 +0000)]
MFC r355266:
In order for the TCP Handshake to support ECN++, and further ECN-related
improvements, the ECN bits need to be exposed to the TCP SYNcache.
This change is a minimal modification to the function headers, without any
functional change intended.

Submitted by: rscheff
Reviewed by: rgrimes, rrs, tuexen
Differential Revision: https://reviews.freebsd.org/D22436

3 years agoMFC r355265:
Michael Tuexen [Wed, 1 Jul 2020 20:38:56 +0000 (20:38 +0000)]
MFC r355265:
When changing the MTU of an SCTP path, not only cancel all ongoing
RTT measurements, but also scheldule new ones for the future.

Submitted by: Julius Flohr
Differential Revision: https://reviews.freebsd.org/D22547

3 years agoMFC r355264:
Michael Tuexen [Wed, 1 Jul 2020 20:37:06 +0000 (20:37 +0000)]
MFC r355264:
Update the hostcache also for PTB messages received for SCTP/IPv6.
The corresponding code for SCTP/IPv4 was introduced in
https://svnweb.freebsd.org/base?view=revision&revision=317597

Submitted by: Julius Flohr
Differential Revision: https://reviews.freebsd.org/D22605

3 years agoMFC r355172:
Michael Tuexen [Wed, 1 Jul 2020 20:32:51 +0000 (20:32 +0000)]
MFC r355172:
Really ignore the SCTP association identifier on 1-to-1 style sockets
as requiresd by the socket API specification.
Thanks to Inaki Baz Castillo, who found this bug running the userland
stack with valgrind and reported the issue in
https://github.com/sctplab/usrsctp/issues/408

3 years agoMFC r355135: Plug two mbuf leaks during INIT-ACK handling.
Michael Tuexen [Wed, 1 Jul 2020 20:26:35 +0000 (20:26 +0000)]
MFC r355135: Plug two mbuf leaks during INIT-ACK handling.
One leak happens when there is not enough memory to allocate the
the resources for streams. The other leak happens if the are
unknown parameters in the received INIT-ACK chunk which require
reporting and the INIT-ACK requires sending an ABORT due to illegal
parameter combinations.
Hopefully this fixes
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19083

3 years agoMFC r354774:
Michael Tuexen [Wed, 1 Jul 2020 20:09:34 +0000 (20:09 +0000)]
MFC r354774:
Add boundary and overflow checks to the formulas used in the TCP CUBIC
congestion control module.

Submitted by: rscheff
Reviewed by: rgrimes
Differential Revision: https://reviews.freebsd.org/D19118

3 years agoMFC r354773: Improve TCP CUBIC specific after idle reaction.
Michael Tuexen [Wed, 1 Jul 2020 19:50:03 +0000 (19:50 +0000)]
MFC r354773: Improve TCP CUBIC specific after idle reaction.
The adjustments are inspired by the Linux stack, which has had a
functionally equivalent implementation for more than a decade now.

MFC r356224: Add curly braces missed in above change

Submitted by:           rscheff
Reviewed by:            Cheng Cui
Differential Revision:  https://reviews.freebsd.org/D18982

3 years agoMFC r362204
Vincenzo Maffione [Wed, 1 Jul 2020 19:42:23 +0000 (19:42 +0000)]
MFC r362204

if_vtnet: let vtnet_rx_vq_intr() and vtnet_rxq_tq_intr() share code

Since the two functions are similar, introduce a common function
(vtnet_rx_vq_process()) to share common code.
This also improves locking, by ensuring vrxs_rescheduled is accessed
under the RXQ lock, and taskqueue_enqueue() is not called under the
lock (therefore avoiding a spurious duplicate lock warning).

Reported by:    jrtc27

3 years agoMFC r353482: Add missing include which breaks builds without VIMAGE.
Michael Tuexen [Wed, 1 Jul 2020 19:41:10 +0000 (19:41 +0000)]
MFC r353482: Add missing include which breaks builds without VIMAGE.

3 years agoMFC r354772: Implement a TCP CUBIC-specific after idle reaction.
Michael Tuexen [Wed, 1 Jul 2020 19:23:15 +0000 (19:23 +0000)]
MFC r354772: Implement a TCP CUBIC-specific after idle reaction.
This patch addresses a very common case of frequent application stalls,
where TCP runs idle and looses the state of the network.

Submitted by: rscheff
Reviewed by: Cheng Cui
Differential Revision: https://reviews.freebsd.org/D18954

3 years agoMFC r353518: Separate out SCTP related dtrace code.
Michael Tuexen [Wed, 1 Jul 2020 18:10:37 +0000 (18:10 +0000)]
MFC r353518: Separate out SCTP related dtrace code.

This is based on work done by markj.

3 years agoMFC r353488: Rename sctp_dtrace_declare.h to sctp_kdtrace.h
Michael Tuexen [Wed, 1 Jul 2020 18:08:59 +0000 (18:08 +0000)]
MFC r353488: Rename sctp_dtrace_declare.h to sctp_kdtrace.h

3 years agoMFC r353480: Use event handler in SCTP
Michael Tuexen [Wed, 1 Jul 2020 18:03:38 +0000 (18:03 +0000)]
MFC r353480: Use event handler in SCTP

Use an event handler to notify the SCTP about IP address changes
instead of calling an SCTP specific function from the IP code.
This is a requirement of supporting SCTP as a kernel loadable module.
This patch was developed by markj@, I tweaked a bit the SCTP related
code.

Submitted by: markj

3 years agoMFC r350588: SCTP related cleanup
Michael Tuexen [Wed, 1 Jul 2020 17:40:11 +0000 (17:40 +0000)]
MFC r350588: SCTP related cleanup

Improve consistency. No functional change.

3 years agoMFC r362258, r362279: file 5.39
Xin LI [Wed, 1 Jul 2020 16:18:35 +0000 (16:18 +0000)]
MFC r362258, r362279: file 5.39

Relnotes: yes

3 years agoMFC r362789 (by gallatin):
Mark Johnston [Wed, 1 Jul 2020 15:27:34 +0000 (15:27 +0000)]
MFC r362789 (by gallatin):
Fix a panic when unloading firmware

3 years agoMFC r362585:
Mark Johnston [Wed, 1 Jul 2020 15:02:56 +0000 (15:02 +0000)]
MFC r362585:
ipfw(4): make O_IPVER/ipversion match IPv4 or 6, not just IPv4.

3 years agoMFC r362582:
Mark Johnston [Wed, 1 Jul 2020 15:00:03 +0000 (15:00 +0000)]
MFC r362582:
ipfw(8): In fill_ip6(), use a single statement for both "me" and "me6".

3 years agoMFC r362006: Prevent TCP Cubic to abruptly increase cwnd after app-limited
Richard Scheffenegger [Wed, 1 Jul 2020 09:35:33 +0000 (09:35 +0000)]
MFC r362006: Prevent TCP Cubic to abruptly increase cwnd after app-limited

Cubic calculates the new cwnd based on absolute time
elapsed since the start of an epoch. A cubic epoch is
started on congestion events, or once the congestion
avoidance phase is started, after slow-start has
completed.

When a sender is application limited for an extended
amount of time and subsequently a larger volume of data
becomes ready for sending, Cubic recalculates cwnd
with a lingering cubic epoch. This recalculation
of the cwnd can induce a massive increase in cwnd,
causing a burst of data to be sent at line rate by
the sender.

This adds a flag to reset the cubic epoch once a
session transitions from app-limited to cwnd-limited
to prevent the above effect.

Reviewed by: chengc_netapp.com, tuexen (mentor)
Approved by: tuexen (mentor), rgrimes (mentor)
MFC after: 3 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D25065

3 years agoMFC r361987: Prevent TCP Cubic to abruptly increase cwnd after slow-start
Richard Scheffenegger [Wed, 1 Jul 2020 09:32:17 +0000 (09:32 +0000)]
MFC r361987: Prevent TCP Cubic to abruptly increase cwnd after slow-start

Introducing flags to track the initial Wmax dragging and exit
from slow-start in TCP Cubic. This prevents sudden jumps in the
caluclated cwnd by cubic, especially when the flow is application
limited during slow start (cwnd can not grow as fast as expected).
The downside is that cubic may remain slightly longer in the
concave region before starting the convex region beyond Wmax again.

Reviewed by: chengc_netapp.com, tuexen (mentor)
Approved by: tuexen (mentor), rgrimes (mentor, blanket)
MFC after: 3 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D23655

3 years agoMFC r361806: Add O_DIRECT flag to DD for cache bypass
Richard Scheffenegger [Wed, 1 Jul 2020 09:28:00 +0000 (09:28 +0000)]
MFC r361806: Add O_DIRECT flag to DD for cache bypass

FreeBSD DD utility has not had support for the O_DIRECT flag, which
is useful to bypass local caching, e.g. for unconditionally issuing
NFS IO requests during testing.

Reviewed by: rgrimes (mentor)
Approved by: rgrimes (blanket)
MFC after: 3 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D25066

3 years agoMFC r362033:
Konstantin Belousov [Wed, 1 Jul 2020 01:12:23 +0000 (01:12 +0000)]
MFC r362033:
Remove double-calls to tc_get_timecount() to warm timecounters

3 years agoMFC r362553
Vincenzo Maffione [Tue, 30 Jun 2020 19:34:36 +0000 (19:34 +0000)]
MFC r362553

iflib: netmap: fix rsync index overrun

In the current iflib_netmap_rxsync, there is nothing that prevents
kring->nr_hwtail to overrun kring->nr_hwcur during the descriptor
import phase. This may cause errors in netmap applications, such as:

em1 RX0: fail 'head < kring->nr_hwcur || head > kring->nr_hwtail'
    h 795 c 795 t 282 rh 795 rc 795 rt 282 hc 282 ht 282

Reviewed by:    gallatin
Differential Revision:  https://reviews.freebsd.org/D25252

3 years agoMFC r362623:
Dimitry Andric [Tue, 30 Jun 2020 15:53:52 +0000 (15:53 +0000)]
MFC r362623:

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.

3 years agoMFC 362684, 362675:
Mateusz Piotrowski [Tue, 30 Jun 2020 11:50:52 +0000 (11:50 +0000)]
MFC 362684, 362675:

ixl.4: Use a -bullet list instead of -item

Now the list looks like a list. Using -item only makes sense if the list is
meant to be a list of terms and definitions.

Fix a typo, use Lk for links and use HTTPS where applicable

3 years agoMFC 362538:
Mateusz Piotrowski [Tue, 30 Jun 2020 11:46:40 +0000 (11:46 +0000)]
MFC 362538:

Fix a typo and sort options

3 years agoMFC r344957:
Oleksandr Tymoshenko [Mon, 29 Jun 2020 08:14:45 +0000 (08:14 +0000)]
MFC r344957:

Don't compress and uuencode the "hexdump -C" output files.  Just
save them with the $FreeBSD$ tag prepended.  Changes to these
files are now a lot easier to comprehend, which makes diffs also
reviewable.

3 years agoRevert r362772. The proper fix is to merge format change commit from the HEAD
Oleksandr Tymoshenko [Mon, 29 Jun 2020 08:12:01 +0000 (08:12 +0000)]
Revert r362772. The proper fix is to merge format change commit from the HEAD

3 years agoMFC r362495:
Piotr Pawel Stefaniak [Mon, 29 Jun 2020 06:28:01 +0000 (06:28 +0000)]
MFC r362495:
strtok(3): make it easier to find the RETURN VALUES section

3 years agoFix test breakage after r362767
Oleksandr Tymoshenko [Mon, 29 Jun 2020 06:19:39 +0000 (06:19 +0000)]
Fix test breakage after r362767

tests in stable/12 use different format for the reference images: .gz.uu
instead of .hex

Reported by: Li-Wen Hsu <lwhsu@freebsd.org>

3 years agoMFC r361935:
Oleksandr Tymoshenko [Mon, 29 Jun 2020 00:34:11 +0000 (00:34 +0000)]
MFC r361935:

Add VHDX support to mkimg(1)

VHDX is the successor of Microsoft's VHD file format. It increases
maximum capacity of the virtual drive to 64TB and introduces features
to better handle power/system failures.

VHDX is the required format for 2nd generation Hyper-V VMs.

Reviewed by: marcel
Differential Revision: https://reviews.freebsd.org/D25184

3 years agoMFC r362029-r362030
Oleksandr Tymoshenko [Mon, 29 Jun 2020 00:28:11 +0000 (00:28 +0000)]
MFC r362029-r362030

r362029:
Fix reading EDID on TVs/monitors without E-DCC support

Writing segment id to I2C device 0x30 only required if the segment is
non-zero. On the devices without E-DCC support writing to that address
fails and whole transaction then fails too. To avoid this do
not attempt write to the segment selection device unless required.

r362030:
Add mode selection to iMX6 IPU driver

- Configure ipu1_di0 tob e sourced from the VIDEO_PLL(PLL5) and hardcode
  frequency to (455000000/3)Mhz. This value, further divided, can yield
  frequencies close enough to support 1080p, 720p, 1024x768, and 640x480
  modes. This is not ideal but it's an improvement comparing to the only
  hardcoded 1024x768 mode.

- Fix memory leaks if attach method failed
- Print EDID when -v passed to the kernel

3 years agoMFC r354259:
Mitchell Horne [Sun, 28 Jun 2020 17:51:17 +0000 (17:51 +0000)]
MFC r354259:

RISC-V: Remove EARLY_AP_STARTUP from GENERIC

3 years agoMFC r362546:
Mitchell Horne [Sun, 28 Jun 2020 17:49:41 +0000 (17:49 +0000)]
MFC r362546:

arch(7): small corrections for RISC-V

3 years agoMFC r361754:
Mitchell Horne [Sun, 28 Jun 2020 17:47:41 +0000 (17:47 +0000)]
MFC r361754:

gptboot.efi: align secbuf to 4K

3 years agoMFC r361402:
Mitchell Horne [Sun, 28 Jun 2020 17:45:13 +0000 (17:45 +0000)]
MFC r361402:

Simplify the RISC-V kernel linker invocation

3 years agoMFC r360826:
Mitchell Horne [Sun, 28 Jun 2020 17:43:48 +0000 (17:43 +0000)]
MFC r360826:

Sync relocation definitions

3 years agoMFC r360604: Add references for the most important man7 pages
Gordon Bergling [Sun, 28 Jun 2020 14:40:48 +0000 (14:40 +0000)]
MFC r360604: Add references for the most important man7 pages
worth reading to intro(7).

Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D24649

3 years agoMFC r359633, r359656, r360190: Add a manpage for smbios(4).
Gordon Bergling [Sun, 28 Jun 2020 14:36:56 +0000 (14:36 +0000)]
MFC r359633, r359656, r360190: Add a manpage for smbios(4).

PR: 240252, 163830
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D23714

3 years agoMFC r360493: Add a new manual page for unionfs(5)
Gordon Bergling [Sun, 28 Jun 2020 14:22:57 +0000 (14:22 +0000)]
MFC r360493: Add a new manual page for unionfs(5)

Approved by: bcr
Differential Revision: https://reviews.freebsd.org/D24589

3 years agoMFC r360459: Add a HISTORY section to domain(9).
Gordon Bergling [Sun, 28 Jun 2020 14:02:49 +0000 (14:02 +0000)]
MFC r360459: Add a HISTORY section to domain(9).

Approved by: bcr
Differential Revision: https://reviews.freebsd.org/D24150

3 years agoMFC r362568:
Cy Schubert [Sun, 28 Jun 2020 03:28:28 +0000 (03:28 +0000)]
MFC r362568:

MFV r362565:

Update 4.2.8p14 --> 4.2.8p15

Summary: Systems that use a CMAC algorithm in ntp.keys will not release
a bit of memory on each packet that uses a CMAC keyid, eventually causing
ntpd to run out of memory and fail. The CMAC cleanup from
https://bugs.ntp.org/3447, part of ntp-4.2.8p11, introduced a bug whereby
the CMAC data structure was no longer completely removed.

Security: NTP Bug 3661

3 years agoMFC r361884: sed: attempt to learn about hex escapes (e.g. \x27)
Kyle Evans [Sun, 28 Jun 2020 02:38:07 +0000 (02:38 +0000)]
MFC r361884: sed: attempt to learn about hex escapes (e.g. \x27)

Somewhat predictably, software often wants to use \x27/\x24 among others so
that they can decline worrying about ugly escaping, if said escaping is even
possible. Right now, this software is using these and getting the wrong
results, as we'll interpret those as x27 and x24 respectively. Some examples
of this, when an exp-run was ran, were science/octopus and misc/vifm.

Go ahead and process these at all times.  We allow either one or two digits,
and the tests account for both.  If extra digits are specified, e.g. \x2727,
then the third and fourth digits are interpreted literally as one might
expect.

3 years agoFix mismerge from r362687
Kyle Evans [Sun, 28 Jun 2020 02:29:53 +0000 (02:29 +0000)]
Fix mismerge from r362687

Hex substitutions and the corresponding test case have not yet been
merged back to this branch, but a mismerge added in the atf_add_test_case.

Back out that line, it'll get re-added with the test shortly.

3 years agoMFC: r361854
Rick Macklem [Sun, 28 Jun 2020 01:29:14 +0000 (01:29 +0000)]
MFC: r361854
Fix mountd so that it will not lose SIGHUPs that indicate "reload exports".

Without this patch, if a SIGHUP is handled while the process is executing
get_exportlist(), that SIGHUP is essentially ignored because the got_sighup
variable is reset to 0 after get_exportlist().
This results in the exports file(s) not being reloaded until another SIGHUP
signal is sent to mountd.
This patch fixes this by resetting got_sighup to zero before the
get_exportlist() call while SIGHUP is blocked.
It also defines a delay time of 250msec before doing another exports reload
if there are RPC request(s) to process. This prevents repeated exports reloads
from delaying handling of RPC requests significantly.

PR: 246597

3 years agoMFC r339956 r362170: Add HISTORY sections to ZFS and dtrace manpages
Gordon Bergling [Sat, 27 Jun 2020 17:39:13 +0000 (17:39 +0000)]
MFC r339956 r362170: Add HISTORY sections to ZFS and dtrace manpages

r362170
Add HISTORY sections to ZFS and dtrace manpages

Reviewed by: bcr (mentor)
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D23833

r339956:
dtrace(1): remove reference to dtruss that was removed from base
system in r300226.

PR: 211618
Reviewed by: gnn, markj, 0mp
Approved by: kib (mentor, implicit)
Differential Revision: https://reviews.freebsd.org/D17762

3 years agoMFC 362348:
Mateusz Piotrowski [Sat, 27 Jun 2020 14:48:10 +0000 (14:48 +0000)]
MFC 362348:

Document that umount -A does not unmount /dev

Reported by: kaktus
Reviewed by: kaktus
Differential Revision: https://reviews.freebsd.org/D25351

3 years agoMFC 362290:
Mateusz Piotrowski [Sat, 27 Jun 2020 14:36:44 +0000 (14:36 +0000)]
MFC 362290:

Clean up fstat.1

- Sort options in the list & indent for readability.
- Pet linters
  - Use "\(em" instead of "--"
  - Remove Tn macros
- Use Ql instead of Dq Li
- Add arguments to the -M, -N, -p, and -u options in their descriptions.
- Use Sy instead of Li for field names. Li is deprecated, and Ql makes no
  sense here.
- Replace a literal block with a list for the table of special names
  related to FD.
- Use Ql instead of ``X''.
- Add a dot after etc.
- Reference fuser(1).

3 years agoMFC 362017, 362039, 362071:
Mateusz Piotrowski [Sat, 27 Jun 2020 14:27:37 +0000 (14:27 +0000)]
MFC 362017, 362039, 362071:

Read commands from stdin when -f - is passed to sed(1)

This patch teaches sed to interpret a "-" in a special way when given
as an argument to the -f flag.

This behavior is also present in GNU sed.

PR: 244872
Tested by: antoine (exp-run)
Reviewed by: pfg, tobik (older version)
Approved by: pfg (src)
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D24079

Remove duplicate lines from sed tests

Reported by: yuripv
Approved by: pfg (src)

Remove some more duplicate test cases I accidentally committed

Reported by: markj, yuripv

3 years agoMFC 362336:
Mateusz Piotrowski [Sat, 27 Jun 2020 14:14:00 +0000 (14:14 +0000)]
MFC 362336:

Fix a typo in cpuset_getdomain.2

PR: 247385
Reported by: Paul Floyd <paulf free.fr>

3 years agoMFC r362326: fgetln(3): Add a Caveats Section
Gordon Bergling [Sat, 27 Jun 2020 13:55:38 +0000 (13:55 +0000)]
MFC r362326: fgetln(3): Add a Caveats Section

Reviewed by: yuripv, bcr (mentor)
Approved by: bcr (mentror)
Obtained from: OpenBSD
Differential Revision: https://reviews.freebsd.org/D24916

3 years agoMFC r362327: Add HISTORY sections to banner(6), basename(1), limits(1) and vmstat(8)
Gordon Bergling [Sat, 27 Jun 2020 13:18:21 +0000 (13:18 +0000)]
MFC r362327: Add HISTORY sections to banner(6), basename(1), limits(1) and vmstat(8)

Reviewed by: bcr (mentor)
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D25019

3 years agoMFC r362171: libc manpages: various improvements from NetBSD
Gordon Bergling [Sat, 27 Jun 2020 12:12:47 +0000 (12:12 +0000)]
MFC r362171: libc manpages: various improvements from NetBSD

- Add STANDARDS and HISTORY sections within the appropriate manpages
- Mention two USENIX papers within kqueue(2) and strlcpy(3)

Reviewed by: bcr (mentor)
Approved by: bcr (mentor)
Obtained from: NetBSD
Differential Revision: https://reviews.freebsd.org/D24650

3 years agoMFC r362429 and r362430:
Piotr Pawel Stefaniak [Sat, 27 Jun 2020 09:01:30 +0000 (09:01 +0000)]
MFC r362429 and r362430:
libutil: remove extraneous ": " from error messages
Make vipw error message less cryptic

3 years agoMFC r362169: libutil: Document function HISTORY within the manpages
Gordon Bergling [Fri, 26 Jun 2020 20:44:10 +0000 (20:44 +0000)]
MFC r362169: libutil: Document function HISTORY within the manpages

Reviewed by: bcr (mentor)
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D24795

3 years agoMFC r362165: Add a HISTORY section to ctime(3)
Gordon Bergling [Fri, 26 Jun 2020 18:57:01 +0000 (18:57 +0000)]
MFC r362165: Add a HISTORY section to ctime(3)

Reviewed by: bcr (mentor)
Approved by: bcr (mentor)
Obtained from: OpenBSD
Differential Revision: https://reviews.freebsd.org/D24635

3 years agoMFC r362656:
Li-Wen Hsu [Fri, 26 Jun 2020 18:01:35 +0000 (18:01 +0000)]
MFC r362656:

Temporarily skip flakey sys.kern.sysv_test.msg in CI

PR: 233649

3 years agoMFC r362646:
Li-Wen Hsu [Fri, 26 Jun 2020 17:35:09 +0000 (17:35 +0000)]
MFC r362646:

Temporarily skip flakey bin.sh.execution.functional_test.bg12 in CI

PR: 247559
Sponsored by: The FreeBSD Foundation

3 years agoMFC r362361, r362363:
Mark Johnston [Fri, 26 Jun 2020 16:16:25 +0000 (16:16 +0000)]
MFC r362361, r362363:
Add a helper function for validating VA ranges.

3 years agoMFC r360345:
Kristof Provost [Fri, 26 Jun 2020 12:11:22 +0000 (12:11 +0000)]
MFC r360345:

bridge: epoch-ification

Run the bridge datapath under epoch, rather than under the
BRIDGE_LOCK().

We still take the BRIDGE_LOCK() whenever we insert or delete items in
the relevant lists, but we use epoch callbacks to free items so that
it's safe to iterate the lists without the BRIDGE_LOCK.

Tests on mercat5/6 shows this increases bridge throughput significantly,
from 3.7Mpps to 18.6Mpps.

MFC after: The FreeBSD Foundation

3 years agoMFC r359641:
Kristof Provost [Fri, 26 Jun 2020 10:08:57 +0000 (10:08 +0000)]
MFC r359641:

bridge: Change lists to CK_LIST as a peparation for epochification

Prepare the ground for a rework of the bridge locking approach. We will
use an epoch-based approach in the datapath and making it safe to
iterate over the interface, span and rtnode lists without holding the
BRIDGE_LOCK. Replace the relevant lists by their ConcurrencyKit
equivalents.

No functional change in this commit.

Sponsored by: The FreeBSD Foundation

3 years agoMFC r358325:
Kristof Provost [Fri, 26 Jun 2020 09:52:43 +0000 (09:52 +0000)]
MFC r358325:

bridge: Move locking defines into if_bridge.c

The locking defines for if_bridge used to live in if_bridgevar.h, but
they're only ever used by the bridge implementation itself (in
if_bridge.c). Moving them into the .c file.

Sponsored by: The FreeBSD Foundation

3 years agoMFC r362544:
Ryan Moeller [Fri, 26 Jun 2020 00:58:59 +0000 (00:58 +0000)]
MFC r362544:

libdevdctl: Force full match of "timestamp" field name

OpenZFS generates events with a "zio_timestamp" field, which gets mistaken for
"timestamp" by libdevdctl due to imprecise string matching.  Then later it is
assumed a "timestamp" field exists when it doesn't and an exception is thrown.

Add a space to the search string so we match exactly "timestamp" rather than
anything with that as a suffix.

Approved by:    mav (mentor)
Sponsored by:   iXsystems, Inc.

3 years agoMFC r362342:
Konstantin Belousov [Thu, 25 Jun 2020 05:24:35 +0000 (05:24 +0000)]
MFC r362342:
Fix execution of linux binary from multithreaded non-Linux process.

3 years agoMFC r362347:
Konstantin Belousov [Thu, 25 Jun 2020 05:20:00 +0000 (05:20 +0000)]
MFC r362347:
rtld: Apply relro to itself.

3 years agoMFC r362346:
Konstantin Belousov [Thu, 25 Jun 2020 05:17:36 +0000 (05:17 +0000)]
MFC r362346:
rtld: Parse own phdr and notes.

3 years agoMFC: r361780, r361956
Rick Macklem [Thu, 25 Jun 2020 02:45:49 +0000 (02:45 +0000)]
MFC: r361780, r361956
Fix mountd to handle getgrouplist() not returning groups[0] == groups[1].

Prior to r174547, getgrouplist(3) always returned a groups list with
element 0 and 1 set to the basegid argument, so long as ngroups was > 1.
Post-r174547 this is not the case. r328304 disabled the deduplication that
removed the duplicate, but the duplicate still does not occur unless the
group for a user in the password database is also entered in the group
database.
This patch fixes mountd so that it handles the case where a user specified
with the -maproot or -mapall exports option has a getgrouplist(3) groups
list where groups[0] != groups[1].

Relnotes: yes

3 years agoMFC r362260:
Vladimir Kondratyev [Thu, 25 Jun 2020 00:00:04 +0000 (00:00 +0000)]
MFC r362260:

evdev: Add AT translated set1 scancodes for 'Eisu' & 'Kana' keys.

PR: 247292
Submitted by: Yuichiro NAITO <naito.yuichiro@gmail.com>

3 years agoMFC r361347: With RFC3168 ECN, CWR SHOULD only be sent with new data
Richard Scheffenegger [Wed, 24 Jun 2020 16:17:58 +0000 (16:17 +0000)]
MFC r361347: With RFC3168 ECN, CWR SHOULD only be sent with new data

Overly conservative data receivers may ignore the CWR flag on other
packets, and keep ECE latched. This can result in continous reduction
of the congestion window, and very poor performance when ECN is
enabled.

PR: 243590
Reviewed by: rgrimes (mentor), rrs
Approved by: rgrimes (mentor, blanket)
MFC after: 3 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D23364

3 years agoMFC r362337: Make polled request timeout less invasive.
Alexander Motin [Wed, 24 Jun 2020 13:49:30 +0000 (13:49 +0000)]
MFC r362337: Make polled request timeout less invasive.

Instead of panic after one second of polling, make the normal timeout
handler to activate, reset the controller and abort the outstanding
requests.  If all of it won't happen within 10 seconds then something
in the driver is likely stuck bad and panic is the only way out.

In particular this fixed device hot unplug during execution of those
polled commands, allowing clean device detach instead of panic.

3 years agoMFC r362282: Fix admin qpair leak if detached during initial reset.
Alexander Motin [Wed, 24 Jun 2020 13:48:16 +0000 (13:48 +0000)]
MFC r362282: Fix admin qpair leak if detached during initial reset.

3 years agoMFC r362031, r362065, r362075:
Konstantin Belousov [Wed, 24 Jun 2020 06:35:50 +0000 (06:35 +0000)]
MFC r362031, r362065, r362075:
amd64 pmap: reorder IPI send and local TLB flush in TLB invalidations.

3 years agoMFC r362271:
Hans Petter Selasky [Wed, 24 Jun 2020 05:10:41 +0000 (05:10 +0000)]
MFC r362271:
Allow multicast packets to be received in promiscious mode, in mlx4en(4).

Make sure we disable the multicast filter in promiscious mode aswell as when
the all multicast flag is set.

Found by: Tycho Nightingale <tychon@freebsd.org>
Sponsored by: Mellanox Technologies

3 years agoMFC r361982
Vincenzo Maffione [Tue, 23 Jun 2020 20:48:43 +0000 (20:48 +0000)]
MFC r361982

iflib: netmap: honor netmap_irx_irq return values

In the receive interrupt routine, always call netmap_rx_irq().
The latter function will return != NM_IRQ_PASS if netmap is not
active on that specific receive queue, so that the driver can go
on with iflib_rxeof(). Note that netmap supports partial opening,
where only a subset of the RX or TX rings can be open in netmap mode.
Checking the IFCAP_NETMAP flag is not enough to make sure that the
queue is indeed in netmap mode.
Moreover, in case netmap_rx_irq() returns NM_IRQ_RESCHED, it means
that netmap expects the driver to call netmap_rx_irq() again as soon
as possible. Currently, this may happen when the device is attached
to a VALE switch.

Reviewed by:    gallatin
Differential Revision:  https://reviews.freebsd.org/D25167

3 years agoMFC r362185
Vincenzo Maffione [Tue, 23 Jun 2020 20:44:05 +0000 (20:44 +0000)]
MFC r362185

iflib: netmap: enter/exit netmap mode after device stops

Avoid possible race conditions by calling nm_set_native_flags()
and nm_clear_native_flags() only after the device has been
stopped.

3 years agoMFC r362183
Vincenzo Maffione [Tue, 23 Jun 2020 20:41:10 +0000 (20:41 +0000)]
MFC r362183

netmap: vtnet: fix races in vtnet_netmap_reg()

The nm_register callback needs to call nm_set_native_flags()
or nm_clear_native_flags() once the device has been stopped.
However, in the current implementation this is not true,
as the device is stopped by vtnet_init_locked(). This causes
race conditions where the driver crashes as soon as it
dequeues netmap buffers assuming they are mbufs (or the other
way around).
To fix the issue, we extend vtnet_init_locked() with a second
argument that, if not zero, will set/clear the netmap flags.
This results in a huge simplification of the nm_register
callback itself.
Also, use netmap_reset() to check if a ring is going to be
re-initialized in netmap mode.

3 years agoMFC r362251:
Konstantin Belousov [Tue, 23 Jun 2020 03:18:57 +0000 (03:18 +0000)]
MFC r362251:
rtld: Allow to load ET_DYN && DF_1_PIE when tracing.

3 years agoMFC r362250:
Konstantin Belousov [Tue, 23 Jun 2020 03:18:07 +0000 (03:18 +0000)]
MFC r362250:
rtld: Add debug line for dlopen_object().