]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agoOpenSSL: Regen manual pages for OpenSSL 1.1.1j.
Jung-uk Kim [Tue, 16 Feb 2021 22:05:00 +0000 (17:05 -0500)]
OpenSSL: Regen manual pages for OpenSSL 1.1.1j.

(cherry picked from commit e25db73fea9b641a7dcf29303cf104e0d3847d6c)
(cherry picked from commit e8cbe40ac3ba0582d995d584f58009168f2c9dc6)

Approved by: re (gjb)

3 years agoOpenSSL: Merge OpenSSL 1.1.1j
Jung-uk Kim [Tue, 16 Feb 2021 22:00:27 +0000 (17:00 -0500)]
OpenSSL: Merge OpenSSL 1.1.1j

(cherry picked from commit 88e852c0b5c872b1a3234515623104ae61b60773)
(cherry picked from commit a4f76f79ffe88cb51ebc7b65b065a333fd64a75b)

Approved by: re (gjb)

3 years agofmtree: add a deprecation notice to the manpage
Kyle Evans [Wed, 10 Feb 2021 15:10:52 +0000 (09:10 -0600)]
fmtree: add a deprecation notice to the manpage

Note that this mtree(8) is actually installed as fmtree(8), while
mtree(8) is located in ^/contrib/mtree -- thus, the reference to
mtree(8) makes a lot more sense in the context in which folks would
actually notice it. Shout-out to Ravi for pointing out that this may
not be an obvious fact.

Approved by: re (gjb)
Relnotes: yes

(cherry picked from commit 6fea22cebe5cb1e51e98c894a738bea910b7bc2f)
(cherry picked from commit be4b3e7a5bf9e7b497fcfcc242eebb84d29a6e42)

3 years agoWiden ifnet_detach_sxlock coverage
Kristof Provost [Mon, 8 Feb 2021 09:04:27 +0000 (10:04 +0100)]
Widen ifnet_detach_sxlock coverage

Widen the ifnet_detach_sxlock to cover the entire vnet sysuninit code.
This ensures that we can't end up having the vnet_sysuninit free the UDP
pcb while the detach code is running and trying to purge the UDP pcb.

Approved by:    re (gjb)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D28530

(cherry picked from commit 6d2a10d96fb5d4ee42fd67b0b07a6d098db5d55a)
(cherry picked from commit 05530211165f59b8dabc02adaf26ea29c2726ebc)

3 years agopf: Slightly relax pf_rule_addr validation
Kristof Provost [Sat, 13 Feb 2021 15:31:52 +0000 (16:31 +0100)]
pf: Slightly relax pf_rule_addr validation

Ensure we don't reject no-route / urpf-failed addresses.

PR: 253479
Approved by:    re (gjb)
Reported by: michal AT microwave.sk
Revied by: donner@
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D28650

(cherry picked from commit 5e42cb139fc17f165c9c93ac97069dc7770490e2)
(cherry picked from commit f9a66bb91ae1f3f175d0c16730c683841525bd1d)

3 years ago[udp6] fix possible panic due to lack of locking.
Andrey V. Elsukov [Thu, 11 Feb 2021 08:38:41 +0000 (11:38 +0300)]
[udp6] fix possible panic due to lack of locking.

The lookup for a IPv6 multicast addresses corresponding to
the destination address in the datagram is protected by the
NET_EPOCH section. Access to each PCB is protected by INP_RLOCK
during comparing. But access to socket's so_options field is
not protected. And in some cases it is possible, that PCB
pointer is still valid, but inp_socket is not. The patch wides
lock holding to protect access to inp_socket. It copies locking
strategy from IPv4 UDP handling.

PR: 232192
Approved by: re (gjb)
Obtained from: Yandex LLC
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D28232

(cherry picked from commit 3c782d9c91666886d868426f0aea040d1a1a8ee4)
(cherry picked from commit 8cb4c363163062bceec92383eae43f5a32049c73)

3 years agoifconfig: fix incorrect wg allowed-ips netmask
Michael Chiu [Mon, 15 Feb 2021 00:38:26 +0000 (00:38 +0000)]
ifconfig: fix incorrect wg allowed-ips netmask

Currently when peer information is displayed with `ifconfig wgN peer ..`
or `ifconfig wgN peer-list`, the netmask of the first `allowed-ips` will
be used as the netmask of all CIDR in `allowed-ips`.  For example, if
the list is `192.168.1.0/24, 172.16.0.0/16`, it will display as
`192.168.1.0/24, 172.16.0.0/24`. While this does not affect the actual
functionality, it is very confusing.

Submitted by:   Michael Chiu <nyan -at- myuji.xyz>
Reviewed by: grehan
Differential Revision: https://reviews.freebsd.org/D28655
Approved by:    re (gjb)

(cherry picked from commit be2003ccfa1b12f372fa1329c38c29fe035f232f)

3 years agorelease: fix overriding UNAME_r
Glen Barber [Thu, 11 Feb 2021 02:23:58 +0000 (21:23 -0500)]
release: fix overriding UNAME_r

release.sh: fix OSVERSION and UNAME_r overrides

Add PBUILD_FLAGS and UNAME_r overrides to extra_chroot_setup()
to fix building ports for 14-CURRENT builds on 13.x.

Approved by: re (kib)
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit c511a5ab53ba335dc85f7ac93843872eb5763602)
(cherry picked from commit 6462113b7012025c2d88451c1795368ef0607deb)
(cherry picked from commit cc11afa865f0d5ff7cb22ef0656301e6efb6b3b2)

3 years agomca: Handle inconsistent CMCI capability reporting
Mark Johnston [Tue, 16 Feb 2021 17:07:43 +0000 (12:07 -0500)]
mca: Handle inconsistent CMCI capability reporting

A BIOS bug may apparently cause the BSP to report that it does not
implement CMCI, with some APs reporting that they do.  In this scenario,
avoid a NULL pointer dereference that occurs in cmci_monitor() because
cmc_state was not allocated by the BSP.

Approved by: re (gjb)
PR: 253272
Reported by: asomers, mmacy
Reviewed by: kib (previous version)

(cherry picked from commit b5770470276268acef21368b3e77a325df883500)
(cherry picked from commit 8eebd9592e3daf80c2c743666614119d6c862186)

3 years agoAdding PRR sysctls to tcp(4) man page
Richard Scheffenegger [Fri, 12 Feb 2021 11:32:48 +0000 (12:32 +0100)]
Adding PRR sysctls to tcp(4) man page

Documenting the newly added, and enabled by default,
Proportional Rate Reduction algorithm's governing sysctls.

Reviewed by: kbowling, rgrimes
Approved by: re(gjb)
MFC after: 3 days
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D28568

(cherry picked from commit a78fee8182614593992e841fbb0d4a958f70da0f)

3 years agoFix ifa refcount leak during route addition.
Alexander V. Chernikov [Mon, 15 Feb 2021 20:39:33 +0000 (20:39 +0000)]
Fix ifa refcount leak during route addition.

Reported by: rstone
Reviewed by: rstone
Approved by: re(gjb)

(cherry picked from commit 11304949deb36d2f9abbcda87d398496e892dcec)

3 years agoWhen we are about to send down to the driver layer
Randall Stewart [Mon, 15 Feb 2021 20:39:11 +0000 (20:39 +0000)]
When we are about to send down to the driver layer
we need to make sure that the m_nextpkt field is NULL
else the lower layers may do unwanted things.

Approved by: re(gjb)
Reviewed By:  gallatin, melifaro
Differential Revision: https://reviews.freebsd.org/D28377

(cherry picked from commit 538a81520b557f9964c5ebe912f9dff5996bed56)

3 years agodwmmc: Multiple busdma fixes.
Michal Meloun [Thu, 21 Jan 2021 14:06:19 +0000 (15:06 +0100)]
dwmmc: Multiple busdma fixes.

- limit maximum segment size to 2048 bytes.  Although dwmmc supports a buffer
  fragment with a maximum length of 4095 bytes, use the nearest lower power
  of two as the maximum fragment size. Otherwise, busdma create excessive
  buffer fragments.
- fix off by one error in computation of the maximum data transfer length.
- in addition, reserve two DMA descriptors that can be used by busdma
  bouncing. The beginning or end of the buffer can be misaligned.
- Don’t ignore errors passed to bus_dmamap_load() callback function.
- In theory, a DMA engine may be running at time when next dma descriptor is
  constructed. Create a full DMA descriptor before OWN bit is set.

Approved by: re (gjb)

(cherry picked from commit 8727c174b0fe44766bb7ea765dac6d5f82818103)
(cherry picked from commit e8dfdf40bed9b016b4db2ed008d2d8333073f38c)

3 years agoarm32: Align arguments of sync_icache() syscall to cacheline size.
Michal Meloun [Tue, 9 Feb 2021 10:36:36 +0000 (11:36 +0100)]
arm32: Align arguments of sync_icache() syscall to cacheline size.

Otherwise, we may miss synchronization of the last cacheline.

Approved by:    re (gjb)

(cherry picked from commit ec090f4a67654fa541e6d97fd5f74d3f66c1c0d0)
(cherry picked from commit 6930f97474e409808ca5e220c2b3a86805f786b8)

3 years agoarm64: Initialize VFP control register.
Michal Meloun [Sat, 23 Jan 2021 20:19:07 +0000 (21:19 +0100)]
arm64: Initialize VFP control register.

The RW fields in this register reset to architecturally unknown values,
so initialize these to the proper rounding and denormal mode.

Approved by: re (gjb)

(cherry picked from commit 65618fdda0f272a823e6701966421bdca0efa301)
(cherry picked from commit 214ef320018db339d52e6ec9a02bf2a5691b6575)

3 years agovm: Honour the "noreuse" flag to vm_page_unwire_managed()
Mark Johnston [Wed, 10 Feb 2021 16:10:27 +0000 (11:10 -0500)]
vm: Honour the "noreuse" flag to vm_page_unwire_managed()

This flag indicates that the page should be enqueued near the head of
the inactive queue, skipping the LRU queue.  It is used when unwiring
pages from the buffer cache following direct I/O or after I/O when
POSIX_FADV_NOREUSE or _DONTNEED advice was specified, or when
sendfile(SF_NOCACHE) completes.  For the direct I/O and sendfile cases
we only enqueue the page if we decide not to free it, typically because
it's mapped.

Pass "noreuse" through to vm_page_release_toq() so that we actually
honour the desired LRU policy for these scenarios.

Approved by: re (kib)
Reported by: bdrewery
Reviewed by: alc, kib
Differential Revision: https://reviews.freebsd.org/D28555

(cherry picked from commit 5c18744ea9b94cb6a9a091a900fa4999868736e1)
(cherry picked from commit a73aaaeb579bc7454621c4389636a6d4a952d58c)

3 years agoupdate releng/13.0 to BETA2
Glen Barber [Fri, 12 Feb 2021 00:01:13 +0000 (19:01 -0500)]
update releng/13.0 to BETA2

Approved by: re (implicit)
Sponsored by: Rubicon Communications, LLC ("Netgate")

3 years agoTurn off forgotten multipath debug messages
Alexander V. Chernikov [Mon, 8 Feb 2021 20:11:38 +0000 (20:11 +0000)]
Turn off forgotten multipath debug messages

Approved by: re(gjb)
Reported by: mike tancsa<mike at sentex.net>

(cherry picked from commit adc4ea97bd775cb49df5dbfd71dd497c834ae150)
(cherry picked from commit 980ce11f30f7587bbb897c3c3bd488a06f5f6b4f)

3 years agoarmv8crypto: Fix some edge cases in the AES-GCM implementation
Mark Johnston [Mon, 8 Feb 2021 14:19:07 +0000 (09:19 -0500)]
armv8crypto: Fix some edge cases in the AES-GCM implementation

- We were only hashing up to the first 16 bytes of the AAD.
- When computing the digest during decryption, handle the case where
  len == trailer, i.e., len < AES_BLOCK_LEN, properly.

While here:

- trailer is always smaller than AES_BLOCK_LEN, so remove a pair of
  unnecessary modulus operations.
- Replace some byte-by-byte loops with memcpy() and memset() calls.
  In particular, zero the full block before copying a partial block into
  it since we do that elsewhere and it means that the memset() length is
  known at compile time.

Approved by: re (gjb)
Reviewed by: jhb
Sponsored by: Ampere Computing
Submitted by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D28501

(cherry picked from commit 0dc7076037a87100060309f7179ef6a01f32f99e)
(cherry picked from commit 860e0c7fb84863580521142825330aa941dee313)

3 years agogrep: fix -A handling in conjunction with -m match limitation
Kyle Evans [Thu, 11 Feb 2021 15:11:24 +0000 (09:11 -0600)]
grep: fix -A handling in conjunction with -m match limitation

The basic issue here is that grep, when given -m 1, would stop all
line processing once it hit the match count and exit immediately.  The
problem with exiting immediately is that -A processing only happens when
subsequent lines are processed and do not match.

The fix here is relatively easy; when bsdgrep matches a line, it resets
the 'tail' of the matching context to the value supplied to -A and
dumps anything that's been queued up for -B. After the current line has
been printed and tail is reset, we check our mcount and do what's
needed. Therefore, at the time that we decide we're doing nothing, we
know that 'tail' of the context is correct and we can simply continue
on if there's still more to pick up.

With this change, we still bail out immediately if there's been no -A
flag. If -A was supplied, we signal that we should continue on. However,
subsequent lines will not even bothere to try and process the line.  We
have reached the match count, so even if the next line would match then
we must process it if it hadn't. Thus, the loop in procfile() can
short-circuit and just process the line as a non-match until
procmatches() indicates that it's safe to stop.

A test has been added to reflect both that we should be picking up the
next line and that the next line should be considered a non-match even
if it should have been.

PR: 253350
Approved by: re (gjb)

(cherry picked from commit 3e2d96ac974db823255a6f40b90eeffa6e38d022)
(cherry picked from commit 08f25b50dbd332e5c5c9380fd90c516e9af1ab36)

3 years agogrep: fix null pattern and empty pattern file behavior
Kyle Evans [Thu, 11 Feb 2021 15:10:44 +0000 (09:10 -0600)]
grep: fix null pattern and empty pattern file behavior

The null pattern semantics were terrible because I tried to match gnugrep,
but I got it wrong.  Let's unwind that:

- The null pattern should match every line if neither -w nor -x.
- The null pattern should match empty lines if -x.
- The null pattern should not match any lines if -w.

The first two will stop processing (shortcut) even if additional patterns
are specified. In any other case, we will continue processing other
patterns.  If no other patterns are specified beside a null pattern, then
we match if neither -w nor -x or set and do not match if either of those
are specified.

The justification for -w is that it should match on a whole word, but the
null pattern does not have a whole word to match on.

Empty pattern files should never match anything, and more importantly, -v
should cause everything to be written.

PR: 253209
Approved by: re (gjb)

(cherry picked from commit f823c6dc730b0dd08b54a53be1d8fd587eee7021)
(cherry picked from commit 574d0dfae5011a766aa967f1d1675ddf7b535936)

3 years agoEnable pvscsi and vmx in arm64 GENERIC
Ed Maste [Fri, 5 Feb 2021 00:14:12 +0000 (19:14 -0500)]
Enable pvscsi and vmx in arm64 GENERIC

FreeBSD pvscsi and vmx work with VMware ESXi Arm "Fling"; provide these
in GENERIC for a convenient out-of-the-box experience.

PR: 253202
Reported by: Vincent Milum Jr
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 375d797b81916eb3d16927c9dac8c42975784252)
(cherry picked from commit 87eac7608343d86f2d33d15139ca467565bd7623)

3 years agoCorrect description for kern.proc.proc_td
Ed Maste [Tue, 2 Feb 2021 21:55:51 +0000 (16:55 -0500)]
Correct description for kern.proc.proc_td

kern.proc.proc_td returns the process table with an entry for each
thread.  Previously the description included "no threads", presumably
a cut-and-pasteo in 2648efa621748.

Description suggested by PauAmma.

PR: 253146
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation

(cherry picked from commit edc374e7c41d3d9e28e0b3a76bc9ed021d7db571)
(cherry picked from commit dbe043d42cda38e7f4186f0c0ed39569b713f05b)

3 years agoreadelf: decode LA48 and ASG_DISABLE feature flags
Ed Maste [Wed, 3 Feb 2021 21:16:45 +0000 (16:16 -0500)]
readelf: decode LA48 and ASG_DISABLE feature flags

Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation

(cherry picked from commit e79b51e2b2e35d6256a1ef5311ce02ec4032d21f)
(cherry picked from commit 5e9e7ad9a2a4bc95326df76c90b9244470fea72e)

3 years agopowerpc64: Fix boot on virtual-mode OF (PowerMac G5)
Brandon Bergren [Sun, 7 Feb 2021 22:05:41 +0000 (16:05 -0600)]
powerpc64: Fix boot on virtual-mode OF (PowerMac G5)

In 78599c32efed3247d165302a1fbe8d9203e38974, CFI endproc decoration was
added to locore64.S. However, it missed the subtle detail that
__restartkernel_virtual() falls through to __restartkernel(). This was
causing boot failure on PowerMac G5, as it tried to execute the
epilogue as code.

Fix this by branching to __restartkernel() instead of intentionally
running off the end of the function.

While here, add some additional notes on how the virtual mode restart
works.

Approved by: re (gjb)

(cherry picked from commit d26f2a50ff48dacd38ba358d658882d51f7bdbc4)
(cherry picked from commit 187492ef639fecde6c122838cfff0a75d8b94608)

3 years agobc: Correct mis-merge of contrib/bc on upgrade to version 3.2.6
Stefan Eßer [Fri, 5 Feb 2021 19:53:34 +0000 (20:53 +0100)]
bc: Correct mis-merge of contrib/bc on upgrade to version 3.2.6

Revert "bc: Vendor import of Gavin Howard's bc version 3.2.6"
This reverts commit 601ac82194693fcae9d7d2a7ec7d66ebaf3fd61e.

Vendor import of Gavin Howard's bc version 3.2.6
(cherry picked from commit 47a52dc4d48f259ab7d9f9ba6b65f4f2331a22dc)

The files README.md and .gitignore had been lost and are restored
by this commit.

A lot of files used for fuzzing had been moved to a new place and
still existed in their previous location. Delete the now obsolete
files from the old location.

Approved by:   re

3 years agoSet file mode during zfs_write
Antonio Russo [Mon, 8 Feb 2021 17:15:05 +0000 (10:15 -0700)]
Set file mode during zfs_write

Apply https://github.com/openzfs/zfs/pull/11576

Direct commit from upstream openzfs. Full commit message below:

Set file mode during zfs_write

3d40b65 refactored zfs_vnops.c, which shared much code verbatim between
Linux and BSD.  After a successful write, the suid/sgid bits are reset,
and the mode to be written is stored in newmode.  On Linux, this was
propagated to both the in-memory inode and znode, which is then updated
with sa_update.

3d40b65 accidentally removed the initialization of newmode, which
happened to occur on the same line as the inode update (which has been
moved out of the function).

The uninitialized newmode can be saved to disk, leading to a crash on
stat() of that file, in addition to a merely incorrect file mode.

Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Antonio Russo <aerusso@aerusso.net>
Closes #11474
Closes #11576

Approved by: re (gdb)
Obtained from: openzfs/zfs@f8ce8aed0
Sponsored by: iXsystems, Inc.

(cherry picked from commit e9d419a05357036ea2fd37218d853d2c713d55cc)
(cherry picked from commit 618dee602319166c14c6e12971425d175d4630ed)

3 years agoserf: Fix the default return value of the BIO control method.
John Baldwin [Wed, 3 Feb 2021 22:59:32 +0000 (14:59 -0800)]
serf: Fix the default return value of the BIO control method.

OpenSSL BIO classes provide an abstraction for dealing with I/O.
OpenSSL provides BIO classes for commonly used I/O primitives backed
by file descriptors, sockets, etc. as well as permitting consumers
of OpenSSL to define custom BIO classes.

One of the methods BIO classes implement is a control method invoked
by BIO_ctrl() for various ancilliary tasks somewhat analgous to
fcntl() and ioctl() on file descriptors.  According to the BIO_ctrl(3)
manual page, control methods should return 0 for unknown control
requests.

KTLS support in OpenSSL adds new control requests.  Two of those new
requests are queries to determine if KTLS is enabled for either
reading or writing.  These control reuquest return 1 if KTLS is
enabled and 0 if it is not.

serf includes two custom BIO classes for wrapping I/O requests from
files and from a buffer in memory.  These BIO classes both use a
custom control method.  However, this custom control method was
returning 1 for unknown or unsupported control requests instead of 0.
As a result, OpenSSL with KTLS believed that these BIOs were using
KTLS and were thus adding headers and doing encryption/decryption in
the BIO.  Correcting the return value removes this confusion.

PR: 253135
Reported by: Guido Falsi <mad@madpilot.net>
Approved by: re (gjb)
Sponsored by: Netflix

(cherry picked from commit cb7cc72c546e0f87598961c3860e17391f42866c)
(cherry picked from commit b122886de25a51e3587d94ab2988a6ccb1e6a4e7)

3 years agoFix ldd to work with more ELF files.
John Baldwin [Fri, 29 Jan 2021 18:53:50 +0000 (10:53 -0800)]
Fix ldd to work with more ELF files.

- Use libelf to parse ELF data structures and remove code duplication
  for ELF32.

- Don't require the OSABI field to be set to the FreeBSD OSABI for
  shared libraries.  Both AArch64 and RISC-V leave it set to "none"
  and instead depend on the ABI tag note.  For ldd, this means falling
  back to walking the notes in PT_NOTE segments to find the ABI tag
  note to determine if an ELF shared library without OSABI set in the
  header file is a FreeBSD shared library.

Approved by: re (gjb)

(cherry picked from commit 9d4104b214963bb3371ada05cae8006940121634)
(cherry picked from commit fa3b2ad265d311191c1c8337bf3aa356f28480cb)

3 years agortld: Fix null-pointer dereference
David Chisnall [Tue, 2 Feb 2021 14:06:33 +0000 (16:06 +0200)]
rtld: Fix null-pointer dereference

Approved by: re (gjb)

(cherry picked from commit 43d44842aef3972cc86ce673e84e31f372257b15)

3 years agopowerpc64le: readd COMPAT_FREEBSD11 and COMPAT_FREEBSD12
Piotr Kubaj [Sat, 6 Feb 2021 02:21:55 +0000 (03:21 +0100)]
powerpc64le: readd COMPAT_FREEBSD11 and COMPAT_FREEBSD12

lang/rust needs COMPAT_FREEBSD11 to build, even though powerpc64le itself is
supported only since 13.0.
I also corrected a comment, because if we ever have lib32 for powerpc64le,
it will be for powerpcle.

Reviewed by: bdragon (on IRC)
Approved by: gjb (re)

(cherry picked from commit 8b804ee616b4c8810015b69e37e31ef0c4161511)

3 years agoAlways clamp curve25519 keys prior to use.
Peter Grehan [Wed, 3 Feb 2021 09:05:09 +0000 (19:05 +1000)]
Always clamp curve25519 keys prior to use.

Approved by: re (gjb)

(cherry picked from commit 6136a10e355a7a837edecbccbed04c34b4bc32c9)

3 years agoMFC 093e72319089:
Hans Petter Selasky [Tue, 26 Jan 2021 15:59:42 +0000 (16:59 +0100)]
MFC 093e72319089:
Add missing decrement of active ratelimit connections.

Approved by: re (gjb)
Reviewed by: rrs@
Sponsored by: Mellanox Technologies // NVIDIA Networking

(cherry picked from commit 093e7231908908b651b91c68ac03fb697c3a8352)

3 years agoMFC 85d8d30f9f70:
Hans Petter Selasky [Tue, 26 Jan 2021 14:01:38 +0000 (15:01 +0100)]
MFC 85d8d30f9f70:
Don't allow allocating a new send tag on an INP which is being torn down.
This fixes a potential send tag leak.

Approved by: re (gjb)
Reviewed by: rrs@
Sponsored by: Mellanox Technologies // NVIDIA Networking

(cherry picked from commit 85d8d30f9f7046f5e89295352ded49135b25fbe3)

3 years agorelease: disable the 'reldoc' target after the ASCIIDoctor switch
Glen Barber [Fri, 5 Feb 2021 16:46:49 +0000 (11:46 -0500)]
release: disable the 'reldoc' target after the ASCIIDoctor switch

The 'reldoc' target includes release-related documentation on
installation medium.  Since the switch from XML to ASCIIDoctor,
the file locations have moved, and it will take some time to sort
out how this target should work now.

Approved by: re (kib)
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 7b1d1a1658ffb69eff93afc713f9e88ed8b20eac)
(cherry picked from commit 606bf913f9a33a47005efcac84a430ffb7ec4778)

3 years agoamd64 GENERIC: compile in mlx5en(4)
Konstantin Belousov [Wed, 3 Feb 2021 12:19:12 +0000 (14:19 +0200)]
amd64 GENERIC: compile in mlx5en(4)

Approved by: re (gjb)

(cherry picked from commit 5832a3e398642f721381dc2bdc8e954ae43c17a7)

3 years agocpucontrol(8): Fix display.
Konstantin Belousov [Fri, 5 Feb 2021 01:00:27 +0000 (03:00 +0200)]
cpucontrol(8): Fix display.

Approved by: re (gjb)

(cherry picked from commit 856789c123d69de86684c5aa1ad8a53427dd47fc)

3 years agoRegenerate src.conf(5).
John Baldwin [Thu, 4 Feb 2021 21:47:26 +0000 (13:47 -0800)]
Regenerate src.conf(5).

Approved by: re (gjb)

(cherry picked from commit ab537343065a6925e62001165a4743a17e050118)

3 years agoDisable MK_OPENSSL_KTLS for stable/13.
John Baldwin [Thu, 4 Feb 2021 21:40:25 +0000 (13:40 -0800)]
Disable MK_OPENSSL_KTLS for stable/13.

Due to the pending release of 13.0 and the recent bug in serf exposed
by the KTLS changes, disable OpenSSL's KTLS by default.  This keeps
crypto/openssl in sync with main while lowering the risk of introducing
instability into 13.0.

Approved by: re (gjb)
Discussed with: gjb (re), jkim, emaste (secteam)

(cherry picked from commit 3cf25a7802a26ae3be9159c585fda6aea3d0dc08)

3 years agoOpenSSL: Regenerate manual pages.
Jung-uk Kim [Tue, 26 Jan 2021 22:26:51 +0000 (14:26 -0800)]
OpenSSL: Regenerate manual pages.

Approved by: re (gjb)

(cherry picked from commit bb8acd558e66bd4bae31602fcbe569863f47382c)
(cherry picked from commit 3e09120f7984c990530d6e6860941ffb1e281f8b)

3 years agoOpenSSL: Support for kernel TLS offload (KTLS)
John Baldwin [Sat, 16 Jan 2021 00:17:31 +0000 (16:17 -0800)]
OpenSSL: Support for kernel TLS offload (KTLS)

This merges upstream patches from OpenSSL's master branch to add
KTLS infrastructure for TLS 1.0-1.3 including both RX and TX
offload and SSL_sendfile support on both Linux and FreeBSD.

Note that TLS 1.3 only supports TX offload.

A new WITH/WITHOUT_OPENSSL_KTLS determines if OpenSSL is built with
KTLS support.  It defaults to enabled on amd64 and disabled on all
other architectures.

Approved by: re (gjb)
Sponsored by: Netflix

(cherry picked from commit aa906e2a4957db700d9e6cc60857e1afe1aecc85)
(cherry picked from commit c1c52cd57e8810ca294d02220dfa72607c9a5567)

3 years agoBump shared library versions after ncurses bump in 13.
John Baldwin [Tue, 2 Feb 2021 01:09:33 +0000 (17:09 -0800)]
Bump shared library versions after ncurses bump in 13.

A few shared libraries in the base system link against ncurses.  An
upgrade from a 12.x host to 13 results in ABI breakage for existing
binaries since the newer versions of these libraries link against the
newer ncurses while the binary itself links against the older ncurses.
For example, dialog4ports built on 12.x sometimes crashes on 13 since
it depends on libdialog which links against ncurses internally.

Approved by: re (gjb)

(cherry picked from commit 0b7f1af804f06a285717b490bef80e24648adcbe)
(cherry picked from commit 6e1fe6d26ea2939656c8286ccbd105a89d3349a3)

3 years agomrsas: unbreak i386 build
Alfredo Dal'Ava Junior [Fri, 5 Feb 2021 18:43:48 +0000 (15:43 -0300)]
mrsas: unbreak i386 build

Fix build regression introduced by
e34a057ca6ebdf8e30ec8b0dc21d18eb450bf36a

Approved by: re (gjb)
Reviewed by: jhibbits
Sponsored by: Eldorado Research Institute (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D28494

(cherry picked from commit 59fffbcf46ba6369420e655ff9173571410c643d)
(cherry picked from commit 6bf9668d9d02bdf3e0dafc4ba1010ef6a9b12247)

3 years agoBranch releng/13.0
Glen Barber [Thu, 4 Feb 2021 23:58:51 +0000 (18:58 -0500)]
Branch releng/13.0

Update releng/13.0 to BETA1 in preparation for the first BETA
builds.

Approved by: re (implicit)
Sponsored by: Rubicon Communications, LLC ("Netgate")

3 years agoMFC jail: Handle a parent jail when a child is added to it
Jamie Gritton [Fri, 29 Jan 2021 05:51:09 +0000 (21:51 -0800)]
MFC jail: Handle a parent jail when a child is added to it

It's possible when adding a jail that its dying parent comes back to
life.  Only allow that to happen when JAIL_DYING is specified.  And if
it does happen, call PR_METHOD_CREATE on it.

(cherry picked from commit c050ea803eaa1087313b86628b5d486c0e59e41b)

3 years agoMFC jail: fix dangling reference bug from 6754ae2572eb
Jamie Gritton [Fri, 22 Jan 2021 18:56:24 +0000 (10:56 -0800)]
MFC jail: fix dangling reference bug from 6754ae2572eb

The change to use refcounts for pr_uref was mishandled in
prison_proc_free, so killing a jail's last process could add
an extra reference, leaving it an unkillable zombie.

(cherry picked from commit 195cd6ae2481dd5ad555ed65c226b6f20908d66a)

3 years agoMFC jail: A jail could be removed without calling OSD methods
Jamie Gritton [Fri, 22 Jan 2021 18:50:10 +0000 (10:50 -0800)]
MFC jail: A jail could be removed without calling OSD methods

Fix a long-standing bug where setting nopersist on a process-less jail
would remove it without calling the the OSD PR_METHOD_REMOVE methods.

(cherry picked from commit 39c8ef90f6d035cd3c3ab40e051b1c0f419c76be)

3 years agoMFC 78c93a172114: Use process fib for inet/inet6 fib_algo sysctls.
Alexander V. Chernikov [Sun, 31 Jan 2021 10:48:47 +0000 (10:48 +0000)]
MFC 78c93a172114: Use process fib for inet/inet6 fib_algo sysctls.

This allows to set/query fib algo for non-default fibs.

3 years agoMFC 151ec796a230: Fix the design problem with delayed algorithm sync.
Alexander V. Chernikov [Sat, 30 Jan 2021 22:45:46 +0000 (22:45 +0000)]
MFC 151ec796a230: Fix the design problem with delayed algorithm sync.

Currently, if the immutable algorithm like bsearch or radix_lockless
 receives rtable update notification, it schedules algorithm rebuild.
This rebuild is executed by the callout after ~50 milliseconds.

It is possible that a script adding an interface address and than route
 with the gateway bound to that address will fail. It can happen due
 to the fact that fib is not updated by the time the route addition
 request arrives.

Fix this by allowing synchronous algorithm rebuilds based on certain
 conditions. By default, these conditions assume:
1) less than net.route.algo.fib_sync_limit=100 routes
2) routes without gateway.

* Move algo instance build entirely under rib WLOCK.
 Rib lock is only used for control plane (except radix algo, but there
  are no rebuilds).
* Add rib_walk_ext_locked() function to allow RIB iteration with
 rib lock already held.
* Fix rare potential callout use-after-free for fds by binding fd
 callout to the relevant rib rmlock. In that case, callout_stop()
 under rib WLOCK guarantees no callout will be executed afterwards.

3 years agoMFC dd9163003cb1: Add rib_subscribe_locked() and rib_unsubsribe_locked()
Alexander V. Chernikov [Sat, 30 Jan 2021 21:52:44 +0000 (21:52 +0000)]
MFC dd9163003cb1: Add rib_subscribe_locked() and rib_unsubsribe_locked()
 to support subscriptions during RIB modifications.
Add new subscriptions to the beginning of the lists instead of
 the end. This fixes the situation when new subscription is created
 int the callback for the existing subscription, leading to the
 subscription notification handler pick it.

3 years agoMFC ab6d9aaed76e: Move business logic from rebuild_fd_callout() into rebuild_fd().
Alexander V. Chernikov [Sat, 30 Jan 2021 22:32:42 +0000 (22:32 +0000)]
MFC ab6d9aaed76e: Move business logic from rebuild_fd_callout() into rebuild_fd().

This simplifies code a bit and allows for future non-callout
 callers to request rebuild.

3 years agoMFC f8b7ebea4905: Improve fib_algo debug messages.
Alexander V. Chernikov [Sat, 30 Jan 2021 22:06:40 +0000 (22:06 +0000)]
MFC f8b7ebea4905: Improve fib_algo debug messages.

* Move per-prefix debug lines under LOG_DEBUG2
* Create fib instance counter to distingush log messages between
 instances
* Add more messages on rebuild reason.

MFC after: 3 days

3 years agoMFC 91f2c69ec206: Fix unused-function waring when compiling with FIB_ALGO.
Alexander V. Chernikov [Sat, 30 Jan 2021 23:24:26 +0000 (23:24 +0000)]
MFC 91f2c69ec206: Fix unused-function waring when compiling with FIB_ALGO.

3 years agoMFC cb984c62d705: Fix multipath support for rib_lookup_info().
Alexander V. Chernikov [Fri, 29 Jan 2021 23:10:52 +0000 (23:10 +0000)]
MFC cb984c62d705: Fix multipath support for rib_lookup_info().

The initial plan was to remove rib_lookup_info() before
 FreeBSD 13. As several customers are still remaining,
 fix rib_lookup_info() for the multipath use case.

3 years agoMFC 53729367d388: Fix subinterface vlan creation.
Alexander V. Chernikov [Tue, 26 Jan 2021 07:22:23 +0000 (07:22 +0000)]
MFC 53729367d388: Fix subinterface vlan creation.

D26436 introduced support for stacked vlans that changed the way vlans
 are configured.  In particular, this change broke setups that have
 same-number vlans as subinterfaces.

Vlan support was initially created assuming "vlanX" semantics. In this paradigm,
 automatic number assignment supported by cloning (ifconfig vlan create) was a
 natural fit.
When "ifaceX.Y" support was added, allowing to have the same vlan number on
 multiple devices, cloning code became more complex, as the is no
unified "vlan" namespace anymore. Such interfaces got the first spare
index from "vlan" cloner. This, in turn, led to the following problem:
 ifconfig ix0.333 create -> index 1
 ifconfig ix0.444 create -> index 2
 ifconfig vlan2 create -> allocation failure

This change fixes such allocations by using cloning indexes only for
 "vlanX" interfaces.

Reviewed by:            hselasky
Differential Revision:  https://reviews.freebsd.org/D27505

3 years agoMFC eb0b1b33: Enable multipath routing by default.
Alexander V. Chernikov [Wed, 3 Feb 2021 08:49:46 +0000 (08:49 +0000)]
MFC eb0b1b33: Enable multipath routing by default.

ROUTE_MPATH was added to the GENERIC kernel in r368648.

According to the plan in D27428, it was enabled with `net.route.multipath` sysctl set to 0.
Given enough time has passed, this change enables route multipath by default.

The goal is to ship FreeBSD 13 with multipath turned on.

Reviewed By: donner, olivier
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D28423

3 years agoloader.efi: There are systems without ConOut, also use ConOutDev
Toomas Soome [Thu, 4 Feb 2021 20:49:02 +0000 (22:49 +0200)]
loader.efi: There are systems without ConOut, also use ConOutDev

Conout does contian the default output device name.
ConOutDev does contain all possible output device names, so we can
use it as fallback, when there is no ConOut.

PR: 253253

(cherry picked from commit 2bd4ff2d8911009283e4e615ca4aad35a845f48b)

3 years agohsctrl: Fix manpage typo
Vladimir Kondratyev [Thu, 28 Jan 2021 21:35:11 +0000 (00:35 +0300)]
hsctrl: Fix manpage typo

Use hsctrl_load to load the module at boot time.

Submitted by: Shunchao Hu <ankohuu_outlook.com>
Reviewed by: wulf
Differential revision: https://reviews.freebsd.org/D28343

(cherry picked from commit 5c689e213614bff65e9789875f839aa05053126b)

3 years agohcons: Fix manpage typo
Vladimir Kondratyev [Sat, 23 Jan 2021 19:19:50 +0000 (22:19 +0300)]
hcons: Fix manpage typo

Submitted by: Shunchao Hu <ankohuu_outlook.com>
Reviewed by: wulf, gbe
Differential revision: https://reviews.freebsd.org/D28294

(cherry picked from commit 0d528e6354141dd097f8719e858b3ae3686d2062)

3 years agorelease: update workaround during transition to git
Glen Barber [Tue, 2 Feb 2021 17:19:36 +0000 (12:19 -0500)]
release: update workaround during transition to git

PR: 253181
Submitted by: Yasuhiro Kimura
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 70dfc101b6324b25ba353465f0d6c610399741fc)

3 years agoVMD support for new devices.
Doug Ambrisko [Thu, 28 Jan 2021 23:12:14 +0000 (15:12 -0800)]
VMD support for new devices.

Add support for some more Intel VMD controllers.  Some of the
newer controller have a sparce bus space that can be figured
out by probing the HW.  This gives the starting bus number.
When reading the PCI config. space behind the VMD controller,
the offset of the starting bus needs to be subtracted from
the bus being read.

Fixed a bug in which in which not all of the devices
directly attached to the VMD controller would be probed.
On my initial test HW, a switch was found at bus 0, slot 0
and function 0.  All of the NVME drives were behind that
switch.  Now scan for all slots and functions attached to
bus 0.  If a something was found then run attach after the
scan.  On detach also go through all slots and functions
on bus 0.

Tested with device ID's: 0x201d & 0x9a0b

Tested by: nc@
MFC: 5c689e21361
PR: 252253

(cherry picked from commit 0c852bb9b9282b30fd047ac1de398358f33777f4)

3 years agox86: use compiler intrinsics for bswap*
Mateusz Guzik [Mon, 1 Feb 2021 03:00:13 +0000 (04:00 +0100)]
x86: use compiler intrinsics for bswap*

(cherry picked from commit e6ff6154d2034c13f3d0da73c1e00d69fdb36516)

3 years agoamd64: use compiler intrinsics for bsf* and bsr*
Mateusz Guzik [Sun, 31 Jan 2021 23:35:30 +0000 (00:35 +0100)]
amd64: use compiler intrinsics for bsf* and bsr*

(cherry picked from commit aae89f6f09576351cc3a9a54959649e60fdd849b)

3 years agocache: add delayed degenerate path handling
Mateusz Guzik [Sun, 31 Jan 2021 20:54:35 +0000 (21:54 +0100)]
cache: add delayed degenerate path handling

(cherry picked from commit 6f19dc2124a31aadf419743288d2ec1abd895563)

3 years agocache: move hash computation into the parsing loop
Mateusz Guzik [Sun, 31 Jan 2021 18:25:18 +0000 (19:25 +0100)]
cache: move hash computation into the parsing loop

(cherry picked from commit bbfb1edd70e15241d852d82eb7e1c1049a01b886)

3 years agoamd64: move memcmp checks upfront
Mateusz Guzik [Sun, 31 Jan 2021 15:46:18 +0000 (16:46 +0100)]
amd64: move memcmp checks upfront

This is a tradeoff which saves jumps for smaller sizes while making
the 8-16 range slower (roughly in line with the other cases).

Tested with glibc test suite.

For example size 3 (most common with vfs namecache) (ops/s):
before: 407086026
after: 461391995

The regressed range of 8-16 (with 8 as example):
before: 540850489
after: 461671032

(cherry picked from commit f1be262ec11c1c35e6485f432415b5b52adb505d)

3 years agoamd64: add a note about simd to libc memset, memmove and memcmp
Mateusz Guzik [Sun, 31 Jan 2021 15:50:34 +0000 (16:50 +0100)]
amd64: add a note about simd to libc memset, memmove and memcmp

(cherry picked from commit 0db6aef407f30c138982b8cde43189aad098b337)

3 years agocxgbe(4): Fixes to tx coalescing.
Navdeep Parhar [Mon, 1 Feb 2021 11:00:09 +0000 (03:00 -0800)]
cxgbe(4): Fixes to tx coalescing.

- The behavior implemented in r362905 resulted in delayed transmission
  of packets in some cases, causing performance issues.  Use a different
  heuristic to predict tx requests.

- Add a tunable/sysctl (hw.cxgbe.tx_coalesce) to disable tx coalescing
  entirely.  It can be changed at any time.  There is no change in
  default behavior.

(cherry picked from commit 3447df8bc5b342bd88d565641435284ff620ee2a)

3 years agozfs: update zfs_config.h to match OpenZFS gf11b09dec
Martin Matuska [Mon, 1 Feb 2021 21:08:19 +0000 (22:08 +0100)]
zfs: update zfs_config.h to match OpenZFS gf11b09dec

Update zfs_config.h to match latest merge in FreeBSD

The version string is declared as 2.0.0-FreeBSD_gf11b09dec to provide
more information about the loaded module:
- the OpenZFS version in base is 2.0
- we are using the in tree-module ("FreeBSD")
- the last merged OpenZFS git revision ("gf11b09dec")

With future merges the git revision tag should be updated.
As we are merging from OpenZFS master branch and already include features
like dRAID, referencing patchlevel releases (2.0.1, 2.0.2) is pointless.

Reviewed by: freqlabs
Differential Revision: https://reviews.freebsd.org/D28447

(cherry picked from commit 8fb966790e1c87276cc26932efee1b29c046cb8a)

3 years agowg(4): Add authors of the wg(4) driver to the manual page
Gordon Bergling [Wed, 3 Feb 2021 15:01:32 +0000 (16:01 +0100)]
wg(4): Add authors of the wg(4) driver to the manual page

Glen (@gjb) noticed that I am haven't mentioned the authors of the
WireGuard device driver in the manual page.

This is commit addressed this.

Reviewed by: gjb, brueffer
Differential Revision: https://reviews.freebsd.org/D28464

(cherry picked from commit c1b1354789bb15713944f9e6941266de4cb47772)

3 years agowg(4): Fix Copyright statement in man page
Gordon Bergling [Tue, 2 Feb 2021 19:16:52 +0000 (20:16 +0100)]
wg(4): Fix Copyright statement in man page

(cherry picked from commit 064e52c2d874abc83dd2af61644d14dc90e26ec3)

3 years agoAdd a wg(4) manual page
Gordon Bergling [Tue, 2 Feb 2021 19:13:53 +0000 (20:13 +0100)]
Add a wg(4) manual page

Reviewed by: brueffer, donner, debdrup, ygy
MFC after: 2 days
Differential Revision: https://reviews.freebsd.org/D27783

(cherry picked from commit e59d9cb412846cb5d2bc4c641d3cc44d243cd52d)

3 years agoriscv: add SBI system reset extension
Mitchell Horne [Wed, 27 Jan 2021 21:27:15 +0000 (17:27 -0400)]
riscv: add SBI system reset extension

(cherry picked from commit 9bae4ce661c59be88fec89b2531148e36dd1a23e)
(cherry picked from commit a6405133b7e14929f8e8e61cf30d7152b1410e59)

3 years agoipfw(8) crashes when ext6hdr option is omitted
Evgeniy Khramtsov [Mon, 1 Feb 2021 19:03:57 +0000 (20:03 +0100)]
ipfw(8) crashes when ext6hdr option is omitted

Verify that the option is passed, error out if it's not.
The problem can be trivially triggered with `ipfw add allow ext6hdr`.

PR: 253169
Reviewed by: kp@
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D28447

(cherry picked from commit 682c31db4ecfb8fc6cac0e8ad4945c03379ea3d1)

3 years agobridge: fix STP roles and protos strings
Jonah Caplan [Sat, 30 Jan 2021 13:54:09 +0000 (14:54 +0100)]
bridge: fix STP roles and protos strings

Add the missing commas that got lost in e5539fb618cc7.

PR: 252532
Reviewd by: kp@, donner@, freqlabs@
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D28425

(cherry picked from commit 88be0e11205e4a2dc77e29f7b4a2e82b8d7c9a5c)

3 years agosrc.conf.5: regenerate
Mitchell Horne [Thu, 4 Feb 2021 14:00:11 +0000 (10:00 -0400)]
src.conf.5: regenerate

Direct commit to stable/13.

3 years agosrc.opts.mk: set MK_ZFS conditional on MK_OPENSSL
Mitchell Horne [Sat, 30 Jan 2021 19:04:08 +0000 (15:04 -0400)]
src.opts.mk: set MK_ZFS conditional on MK_OPENSSL

PR: 252841
Reviewed by: kevans, freqlabs

(cherry picked from commit e5cc1c47484160969e0a7c13cdbc71081d7dd60e)

3 years agodu: tests: use dollar-single quotes where appropriate
Kyle Evans [Fri, 29 Jan 2021 03:01:12 +0000 (21:01 -0600)]
du: tests: use dollar-single quotes where appropriate

No need for "foo$(printf "\t")", $'\t' is both more readable and still
functional.

(cherry picked from commit bf59049c27ef86669a94ffd43f7216107b5c57ff)

3 years ago[POWERPC64BE] add mrsas driver to GENERIC64
Alfredo Dal'Ava Junior [Thu, 4 Feb 2021 01:02:28 +0000 (22:02 -0300)]
[POWERPC64BE] add mrsas driver to GENERIC64

Submitted by:   Andre Fernando da Silva <andre.silva@eldorado.org.br>
Reviewed by:    luporl, alfredo, kadesai (on email)
Sponsored by:   Eldorado Research Institute (eldorado.org.br)
Differential Revision:  https://reviews.freebsd.org/D26531

3 years ago[POWERPC64BE] mrsas: add big-endian support
Alfredo Dal'Ava Junior [Thu, 4 Feb 2021 00:52:19 +0000 (21:52 -0300)]
[POWERPC64BE] mrsas: add big-endian support

Add endiannes conversions in order to support big-endian platforms

Submitted by: Andre Fernando da Silva <andre.silva@eldorado.org.br>
Reviewed by: luporl, alfredo, kadesai (on email)
Sponsored by: Eldorado Research Institute (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D26531

3 years agobuild: options: mention ports in the WITH_OPENLDAP description
Kyle Evans [Sat, 30 Jan 2021 06:09:10 +0000 (00:09 -0600)]
build: options: mention ports in the WITH_OPENLDAP description

There's a third party dependency on this option; currently,
net/openldap24-{,sasl-}client.  At least mention that an openldap from ports
is needed for this option.

PR: 252866

(cherry picked from commit 7587d9823a8257b9a2d5b2e58c707026061058c6)

3 years agokerberos5: fix the WITH_OPENLDAP build
Kyle Evans [Sat, 30 Jan 2021 06:07:17 +0000 (00:07 -0600)]
kerberos5: fix the WITH_OPENLDAP build

Restore WARNS to its former glory prior to the global WARNS change to fix
the build.

(cherry picked from commit e948d980f78dd2789060b46d3d03ba0d96b23b59)

3 years agoofed: fix the WITH_OFED_EXTRA build
Kyle Evans [Sat, 30 Jan 2021 05:48:28 +0000 (23:48 -0600)]
ofed: fix the WITH_OFED_EXTRA build

This option was not tested when WARNS was globally lifted in the src tree up
to 6.  Drop WARNS back down to unbreak the build; note that this is still
enabling more warnings than it had before the WARNS change, so the gcc build
may need to be independently evaluated at this level.

PR: 252865

(cherry picked from commit 9ca71db4959f674d75f7b4fd0f72bdc1e2e99abb)

3 years agoRevert "Reimplement strlen"
Mateusz Guzik [Wed, 3 Feb 2021 19:38:10 +0000 (19:38 +0000)]
Revert "Reimplement strlen"

This reverts commit 710e45c4b8539d028877769f1a4ec088c48fb5f1.

It breaks for some corner cases on big endian ppc64.
Given the stage of the release process it is best to revert for now.

Reported by: jhibbits

(cherry picked from commit 33f0540b13d949c7cc226a79927ddc2062ff98bf)

3 years agoqat: Add support for separate AAD and output buffers
Mark Johnston [Wed, 27 Jan 2021 20:30:58 +0000 (15:30 -0500)]
qat: Add support for separate AAD and output buffers

Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit bd674d8b1fa808dff1afdcb6afc70226077ee78a)

3 years agopf: Improve pf_rule input validation
Kristof Provost [Tue, 26 Jan 2021 07:56:51 +0000 (08:56 +0100)]
pf: Improve pf_rule input validation

Move the validation checks to pf_rule_to_krule() to reduce duplication.
This also makes the checks consistent across different ioctls.

Reported-by: syzbot+e9632d7ad17398f0bd8f@syzkaller.appspotmail.com
Reviewed by: tuexen@, donner@
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D28362

(cherry picked from commit 7a808c5ee3296fdb72d8e8bc6c7ad6f316a520ab)

3 years agostand/multiboot: adjust the protocol between loader and kernel
Roger Pau Monné [Wed, 27 Jan 2021 10:12:07 +0000 (11:12 +0100)]
stand/multiboot: adjust the protocol between loader and kernel

There's a currently ad-hoc protocol to hand off the FreeBSD kernel
payload between the loader and the kernel itself when Xen is in the
middle of the picture. Such protocol wasn't very resilient to changes
to the loader itself, because it relied on moving metadata around to
package it using a certain layout. This has proven to be fragile, so
replace it with a more robust version.

The new protocol requires using a xen_header structure that will be
used to pass data between the FreeBSD loader and the FreeBSD kernel
when booting in dom0 mode. At the moment the only data conveyed is the
offset of the start of the module metadata relative to the start of the
module itself.

This is a slightly disruptive change since it also requires a change
to the kernel which is contained in this patch. In order to update
with this change the kernel must be updated before updating the
loader, as described in the handbook. Note this is only required when
booting a FreeBSD/Xen dom0. This change doesn't affect the normal
FreeBSD boot protocol.

This fixes booting FreeBSD/Xen in dom0 mode after
3630506b9daec9167a89bc4525638ea45a00769e.

(cherry picked from commit b6d85a5f51e4147452b35d76478fb9e191b7734b)

3 years agobc: Vendor import of Gavin Howard's bc version 3.2.6
Stefan Eßer [Sun, 31 Jan 2021 19:56:48 +0000 (20:56 +0100)]
bc: Vendor import of Gavin Howard's bc version 3.2.6

(cherry picked from commit 47a52dc4d48f259ab7d9f9ba6b65f4f2331a22dc)

3 years agolualoader: position hyphens at the beginning of character classes
Kyle Evans [Sun, 31 Jan 2021 15:51:39 +0000 (09:51 -0600)]
lualoader: position hyphens at the beginning of character classes

According to the Lua 5.4 manual section 6.4.1 ("Patterns"), the interaction
between ranges and classes is not defined and hyphens must be specified at
either the beginning or the end of a set if they are not escaped.

Move all such occurrences to the beginning.

(cherry picked from commit b24872cf7b13314669ed2136c0262bb2eb007695)

3 years agostand: lua: enhance lfs.dir() to speed up kernels_autodetect
Kyle Evans [Sun, 24 Jan 2021 01:32:38 +0000 (19:32 -0600)]
stand: lua: enhance lfs.dir() to speed up kernels_autodetect

This eliminates a lot of stat() calls that happen when lualoader renders the
menu with the default settings, and greatly speeds up rendering on my
laptop.

ftype is nil if loader/loader.efi hasn't been updated yet, falling back to
lfs.attributes() to test.

This is technically incompatible with lfs, but not in a particularly
terrible way.

(cherry picked from commit e25ee296c919d6567aa76058a7049eac974797fb)

3 years agoMFC: mips: fix early kernel panic when setting up interrupt counters
Oleksandr Tymoshenko [Mon, 1 Feb 2021 07:56:22 +0000 (23:56 -0800)]
MFC: mips: fix early kernel panic when setting up interrupt counters

Commit 248f0ca converted intrcnt and intrnames from u_long[]
and char[] to u_long* and char* respectively, but for non-INTRNG mips
these symbols were defined in .S file as a pre-allocated static arrays,
so the problem wasn't cought at compile time. Conversion from an array
to a pointer requires pointer initialization and it wasn't done
for MIPS, so whatever happenned to be in the begginning of intcnt[]
array was used as a pointer value.

Move intrcnt/intrnames to C code and allocate them dynamically
although with a fixed size at the moment.

Reviewed by: emaste
PR: 253051
Differential Revision: https://reviews.freebsd.org/D28424
MFC after: 1 day

(cherry picked from commit e0a0a3efcb09a10ad1de29aca622ea580b2663d2)

mips: fix NLM platforms breakage caused by e0a0a3ef

NetLogic platforms have their own implementation of cpu_init_interrupts.
Apply the same logic to it as to intr_machdep.c.

PR: 253051

(cherry picked from commit d6f9c5a6d2f87865f9714d2b8dfd1a9f3080c71e)

3 years agocxgb(4): Remove assumption of physically contiguous mbufs.
Alexander Motin [Sun, 31 Jan 2021 17:46:57 +0000 (12:46 -0500)]
cxgb(4): Remove assumption of physically contiguous mbufs.

Investigation of iSCSI target data corruption reports brought me to
discovery that cxgb(4) expects mbufs to be physically contiguous, that
is not true after I've started using m_extaddref() in software iSCSI
for large zero-copy transmissions.  In case of fragmented memory the
driver transmitted garbage from pages following the first one due to
simple use of pmap_kextract() for the first pointer instead of proper
bus_dmamap_load_mbuf_sg().  Seems like it was done as some optimization
many years ago, and at very least it is wrong in a world of IOMMUs.

This patch just removes that optimization, plus limits packet coalescing
for mbufs crossing page boundary, also depending on assumption of one
segment per packet.

Sponsored by: iXsystems, Inc.

(cherry picked from commit 9dc7c250b8bd2d5e669c7633e189a700a02c0571)

3 years agocache: fix trailing slash support in face of permission problems
Mateusz Guzik [Tue, 2 Feb 2021 18:06:56 +0000 (18:06 +0000)]
cache: fix trailing slash support in face of permission problems

Reported by: Johan Hendriks <joh.hendriks gmail.com>
Tested by: kevans

(cherry picked from commit 45456abc4ce71053d07cf03ca63bd1ce459fec55)

3 years agouserboot: provide stub gfx functions
Toomas Soome [Sat, 30 Jan 2021 19:16:20 +0000 (21:16 +0200)]
userboot: provide stub gfx functions

Make sure we have needed functions present, to avoi getting undefined
symbols error(s).

PR: 253088
Reported by: John Kennedy

(cherry picked b79f2bc6c5c7431fa1f7c02937ec97a64653ade1)

3 years agovt: panic while changing vt font
Toomas Soome [Sun, 24 Jan 2021 18:59:36 +0000 (20:59 +0200)]
vt: panic while changing vt font

Set refcount for loader provided font to 1 to prevent this font
from being released (so we can reset to default).

As we get started with no memory allocator, we set up static font data
for font passed by loader (if there is any). At this time, we also must
set refcount 1, and refcount will get incremented in cnprobe() callback.

At some point the memory allocator will be available, and we will set up
properly allocated font data, but we should not disturb the refcount.

PR: 252833
PR: 253147

(cherry picked and squashed 93ebd6307efeb95a29bc614edd0c67c2af850e98 and
1912d2b15e6d6f4a1d8c3886b03ab30d2f21f3fd)

3 years agoloader: create built in font from bold font face
Toomas Soome [Fri, 22 Jan 2021 11:06:58 +0000 (13:06 +0200)]
loader: create built in font from bold font face

We did replace full version of default font 8x16v with bold, also
use bold version for built in font.

(cherry picked from commit 6c789c55c4ba11014bfd1b59942c204615412ba6)

3 years agomarvell: ap806_clock: add missing frequency modes
Marcin Wojtas [Tue, 26 Jan 2021 10:49:35 +0000 (11:49 +0100)]
marvell: ap806_clock: add missing frequency modes

In the driver init routine the CPU clock frequency
value is obtained from a dedicated register. Until now
only part of the values were handled by the mv_ap806_clock
driver. Fix that by adding missing cases.

Submitted by: Zyta Szpak <zr@semihalf.com>
MFC after: 1 week
Obtained from: Semihalf
Sponsored by: Marvell

(cherry picked from commit a86b0839d7bf3fc06b1ae9c50e055b53c50a9d0b)

3 years ago__FreeBSD_version: update the references to the doc tree
Bjoern A. Zeeb [Fri, 29 Jan 2021 10:57:50 +0000 (10:57 +0000)]
__FreeBSD_version: update the references to the doc tree

Update the reference of which file to update in the doc tree when
bumping __FreeBSD_version.

(cherry picked from commit abd619045a54c73f41a95b3e038a5ba083391400)

3 years agoBump __FreeBSD_version for multiple LinuxKPI updates conflicting
Bjoern A. Zeeb [Tue, 2 Feb 2021 11:52:50 +0000 (11:52 +0000)]
Bump __FreeBSD_version for multiple LinuxKPI updates conflicting
with DRM.  Be sure to update your drm-kmod port to after the update.

Sponsored-by: The FreeBSD Foundation

3 years agoLinuxKPI: implement devres() framework parts and two examples
Bjoern A. Zeeb [Thu, 28 Jan 2021 16:32:43 +0000 (16:32 +0000)]
LinuxKPI: implement devres() framework parts and two examples

This code implements a version of the devres framework found
working for various iwlwifi use cases and also providing functions
for ttm_page_alloc_dma.c from DRM.

Part of the framework replicates the consumed KPI, while others
are internal helper functions.

In addition the simple devm_k*malloc() consumers were implemented
and kvasprintf() was enhanced to also work for the devm_kasprintf()
case.
Addmittingly lkpi_devm_kmalloc_release() could be avoided but for
the overall understanding of the code and possible memory tracing
it may still be helpful.

Further devsres consumer are implemented for iwlwifi but will follow
later as the main reason for this change is to sort out overlap with
DRM.

Sponsored-by: The FreeBSD Foundation
Obtained-from: bz_iwlwifi
MFC After: 3 days
Reviewed-by: hselasky, manu
Differential Revision: https://reviews.freebsd.org/D28189

(cherry picked from commit fa765ca73e553399ffbad382e579e4c2b4d0fc12)