Commit Graph

249524 Commits

Author SHA1 Message Date
Mateusz Piotrowski
1565e1889a Fix a typo
Reported by:	rgrimes
MFC with:	359967
2020-04-15 17:11:44 +00:00
Pawel Biernacki
f65eac0fc0 sysctl_handle_string: Put logical or in parentheses.
Reported by:	rdivacky
Approved by:	kib (mentor)
Pointy-hat to:	kaktus
2020-04-15 16:55:38 +00:00
Pawel Biernacki
1627b1fd9d sysctl(9): fix handling string tunables.
r357614 changed internals of handling string sysctls, and inadvertently
broke setting string tunables.  Take them into account.

PR:		245463
Reported by:	jhb, np
Reviewed by:	imp, jhb, kib
Approved by:	kib (mentor)
Differential Revision:	https://reviews.freebsd.org/D24429
2020-04-15 16:33:55 +00:00
Brooks Davis
d0fa673e4d Don't directly access userspace memory.
Rather then using the racy useracc() followed by direct access to
userspace memory, perform a copyin() and use the result if it succeeds.

Reviewed by:	jhb
MFC after:	3 weeks
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D24410
2020-04-15 16:33:27 +00:00
Mateusz Piotrowski
3e58608634 sshd: Warn about missing ssh-keygen only when necessary
The sshd service is using ssh-keygen to generate missing SSH keys.
If ssh-keygen is missing, it prints the following message:

> /etc/rc.d/sshd: WARNING: /usr/bin/ssh-keygen does not exist.

It makes sense when the key is not generated yet and
cannot be created because ssh-keygen is missing.

The problem is that even if the key is present on the host,
the sshd service would still warn about missing ssh-keygen
(even though it does not need it).

Reviewed by:	emaste
Approved by:	emaste (src)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D23911
2020-04-15 14:07:33 +00:00
Emmanuel Vadot
e3637e41e3 arm: allwinner: aw_sid: Fix thermal calibration size for A64
This fixes the aw_thermal driver on A64 SoC.

MFC after:	1 month
X-MFC-With:	r359935
2020-04-15 13:35:28 +00:00
Hans Petter Selasky
a90fb6cf3c Cast all ioctl command arguments through uint32_t internally.
Hide debug print showing use of sign extended ioctl command argument
under INVARIANTS. The print is available to all and can easily fill
up the logs.

No functional change intended.

MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-04-15 13:20:51 +00:00
Mateusz Piotrowski
6f2b877647 Document the exit status and the stdout message of nologin(8)
Reviewed by:	debdrup (earlier version)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D24196
2020-04-15 13:13:46 +00:00
Alexander V. Chernikov
0f3bf68212 Convert OFED rtable interactions to the new routing KPI.
Reviewed by:	hselasky
Differential Revision:	https://reviews.freebsd.org/D24387
2020-04-15 13:06:55 +00:00
Emmanuel Vadot
85ebd7e10a mmc_fdt_helpers: Do not schedule a card detection is there is no cd gpio
If the fdt node doesn't have a cd-gpios properties or if the node is set
as non-removable we do not init the card detection timeout task as it is
useless so don't schedule it too.

MFC after:	1 month
X-MFC-With:	r359924
2020-04-15 13:02:13 +00:00
Alexander V. Chernikov
643ce94878 Convert pf rtable checks to the new routing KPI.
Switch uRPF to use specific fib(9)-provided uRPF.
Switch MSS calculation to the latest fib(9) kpi.

Reviewed by:	kp
Differential Revision:	https://reviews.freebsd.org/D24386
2020-04-15 13:00:48 +00:00
Alexander V. Chernikov
53a4886d5d Convert ip6_forward() to the new routing KPI.
Update ip6_forward() internals to use deembedded IPv6 addresses
 to simplify calls to the new KPI and prepare for the future
 scope-embedding cleanup.

Add in6_get_unicast_scopeid() and in6_set_unicast_scopeid() scopeid
 operation functions tailored for unicast processing.

Reviewed by:	ae
Differential Revision:	https://reviews.freebsd.org/D24334
2020-04-15 12:56:05 +00:00
Hiroki Tagato
4afeb43d98 Add my birthday
Approved by:	ehaupt (mentor)
2020-04-15 10:20:18 +00:00
Jung-uk Kim
e946a95233 Do not attempt to remove backward compatibility timezones.
Since r359736, these timezones are unconditionally installed.
2020-04-15 08:18:28 +00:00
Conrad Meyer
38e6153f75 bhyve(8): Correct copyright boilerplate for r359950
Use the text from the canonical sys/copyright.h 2-clause FreeBSD License.

Reported by:	grehan (thanks!)
2020-04-15 05:55:14 +00:00
Kyle Evans
ca6129af19 sys/types.h: adjust #endif comment to match reality
Submitted by:	sigsys gmail com
2020-04-15 04:03:46 +00:00
Kyle Evans
142ffb8bdc kern uuid: break format validation out into a separate KPI
This new KPI, validate_uuid, strictly validates the formatting of the input
UUID and, optionally, populates a given struct uuid.

As noted in the header, the key differences are that the new KPI won't
recognize an empty string as a nil UUID and it won't do any kind of semantic
validation on it. Also key is that populating a struct uuid is optional, so
the caller doesn't necessarily need to allocate a bogus one on the stack
just to validate the string.

This KPI has specifically been broken out in support of D24288, which will
preload /etc/hostid in loader so that early boot hostuuid users (e.g.
anything that calls ether_gen_addr) can have a valid hostuuid to work with
once it's been stashed in /etc/hostid.
2020-04-15 03:59:26 +00:00
Navdeep Parhar
ddde90ac81 cxgbe/iw_cxgbe: Do not start the EP timer if soaccept fails.
This fixes a panic that would occur when the timer tried to close a
stale socket.

Submitted by:	Krishnamraju Eraparaju @ Chelsio
MFC after:	1 week
Sponsored by:	Chelsio Communications
2020-04-15 03:40:33 +00:00
Conrad Meyer
52c39ee643 bhyve(8): Minor cosmetic niceties in instemul failure
Print the failed instruction stream as a contiguous stream of hex.  This
is closer to something you could throw at a disassembler than 0xHH 0xHH
0xHH.

Also, use the debug.h 'raw' stdio-aware printf helper to avoid the
cascading
         line
             effect.
2020-04-15 02:34:44 +00:00
Conrad Meyer
9cb339cc7b bhyve(8): Add VM Generation Counter ACPI device
Add an implementatation of the 'Virtual Machine Generation ID' spec to
Bhyve.  The spec provides a randomly generated GUID (at bhyve start) in
device memory, along with an ACPI device with _CID VM_Gen_Counter and ADDR
evaluating to a Package pointing at that GUID.

A GPE is defined which Notifies the ACPI Device when the generation changes
(such as when a snapshot is rolled back).  At this time, Bhyve does not
support snapshotting, so the GPE is never actually raised.

Suggested by:	rpokala
Discussed with:	grehan
Differential Revision:	https://reviews.freebsd.org/D23165
2020-04-15 02:00:17 +00:00
Conrad Meyer
bb30b08e76 bhyve(8): Add bootrom allocation abstraction
To allow more general use of the bootrom region, separate initialization from
allocation, and allocation from loading a file.

The bootrom segment is the high 16MB of the low 4GB region.

Each allocation in the segment creates a new mapping with specified protection.
By default, allocation begins at the low end of the range.  However, the
BOOTROM_ALLOC_TOP flag is provided to locate a provided bootrom in the high
region it is expected to be in.

The existing ROM-file loading code is refactored to use the new interface.

Reviewed by:	grehan (earlier version)
Differential Revision:	https://reviews.freebsd.org/D24422
2020-04-15 01:58:51 +00:00
Conrad Meyer
102acd72aa bus_dma.9: Remove erroneous usage recommendation
It is not valid to pass BUS_SPACE_UNRESTRICTED to bus_dma_tag_create()'s
nsegments parameter as it is interpreted as a very large segment count.
Subsequent allocation operations on the tag will preallocate some multiple of
that count.  BUS_SPACE_UNRESTRICTED therefore indicates something like:
malloc(infinity).

Discussed with:	bcr, jhb (earlier version)
2020-04-15 01:39:17 +00:00
John Baldwin
e2b9919398 Remove support for geli(4) algorithms deprecated in r348206.
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
2020-04-15 00:14:50 +00:00
Kyle Evans
30b4df2e4a tests: audit: mark closefrom test an expected fail for now
closefrom has been converted to close_range internally; remediation is
underway for this, marking it as an expected fail for now while proper
course is determined.

PR:		245625
2020-04-14 23:36:03 +00:00
Kyle Evans
7851fb8ecb closefrom: clamp lowfd to >= 0; close_range's parameters are unsigned.
Pointy hat:	kevans
Reported by:	CI (lwhsu)
2020-04-14 23:24:24 +00:00
Alexander V. Chernikov
9ac7c6cfed Convert IP/IPv6 forwarding, ICMP processing and IP PCB laddr selection to
the new routing KPI.

Reviewed by:	ae
Differential Revision:	https://reviews.freebsd.org/D24245
2020-04-14 23:06:25 +00:00
Rick Macklem
fb8ed4c5f8 Fix the NFSv2 extended attribute support to handle 0 length attributes.
I did not realize that zero length attributes are allowed, but they are.
This patch fixes the NFSv4.2 client and server to handle zero length
extended attributes correctly.

Submitted by:	Frank van der Linden <fllinden@amazon.com> (earlier version)
Reported by:	Frank van der Linden <fllinder@amazon.com>
2020-04-14 22:57:21 +00:00
Alexander V. Chernikov
dd4776f0cc Reorganise nd6 notification code to avoid direct rtentry field access.
One of the goals of the new routing KPI defined in r359823 is to entirely hide
 `struct rtentry` from the consumers. Doing so will allow to improve routing
 subsystem internals and deliver features more easily. This change is one of
  the ongoing changes to eliminate direct struct rtentry field accesses.

It introduces rtfree_func() wrapper around RTFREE() and reorganises nd6 notification
 code to avoid accessing most of the rtentry fields.

Reviewed by:	ae
Differential Revision:	https://reviews.freebsd.org/D24404
2020-04-14 22:48:33 +00:00
Emmanuel Vadot
47d45507e8 modules: dtb: allwinner: Remove sun50i-a64-sid.dtso
File was removed in r359935

MFC after:	2 month
X-MFC-With:	r359935
2020-04-14 22:16:40 +00:00
Brooks Davis
618a20d4f9 Remove bogus use of useracc() in (clock_)nanosleep.
There's no point in pre-checking that we can access the user's rmtp
pointer before we do it in copyout().

While here, improve style(9) compliance.

Reviewed by:	imp
MFC after:	1 week
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D24409
2020-04-14 20:53:12 +00:00
Brooks Davis
562894f0dc Centralize compatability translation macros.
Copy the CP, PTRIN, etc macros from freebsd32.h into a sys/abi_compat.h
and replace existing definitation with includes where required. This
eliminates duplicate code and allows Linux and FreeBSD compatability
headers to be included in the same files.

Input from:	cem, jhb
Obtained from:	CheriBSD
MFC after:	2 weeks
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D24275
2020-04-14 20:30:48 +00:00
Emmanuel Vadot
c23ca622a2 modules: dtb: allwinner: Remove non existant files
Those files have been removed in r359935.

MFC after:	2 months
X-MFC-With:	r359935
2020-04-14 20:20:08 +00:00
Emmanuel Vadot
d6b4447496 allwinner: aw_thermal: Cope with DTS changes
The upstream DTS now include the thermal device node and the SID
calibration entry.
Update our driver to cope with this change and remove the DTB
overlays that aren't needed anymore.

MFC after:	2 months
X-MFC-With:	r359934
2020-04-14 19:05:17 +00:00
Emmanuel Vadot
211b4e4259 dts: Import DTS from Linux 5.6 2020-04-14 18:57:00 +00:00
Emmanuel Vadot
62dc472bdb files: Add mmc_fdt_helpers for mmccam enabled config
MFC after:	1 month
X-MFC-With:	r359924
2020-04-14 18:11:54 +00:00
Kyle Evans
e19b97f7a0 sysent: re-roll after r359930 2020-04-14 18:11:26 +00:00
Kyle Evans
7d03e08112 Mark closefrom(2) COMPAT12, reimplement in libc to wrap close_range
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
2020-04-14 18:07:42 +00:00
Emmanuel Vadot
937eaf8bbd Import DTS files from Linux 5.6 2020-04-14 16:56:11 +00:00
Emmanuel Vadot
a1af70e58b arm: dwmmc: Use mmc_fdt_helpers
Use the mmc_fdt_parse function instead of parsing everything in the
driver.

MFC after:	1 month
2020-04-14 16:35:18 +00:00
Michael Tuexen
b89af8e16d Improve the TCP blackhole detection. The principle is to reduce the
MSS in two steps and try each candidate two times. However, if two
candidates are the same (which is the case in TCP/IPv6), this candidate
was tested four times. This patch ensures that each candidate actually
reduced the MSS and is only tested 2 times. This reduces the time window
of missclassifying a temporary outage as an MTU issue.

Reviewed by:		jtl
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D24308
2020-04-14 16:35:05 +00:00
Emmanuel Vadot
9ed8321078 arm: allwinner: aw_mmc: Use the mmc_fdt_helper
The fdt properties are now parsed via the help of mmc_fdt_helper functions.
This also adds card detection.
Note that on some boards (like the Pine64) card detection is broken due to
a missing resistor on the cd pin.

MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D23268
2020-04-14 16:34:13 +00:00
Emmanuel Vadot
e63fbd7bb7 Those functions are here to help fdt mmc controller drivers to parse
the dts to find the supported speeds and the regulators.
Not all DTS have every settings properly defined so host controller
will still have to add some caps themselves.
It also add a mmc_fdt_gpio_setup function which will read the cd-gpios
property and register it as the CD pin.
If the pin support interrupts one will be registered and the cd_helper
function will be called.
If the pin doesn't support interrupts the internal taskqueue will poll
for change and call the same cd_helper function.
mmc_fdt_gpio_setup will also parse the wp-gpio property and MMC drivers
can know the write-protect pin value by calling the
mmc_fdt_gpio_get_readonly function.

MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D23267
2020-04-14 16:30:54 +00:00
Jonathan T. Looney
fb401f1bba Make sonewconn() overflow messages have per-socket rate-limits and values.
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
2020-04-14 15:38:18 +00:00
Jonathan T. Looney
f6ab9795d4 Print more detail as part of the sonewconn() overflow message.
When a socket's listen queue overflows, sonewconn() emits a debug-level
log message. These messages are sometimes useful to systems administrators
in highlighting a process which is not keeping up with its listen queue.

This commit attempts to enhance the usefulness of this message by printing
more details about the socket's address. If all else fails, it will at
least print the domain name of the socket.

Reviewed by:	bz, jhb, kbowling
MFC after:	2 weeks
Sponsored by:	Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D24272
2020-04-14 15:30:34 +00:00
Jonathan T. Looney
a5d22a7fed Make the path length of UNIX domain sockets specified by a #define.
Also, add a comment describing the historical context for this length.

Reviewed by:	bz, jhb, kbowling (previous version)
MFC after:	2 weeks
Sponsored by:	Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D24272
2020-04-14 15:27:24 +00:00
Andrew Gallatin
4d77243c65 Bump FreeBSD version after r359919 (KTLS / unmapped mbuf changes)
The above changes mbufs, and any module using unmapped mbufs
would need to be re-compiled.

Sponsored by:	Netflix
2020-04-14 14:48:00 +00:00
Andrew Gallatin
23feb56348 KTLS: Re-work unmapped mbufs to carry ext_pgs in the mbuf itself.
While the original implementation of unmapped mbufs was a large
step forward in terms of reducing cache misses by enabling mbufs
to carry more than a single page for sendfile, they are rather
cache unfriendly when accessing the ext_pgs metadata and
data. This is because the ext_pgs part of the mbuf is allocated
separately, and almost guaranteed to be cold in cache.

This change takes advantage of the fact that unmapped mbufs
are never used at the same time as pkthdr mbufs. Given this
fact, we can overlap the ext_pgs metadata with the mbuf
pkthdr, and carry the ext_pgs meta directly in the mbuf itself.
Similarly, we can carry the ext_pgs data (TLS hdr/trailer/array
of pages) directly after the existing m_ext.

In order to be able to carry 5 pages (which is the minimum
required for a 16K TLS record which is not perfectly aligned) on
LP64, I've had to steal ext_arg2. The only user of this in the
xmit path is sendfile, and I've adjusted it to use arg1 when
using unmapped mbufs.

This change is almost entirely mechanical, except that we
change mb_alloc_ext_pgs() to no longer allow allocating
pkthdrs, the change to avoid ext_arg2 as mentioned above,
and the removal of the ext_pgs zone,

This change saves roughly 2% "raw" CPU (~59% -> 57%), or over
3% "scaled" CPU on a Netflix 100% software kTLS workload at
90+ Gb/s on Broadwell Xeons.

In a follow-on commit, I plan to remove some hacks to avoid
access ext_pgs fields of mbufs, since they will now be in
cache.

Many thanks to glebius for helping to make this better in
the Netflix tree.

Reviewed by:	hselasky, jhb, rrs, glebius (early version)
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D24213
2020-04-14 14:46:06 +00:00
Kyle Evans
51a16c8412 posixshm: fix counting of writable mappings
Similar to mmap'ing vnodes, posixshm should count any mapping where maxprot
contains VM_PROT_WRITE (i.e. fd opened r/w with no write-seal applied) as
writable and thus blocking of any write-seal.

The memfd tests have been amended to reflect the fixes here, which notably
includes:

1. Fix for error return bug; EPERM is not a documented failure mode for mmap
2. Fix rejection of write-seal with active mappings that can be upgraded via
    mprotect(2).

Reported by:	markj
Discussed with:	markj, kib
2020-04-14 13:32:03 +00:00
Alexander V. Chernikov
6722086045 Plug netmask NULL check during route addition causing kernel panic.
This bug was introduced by the r359823.

Reported by:	hselasky
2020-04-14 13:12:22 +00:00
Mateusz Piotrowski
789e4d2f20 Improve manual page formatting
-	Use appropriate macros for command arguments.
-	Increase option list indentation for better readability.

MFC after:	3 days
2020-04-14 10:10:31 +00:00