]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoClean up fstat.1
0mp [Wed, 17 Jun 2020 21:21:57 +0000 (21:21 +0000)]
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).

MFC after: 1 week

4 years agoWhen converting the static arrays to mallocarray() in r356621 I missed
bz [Wed, 17 Jun 2020 21:04:38 +0000 (21:04 +0000)]
When converting the static arrays to mallocarray() in r356621 I missed
one place where we now need to multiply the size of the struct with the
number of entries.  This lead to problems when restarting user space
daemons, as the cleanup was never properly done, resulting in MRT_ADD_VIF
EADDRINUSE.
Properly zero all array elements to avoid this problem.

PR: 246629, 206583
Reported by: (many)
MFC after: 4 days
Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate")

4 years agoThe call into ifa_ifwithaddr() needs to be epoch protected; ortherwise
bz [Wed, 17 Jun 2020 20:58:37 +0000 (20:58 +0000)]
The call into ifa_ifwithaddr() needs to be epoch protected; ortherwise
we'll panic on an assertion.
While here, leave a comment that the ifp was never protected and stable
(as glebius pointed out) and this needs to be fixed properly.

Discovered while working on: PR 246629
Reviewed by: glebius
MFC after: 4 days
Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate")

4 years agoClean up the pci host generic driver
andrew [Wed, 17 Jun 2020 19:56:17 +0000 (19:56 +0000)]
Clean up the pci host generic driver

 - Support Prefetchable Memory.
 - Use the correct rman when allocating memory and ioports.
 - Translate PCI addresses in bus_alloc_resource to allow physical
   addresses that are different than pci addresses.

Reviewed by: Robert Crowston <crowston_protonmail.com>
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D25121

4 years agoSupport pmap_extract_and_hold on arm64 stage 2 mappings
andrew [Wed, 17 Jun 2020 19:45:05 +0000 (19:45 +0000)]
Support pmap_extract_and_hold on arm64 stage 2 mappings

Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D24469

4 years agoFix admin qpair leak if detached during initial reset.
mav [Wed, 17 Jun 2020 17:51:40 +0000 (17:51 +0000)]
Fix admin qpair leak if detached during initial reset.

MFC after: 1 week
Sponsored by: iXsystems, Inc.

4 years agoRemove vfs_statfs and vnode_mount macros from NFS
asomers [Wed, 17 Jun 2020 16:20:19 +0000 (16:20 +0000)]
Remove vfs_statfs and vnode_mount macros from NFS

These macro definitions are no longer needed as the NFS OSX port is long
dead.  The vfs_statfs macro conflicts with the vfsops field of the same
name.

Submitted by: shivank@
Reviewed by: rmacklem
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2020)
Differential Revision: https://reviews.freebsd.org/D25263

4 years agoFix installation of magic file.
delphij [Wed, 17 Jun 2020 15:57:59 +0000 (15:57 +0000)]
Fix installation of magic file.

Reported by: lwhsu
MFC after: 2 weeks
X-MFC-with: r362258

4 years agoComplete the ACPI support for ARM Coresight:
br [Wed, 17 Jun 2020 15:54:51 +0000 (15:54 +0000)]
Complete the ACPI support for ARM Coresight:
o Parse the ACPI DSD (Device Specific Data) graph property and record
  device connections.
o Split-out FDT support to a separate file.
o Get the corresponding (FDT/ACPI) Coresight platform data in
  the device drivers.

Sponsored by: DARPA, AFRL

4 years agoAllow the self reference to be NULL in case the timer was stopped.
tuexen [Wed, 17 Jun 2020 15:27:45 +0000 (15:27 +0000)]
Allow the self reference to be NULL in case the timer was stopped.

Submitted by: Timo Voelker
MFC after: 1 week

4 years agoAdd header definition for RFC4340, Datagram Congestion Control Protocol
thj [Wed, 17 Jun 2020 13:27:13 +0000 (13:27 +0000)]
Add header definition for RFC4340, Datagram Congestion Control Protocol

Add a header definition for DCCP as defined in RFC4340. This header definition
is required to perform validation when receiving and forwarding DCCP packets.
We do not currently support DCCP.

Reviewed by: gallatin, bz
Approved by: bz (co-mentor)
MFC after: 1 week
MFC with: 350749
Differential Revision: https://reviews.freebsd.org/D21179

4 years agoctime(3): Bump .Dd after r362165
gbe [Wed, 17 Jun 2020 11:57:48 +0000 (11:57 +0000)]
ctime(3): Bump .Dd after r362165

Reported by: bcr (mentor)
Reviewed by: bcr (mentor)
Approved by: bcr (mentor)
X-MFC-With: r362165

4 years agoAdd all the TCR_EL1 fields
andrew [Wed, 17 Jun 2020 11:56:10 +0000 (11:56 +0000)]
Add all the TCR_EL1 fields

These will be used when adding support for new Armv8 extensions.

Sponsored by: Innovate UK

4 years agoFix HW TLS offload regression issue after r359919, in mlx5en(4).
hselasky [Wed, 17 Jun 2020 11:14:54 +0000 (11:14 +0000)]
Fix HW TLS offload regression issue after r359919, in mlx5en(4).

Changes in the mbuf layout regarding HW TLS, resulted in wrong detection
of starting mbuf. Use a boolean variable to handle this and pass m_adj()
the top mbuf, so that the packet header is adjusted correctly.

MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoAllow multicast packets to be received in promiscious mode, in mlx4en(4).
hselasky [Wed, 17 Jun 2020 11:12:10 +0000 (11:12 +0000)]
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.

MFC after: 1 week
Found by: Tycho Nightingale <tychon@freebsd.org>
Sponsored by: Mellanox Technologies

4 years agoloader: r362262 did miss the pathlen check
tsoome [Wed, 17 Jun 2020 10:56:58 +0000 (10:56 +0000)]
loader: r362262 did miss the pathlen check

While we are checking the "/dev/" prefix, we can skip the paths shorter than
this prefix.

Sponsored by: Netflix, Klara Inc.

4 years agoUpdate opencsd to 0.14.2
andrew [Wed, 17 Jun 2020 10:42:20 +0000 (10:42 +0000)]
Update opencsd to 0.14.2

Sponsored by: Innovate UK

4 years agoloader: strings in nvlist are counted strings, not c-strings
tsoome [Wed, 17 Jun 2020 10:41:01 +0000 (10:41 +0000)]
loader: strings in nvlist are counted strings, not c-strings

We need to fetch both string size and data, then handle the data.

Reviewed by: allanjude
Sponsored by: Netflix, Klara Inc.

4 years agoRe-apply r333944 to unbreak ports
antoine [Wed, 17 Jun 2020 10:11:54 +0000 (10:11 +0000)]
Re-apply r333944 to unbreak ports

4 years agoevdev: Add AT translated set1 scancodes for 'Eisu' & 'Kana' keys.
wulf [Wed, 17 Jun 2020 08:35:35 +0000 (08:35 +0000)]
evdev: Add AT translated set1 scancodes for 'Eisu' & 'Kana' keys.

PR: 247292
Submitted by: Yuichiro NAITO <naito.yuichiro@gmail.com>
MFC after: 1 week

4 years agoloader: vidc_init should also erase the screen
tsoome [Wed, 17 Jun 2020 08:08:57 +0000 (08:08 +0000)]
loader: vidc_init should also erase the screen

Inject \e[J to erase the initial loader screen. We have two options,
find where out cursor is and use BIOS scroll for data from boot2 or erase the
display and start from origin. Erasing the screen is easier and we also
get the screen buffer initialized.

Sponsored by: Netflix, Klara Inc.

4 years agoMFV r362254: file 5.39.
delphij [Wed, 17 Jun 2020 07:41:28 +0000 (07:41 +0000)]
MFV r362254: file 5.39.

MFC after: 2 weeks

4 years ago[ath] Mention DWDS, expresscard and minipcie.
adrian [Wed, 17 Jun 2020 03:16:20 +0000 (03:16 +0000)]
[ath] Mention DWDS, expresscard and minipcie.

I use all of these..

4 years ago[run] mention that some 11n functionality is now available.
adrian [Wed, 17 Jun 2020 03:12:43 +0000 (03:12 +0000)]
[run] mention that some 11n functionality is now available.

A-MPDU, short-gi and 40MHz mode is currently not supported, but hey,
it supports enough 11n to be useful.

4 years agoVendor import of file 5.39.
delphij [Wed, 17 Jun 2020 01:11:26 +0000 (01:11 +0000)]
Vendor import of file 5.39.

4 years agovm: Drop vm_map_clip_{start,end} macro wrappers
cem [Tue, 16 Jun 2020 22:53:56 +0000 (22:53 +0000)]
vm: Drop vm_map_clip_{start,end} macro wrappers

No functional change.

Reviewed by: dougm, markj
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D25282

4 years agoApply default security flavor in vfs_export
freqlabs [Tue, 16 Jun 2020 21:30:30 +0000 (21:30 +0000)]
Apply default security flavor in vfs_export

There may be some version of mountd out there that does not supply a default
security flavor when none is given for an export.

Set the default security flavor in vfs_export if none is given, and remove the
workaround for oexport compat.

Reported by: npn
Reviewed by: rmacklem
Approved by: mav (mentor)
MFC after: 3 days
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D25300

4 years agortld: Allow to load ET_DYN && DF_1_PIE when tracing.
kib [Tue, 16 Jun 2020 21:29:02 +0000 (21:29 +0000)]
rtld: Allow to load ET_DYN && DF_1_PIE when tracing.

This makes old ldd to still work on newer tagged PIE binaries.

Also move debug line for hashes before both decisions to not load are
done, so that the end of digest_dynamic() processing and reason to not
load or load is seen in debug trace.

Noted by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

4 years agortld: Add debug line for dlopen_object().
kib [Tue, 16 Jun 2020 21:25:58 +0000 (21:25 +0000)]
rtld: Add debug line for dlopen_object().

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

4 years agoSystematically pass RTLD_LO_TRACE to load_needed_objects().
kib [Tue, 16 Jun 2020 21:23:39 +0000 (21:23 +0000)]
Systematically pass RTLD_LO_TRACE to load_needed_objects().

Which makes all calls to load_object() to observe the flag, except the
calls for preloaded DSOs.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

4 years agoComplete a function block with Fc, no content change.
pluknet [Tue, 16 Jun 2020 21:07:51 +0000 (21:07 +0000)]
Complete a function block with Fc, no content change.

Notably, unbreaks rendering with groff.

4 years agoAdd an entry for r362158, r362163, which changes struct export_args.
rmacklem [Tue, 16 Jun 2020 20:55:22 +0000 (20:55 +0000)]
Add an entry for r362158, r362163, which changes struct export_args.

4 years agoUpdate VFS_CHECKEXP.9 for the argument changes done by r362158.
rmacklem [Tue, 16 Jun 2020 20:51:28 +0000 (20:51 +0000)]
Update VFS_CHECKEXP.9 for the argument changes done by r362158.

The arguments for VFS_CHECKEXP() were changed by r362158.
Also, the numsecflavors and secflavors arguments were not documented,
so add these as well.

This is a content change.

4 years agoboot2: need to expand tab output and mask getchar
tsoome [Tue, 16 Jun 2020 20:35:00 +0000 (20:35 +0000)]
boot2: need to expand tab output and mask getchar

The BIOS ouput char function does not expand tab.
Mask getchar with 0xFF.

Sponsored by: Netflix, Klara Inc.

4 years agoImprove unit parsing of mpsutil.
jmallett [Tue, 16 Jun 2020 19:21:28 +0000 (19:21 +0000)]
Improve unit parsing of mpsutil.

Previously, it used atoi(3) to parse the unit parameter, which would silently
yield a unit of 0 in the presence of an invalid unit number.  As most users of
mpsutil(8) are likely to have at least a unit 0, this is could have confusing
results.

This behaviour was particularly unintuitive if one incorrectly passed an
adapter device name, or a device path, instead of a unit number.  In addition
to using strtoumax(3) instead of atoi(3) to parse unit numbers, support
stripping a device name (e.g. mps1) or path (e.g. /dev/mps2) to just its unit
number.

Reviewed by: scottl (earlier version)

4 years agollvm: Default to -mno-relax on RISC-V
kp [Tue, 16 Jun 2020 18:39:56 +0000 (18:39 +0000)]
llvm: Default to -mno-relax on RISC-V

Compiling on a RISC-V system fails with 'relocation R_RISCV_ALIGN
requires unimplemented linker relaxation; recompile with -mno-relax'.

Our default linker (ld.lld) doesn't support relaxation, so default to
no-relax so we don't generate object files the linker can't handle.

Reviewed by: mhorne
Sponsored by: Axiado
Differential Revision: https://reviews.freebsd.org/D25210

4 years agoiSo in doing final checks on OCA firmware with all the latest tweaks the dup-ack...
rrs [Tue, 16 Jun 2020 18:16:45 +0000 (18:16 +0000)]
iSo in doing final checks on OCA firmware with all the latest tweaks the dup-ack checking
packet drill script was failing with a number of unexpected acks. So it turns
out if you have the default recvwin set up to 1Meg (like OCA's do) and you
have no window scaling (like the dupack checking code) then we have another
case where we are always trying to update the rwnd and sending an
ack when we should not.

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

4 years agonewsyslog(8): make configuration parser more robust.
eugen [Tue, 16 Jun 2020 17:45:23 +0000 (17:45 +0000)]
newsyslog(8): make configuration parser more robust.

Currently newsyslog supports <include> directive that is used
in our default /etc/newsyslog.conf in the following form:

<include> /usr/local/etc/newsyslog.conf.d/*

While this is suitable for ports installing their own rules
for logs rotation, this also makes newsyslog break entire
processing of all files if it encounters single line it cannot parse.
This includes lines referring to nonexistent username/group for log
ownership, so newsyslog stops calling errx() function in the parser.

With this fix, newsyslog uses warnx() instead of errx() in such cases
to print a warning, recover gracefully and continue with execution.

Among other cases, this unbreaks initial creation of log files
having flag "C" at boot time (newsyslog -CN). This is most important
for systems having RAM-based /var file system like nanobsd(8)-based
that rely on newsyslog to bring system log files into existence.

MFC after: 1 month

4 years agoFix pointer name to match the name used in the function prototype
blackend [Tue, 16 Jun 2020 17:05:38 +0000 (17:05 +0000)]
Fix pointer name to match the name used in the function prototype
above (and in termios.c).

Discussed with: Rodney W. Grimes <rgrimes@FreeBSD.org>

4 years agoMake KENV_MVALLEN tunable
sjg [Tue, 16 Jun 2020 17:02:56 +0000 (17:02 +0000)]
Make KENV_MVALLEN tunable

When doing secure boot, loader wants to export loader.ve.hashed
the value of which typically exceeds KENV_MVALLEN.

Replace use of KENV_MVALLEN with tunable kenv_mvallen.

Add getenv_string_buffer() for the case where a stack buffer cannot be
created and use uma_zone_t kenv_zone for suitably sized buffers.

Reviewed by: stevek, kevans
Obtained from: Abhishek Kulkarni <abkulkarni@juniper.net>
MFC after: 1 week
Sponsored by: Juniper Networks
Differential Revision: https://reviews.freebsd.org//D25259

4 years agolibcasper(3): Document HISTORY within the manpages
gbe [Tue, 16 Jun 2020 16:48:52 +0000 (16:48 +0000)]
libcasper(3): Document HISTORY within the manpages

Reviewed by: bcr (mentor)
Approved by: bcr (mentor)
MFC after: 7 days
Differential Revision: https://reviews.freebsd.org/D24695

4 years agocmp(1): Add EXAMPLES section
fernape [Tue, 16 Jun 2020 15:54:59 +0000 (15:54 +0000)]
cmp(1): Add EXAMPLES section

Add simple examples showing the use of -l, -z, stdin and offsets

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

4 years agoFix typo in the documentation about the daily ntpd status
bapt [Tue, 16 Jun 2020 12:40:19 +0000 (12:40 +0000)]
Fix typo in the documentation about the daily ntpd status

PR: 245679
Submitted by: Taylor Stearns <t@tstearns.com>
MFC after: 3 days

4 years agoSo it turns out rack has a shortcoming in dup-ack counting. It counts the dupacks but
rrs [Tue, 16 Jun 2020 12:26:23 +0000 (12:26 +0000)]
So it turns out rack has a shortcoming in dup-ack counting. It counts the dupacks but
then does not properly respond to them. This is because a few missing bits are not present.
BBR actually does properly respond (though it also sends a TLP which is interesting and
maybe something to fix)..

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

4 years agoRe-add opencsd as a vendor import from the dist directory
andrew [Tue, 16 Jun 2020 08:59:44 +0000 (08:59 +0000)]
Re-add opencsd as a vendor import from the dist directory

Sponsored by: Innovate UK

4 years agoRemove opencsd so I can re-import it with the correct ancestry
andrew [Tue, 16 Jun 2020 08:57:13 +0000 (08:57 +0000)]
Remove opencsd so I can re-import it with the correct ancestry

Sponsored by: Innovate UK

4 years agoloader: zfs_cmd.c does not really compile without libzfs.h
tsoome [Tue, 16 Jun 2020 07:30:34 +0000 (07:30 +0000)]
loader: zfs_cmd.c does not really compile without libzfs.h

Having libzfs.h wrapped in LOADER_ZFS_SUPPORT check does not really make sense,
because we do need function declarations with C99.

Sponsored by: Netflix, Klara Inc.

4 years agoloader: variable i is unused without MBR/GPT support built in
tsoome [Tue, 16 Jun 2020 07:05:03 +0000 (07:05 +0000)]
loader: variable i is unused without MBR/GPT support built in

Because i is only used as index in for loop, declare it in for statement.

Sponsored by: Netflix, Klara Inc.

4 years ago[ifconfig] add UAPSD and LPDC flags
adrian [Tue, 16 Jun 2020 04:17:08 +0000 (04:17 +0000)]
[ifconfig] add UAPSD and LPDC flags

* Add UAPSD and LDPC flags
* expand the FLAGS section; it's kinda grown since I started hacking
  on net80211..

4 years agoMake use of the UID_NOBODY and GID_NOGROUP definitions in sys/conf.h.
rmacklem [Tue, 16 Jun 2020 02:35:30 +0000 (02:35 +0000)]
Make use of the UID_NOBODY and GID_NOGROUP definitions in sys/conf.h.

r362214 exposed UID_NOBODY and GID_NOGROUP to userspace, so use them
instead of the numbers.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D25281

4 years agoExpose UID_xxx and GID_xxx definitions to userspace.
rmacklem [Tue, 16 Jun 2020 02:31:22 +0000 (02:31 +0000)]
Expose UID_xxx and GID_xxx definitions to userspace.

This patch moves the UID_xxx and GID_xxx definitions out of the
#ifdef _KERNEL section, so that userspace programs like mountd
can use them.
There are a couple of userspace programs that do define UID_ROOT,
but they do not include sys/conf.h.  Since they are defined as
the same value, maybe they should be changed to include sys/conf.h.

Reviewed by: kib
Differential Revision: https:/reviews.freebsd.org/D25281

4 years ago[rsu] Update wme ie API use.
adrian [Tue, 16 Jun 2020 01:11:40 +0000 (01:11 +0000)]
[rsu] Update wme ie API use.

Whoops, forgot to land this one too!

4 years ago[net80211] Add missing commit to previous-1 uapsd commit.
adrian [Tue, 16 Jun 2020 00:28:45 +0000 (00:28 +0000)]
[net80211] Add missing commit to previous-1 uapsd commit.

Whoops; somehow my big commit line didn't include this..  cue the tree breakage emails.

4 years ago[net80211] Add uapsd option to ifconfig
adrian [Tue, 16 Jun 2020 00:28:08 +0000 (00:28 +0000)]
[net80211] Add uapsd option to ifconfig

Add an enable/disable option for controlling uapsd.  I'm not yet controlling
the individual AC configs or the service period.

4 years ago[net80211] Add initial U-APSD negotiation support.
adrian [Tue, 16 Jun 2020 00:27:32 +0000 (00:27 +0000)]
[net80211] Add initial U-APSD negotiation support.

U-APSD (unscheduled automatic power save delivery) is a power save method
that's a bit better than legacy PS-POLL - stations can mark frames with
an extra flag that tells the AP to leak out more frames after it sends
its own frames rather than needing to send a PS-POLL to get another frame
from the AP.

Now, this code just handles the negotiation bits; it doesn't actually
implement U-APSD.  That's up to drivers, and nothing in the tree yet
implements this.  I /may/ implement this for ath(4) if I eventually care
enough but right now I plan on just implementing it for firmware offload
based NICs that handle this in the NIC.

I'll commit the ifconfig bit after this and I may have some follow-up
commits as this gets used more by me in local testing.

This should be a glorious no-op for everyone else.  If things change
for anyone that isn't fixed by a complete recompile then please reach out
to me.

4 years agoMake Linux uname(2) return x86_64 to 32-bit apps. This helps Steam.
trasz [Mon, 15 Jun 2020 20:12:10 +0000 (20:12 +0000)]
Make Linux uname(2) return x86_64 to 32-bit apps.  This helps Steam.

PR: kern/240432
Analyzed by by: Alex S <iwtcex@gmail.com>
Reviewed by: emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25248

4 years agoif_vtnet: let vtnet_rx_vq_intr() and vtnet_rxq_tq_intr() share code
vmaffione [Mon, 15 Jun 2020 19:46:34 +0000 (19:46 +0000)]
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
MFC after: 2 weeks

4 years agoRemove the sed hack for ABI tag notes.
jhb [Mon, 15 Jun 2020 19:38:48 +0000 (19:38 +0000)]
Remove the sed hack for ABI tag notes.

The ELF notes compiled in C were placed in a section with the wrong type
(SHT_PROGBITS instead of SHT_NOTE).  Previously, sed was used on the
generated assembly to rewrite the section type.  Instead, write the notes
in assembly which permits setting the correct section type directly.

While here, move inline assembly entry points out of C and into assembly
for aarch64, arm, and riscv.

Reviewed by: kib
Tested on: amd64 (cirrus-ci), riscv64
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D25211

4 years agoSimplify MACHINE_ARCH to be a single string.
jhb [Mon, 15 Jun 2020 18:57:43 +0000 (18:57 +0000)]
Simplify MACHINE_ARCH to be a single string.

Big endian and armv4 mean that we are now down to only two supported
variants.  A future change will use MACHINE_ARCH in assembly which
does not support C-style string concatentation and thus needs
MACHINE_ARCH defined as a single string.

Reviewed by: imp
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D25211

4 years agoAvoid trying to toggle TSO twice
freqlabs [Mon, 15 Jun 2020 16:35:27 +0000 (16:35 +0000)]
Avoid trying to toggle TSO twice

Remove TSO from the toggle mask when automatically disabled by TXCKSUM* in
various NIC drivers.

Reviewed by: hselasky, np, gallatin, jpaetzel
Approved by: mav (mentor)
MFC after: 1 week
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D25120

4 years agoUpdate event masks constant to Bluetooth core spec V5.2
takawata [Mon, 15 Jun 2020 14:58:40 +0000 (14:58 +0000)]
Update event masks constant to Bluetooth core spec V5.2
and add LE Events.

PR: 247257
Submitted by: Marc Veldman

4 years agoImport OpenCSD v0.14.2
andrew [Mon, 15 Jun 2020 11:30:04 +0000 (11:30 +0000)]
Import OpenCSD v0.14.2

Sponsored by: Innovate UK

4 years agomd5(1): fix style in man page
fernape [Mon, 15 Jun 2020 10:08:02 +0000 (10:08 +0000)]
md5(1): fix style in man page

Fix a bunch of style problems reported by mandoc(1) and igor:

mandoc: ./md5.1:19:71: STYLE: no blank before trailing delimiter: Nm ... rmd160,
mandoc: ./md5.1:20:23: STYLE: no blank before trailing delimiter: Nm ...  skein512,
mandoc: ./md5.1:33:2: STYLE: useless macro: Tn
mandoc: ./md5.1:33:2: STYLE: useless macro: Tn
mandoc: ./md5.1:33:2: STYLE: useless macro: Tn
mandoc: ./md5.1:33:2: STYLE: useless macro: Tn
mandoc: ./md5.1:35:2: STYLE: useless macro: Tn
mandoc: ./md5.1:42:2: STYLE: useless macro: Tn
mandoc: ./md5.1:45:2: STYLE: useless macro: Tn
mandoc: ./md5.1:47:2: STYLE: useless macro: Tn
mandoc: ./md5.1:56:2: STYLE: useless macro: Tn
mandoc: ./md5.1:58:2: STYLE: useless macro: Tn
mandoc: ./md5.1:61:2: STYLE: useless macro: Tn
mandoc: ./md5.1:66:2: STYLE: useless macro: Tn
mandoc: ./md5.1:68:2: STYLE: useless macro: Tn
mandoc: ./md5.1:104:24: STYLE: no blank before trailing delimiter: Nm skein512,
mandoc: ./md5.1:117:6: STYLE: referenced manual not found: Xr sha224 3

igor:
md5.1:46:no comma after "i.e.":either algorithm, [i.e.] to find an input that produces a specific

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

4 years agovtnet: Fix regression introduced in r361944
jrtc27 [Sun, 14 Jun 2020 22:39:34 +0000 (22:39 +0000)]
vtnet: Fix regression introduced in r361944

For legacy devices that don't support MrgRxBuf (such as bhyve pre-r358180),
r361944 failed to update the receive handler to account for the additional
padding introduced by the unused num_buffers field that is now always present
in struct vtnet_rx_header. Thus, calculate the padding dynamically based on
vtnet_hdr_size.

PR: 247242
Reported by: thj
Tested by: thj

4 years agoiflib: netmap: enter/exit netmap mode after device stops
vmaffione [Sun, 14 Jun 2020 21:07:12 +0000 (21:07 +0000)]
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.

MFC after: 1 week

4 years agozfsboot: cstyle cleanup
tsoome [Sun, 14 Jun 2020 20:57:24 +0000 (20:57 +0000)]
zfsboot: cstyle cleanup

No functional changes intended.

Sponsored by: Netflix, Klara Inc.

4 years agonetmap: vtnet: fix races in vtnet_netmap_reg()
vmaffione [Sun, 14 Jun 2020 20:47:31 +0000 (20:47 +0000)]
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.

MFC after: 1 week

4 years agosh/tests: Add tests for SIGINT in non-jobc background commands
jilles [Sun, 14 Jun 2020 19:41:24 +0000 (19:41 +0000)]
sh/tests: Add tests for SIGINT in non-jobc background commands

If job control is not enabled, background commands shall ignore SIGINT and
SIGQUIT, and it shall be possible to override that ignore in the same shell.

MFC after: 1 week

4 years ago[PowerPC] Fix scc z8530 driver
bdragon [Sun, 14 Jun 2020 16:47:16 +0000 (16:47 +0000)]
[PowerPC] Fix scc z8530 driver

Parts of the z8530 driver were still using the SUN channel spacing.

This was invalid on PowerMac and QEMU, where the attachment was to escc,
not escc-legacy. This means the driver has apparently NEVER worked properly
on Macintosh hardware.

Add documentation for the channel spacing details, and change to using
driver-specific initialization instead of hardcoded spacing so either
spacing can be used.

Fixes boot hang in QEMU when using the serial console, and fixes use on
Xserve serial (and presumably PowerMacs that have a Stealth Serial port
or similar)

Reviewed by: jhibbits
Sponsored by: Tag1 Consulting, Inc.
Differential Revision: https://reviews.freebsd.org/D24661

4 years agoAllocate the mbuf for the signature in the COOKIE or the correct size.
tuexen [Sun, 14 Jun 2020 16:05:08 +0000 (16:05 +0000)]
Allocate the mbuf for the signature in the COOKIE or the correct size.
While there, do also do some cleanups.

MFC after: 1 week

4 years agoMake linux(4) warn about unsupported CMSG level/type.
trasz [Sun, 14 Jun 2020 14:38:40 +0000 (14:38 +0000)]
Make linux(4) warn about unsupported CMSG level/type.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25255

4 years agoAdd support for the timecreate attribute
dfr [Sun, 14 Jun 2020 11:41:57 +0000 (11:41 +0000)]
Add support for the timecreate attribute

This maps to the va_birthtime VFS attribute.

4 years agoloader.efi: update console after gfx mode change
tsoome [Sun, 14 Jun 2020 10:13:40 +0000 (10:13 +0000)]
loader.efi: update console after gfx mode change

The gfx mode change should be coordinated with console setup.

4 years agoCleanups, no functional change.
tuexen [Sun, 14 Jun 2020 09:50:00 +0000 (09:50 +0000)]
Cleanups, no functional change.

MFC after: 1 week

4 years agoMove font related data structured to sys/font.c and update vtfontcvt
tsoome [Sun, 14 Jun 2020 06:58:58 +0000 (06:58 +0000)]
Move font related data structured to sys/font.c and update vtfontcvt

Prepare support to be able to handle font data in loader, consolidate
data structures to sys/font.h and update vtfontcvt.

vtfontcvt update is about to output set of glyphs in form of C source,
the implementation does allow to output compressed or uncompressed font
bitmaps.

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

4 years agolibc manpages: various improvements from NetBSD
gbe [Sun, 14 Jun 2020 05:59:30 +0000 (05:59 +0000)]
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
MFC after: 7 days
Differential Revision: https://reviews.freebsd.org/D24650

4 years agoAdd HISTORY sections to ZFS and dtrace manpage
gbe [Sun, 14 Jun 2020 05:50:28 +0000 (05:50 +0000)]
Add HISTORY sections to ZFS and dtrace manpage

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

4 years agolibutil: Document function HISTORY within the manpages
gbe [Sun, 14 Jun 2020 05:35:02 +0000 (05:35 +0000)]
libutil: Document function HISTORY within the manpages

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

4 years agoAdd a HISTORY section to ctime(3)
gbe [Sun, 14 Jun 2020 05:08:15 +0000 (05:08 +0000)]
Add a HISTORY section to ctime(3)

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

4 years agoOops, r362158 committed a duplicate definition of MAXSECFLAVORS.
rmacklem [Sun, 14 Jun 2020 01:22:19 +0000 (01:22 +0000)]
Oops, r362158 committed a duplicate definition of MAXSECFLAVORS.

This patch gets rid of the duplicate.

4 years agoModify mountd to use the new struct export_args committed by r362158.
rmacklem [Sun, 14 Jun 2020 00:40:00 +0000 (00:40 +0000)]
Modify mountd to use the new struct export_args committed by r362158.

r362158 modified struct export_args for make the ex_flags field 64bits
and also changed the anonymous credentials to allow more than 16 groups.
This patch fixes mountd.c to use the new structure.
It does allocate larger exportlist and grouplist structures now.
That will be fixed in a future commit.
The only visible change will be that the credentials provided for the
-maproot and -mapall exports options can now have more than 16 groups.

Reviewed by: kib, freqlabs
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D25088

4 years ago[net80211] Treat frames without an rx status as not a decap'ed A-MSDU.
adrian [Sun, 14 Jun 2020 00:23:06 +0000 (00:23 +0000)]
[net80211] Treat frames without an rx status as not a decap'ed A-MSDU.

Drivers for NICs which do A-MSDU decap in hardware / driver will need to
set the rx status, so if it's missing then treat it as not a decap'ed
A-MSDU.

4 years ago[net80211] Also convert the ddb path
adrian [Sun, 14 Jun 2020 00:21:48 +0000 (00:21 +0000)]
[net80211] Also convert the ddb path

Whoops - this belonged in my previous commit.

4 years agoAdd an entry to UPDATING for r362158.
rmacklem [Sun, 14 Jun 2020 00:15:44 +0000 (00:15 +0000)]
Add an entry to UPDATING for r362158.

4 years agoVersion bump for r362158, since the arguments for vfs_checkexp() changed.
rmacklem [Sun, 14 Jun 2020 00:12:29 +0000 (00:12 +0000)]
Version bump for r362158, since the arguments for vfs_checkexp() changed.

4 years agoFix export_args ex_flags field so that is 64bits, the same as mnt_flags.
rmacklem [Sun, 14 Jun 2020 00:10:18 +0000 (00:10 +0000)]
Fix export_args ex_flags field so that is 64bits, the same as mnt_flags.

Since mnt_flags was upgraded to 64bits there has been a quirk in
"struct export_args", since it hold a copy of mnt_flags
in ex_flags, which is an "int" (32bits).
This happens to currently work, since all the flag bits used in ex_flags are
defined in the low order 32bits. However, new export flags cannot be defined.
Also, ex_anon is a "struct xucred", which limits it to 16 additional groups.
This patch revises "struct export_args" to make ex_flags 64bits and replaces
ex_anon with ex_uid, ex_ngroups and ex_groups (which points to a
groups list, so it can be malloc'd up to NGROUPS in size.
This requires that the VFS_CHECKEXP() arguments change, so I also modified the
last "secflavors" argument to be an array pointer, so that the
secflavors could be copied in VFS_CHECKEXP() while the export entry is locked.
(Without this patch VFS_CHECKEXP() returns a pointer to the secflavors
array and then it is used after being unlocked, which is potentially
a problem if the exports entry is changed.
In practice this does not occur when mountd is run with "-S",
but I think it is worth fixing.)

This patch also deleted the vfs_oexport_conv() function, since
do_mount_update() does the conversion, as required by the old vfs_cmount()
calls.

Reviewed by: kib, freqlabs
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D25088

4 years ago[net80211] Handle offloaded AMSDU in AMPDU reordering.
adrian [Sat, 13 Jun 2020 23:35:22 +0000 (23:35 +0000)]
[net80211] Handle offloaded AMSDU in AMPDU reordering.

In the 11n world, most NICs did A-MPDU receive/transmit offloading but
not A-MSDU offloading.  So, the net80211 A-MPDU receive path would just
receive MPDUs, do the reordering bit, pass it up to the rest of
net80211 for crypto decap and then do A-MSDU decap before throwing ethernet
frames up to the rest of the system.

However 11ac and 11ax NICs are increasingly doing A-MSDU offload (and
newer 11ax stuff does socket offload, but hey I don't want to scare people
JUST yet) - so although A-MPDU reordering may be done in the OS, A-MSDUs
look like a normal MPDU.  This means that all the MSDUs are actually
faked into a set of MPDUs with matching 802.11 header - the sequence number,
QoS header and any encryption verification bits (like IV) are just copied.

This shows up as MASSIVE packet loss in net80211, cause after the first MPDU
we just toss the rest.

(And don't get me started about ethernet decap with A-MPDU host reordering;
we'll have to cross that bridge for later 11ac and 11ax bits too.)

Anyway, this work changes each A-MPDU reorder slot into an mbufq.
The mbufq is treated as a whole set of frames to pass up to the stack
and reordered/de-duped as a group.  The last frame in the reorder list
is checked to see if it's an A-MSDU final frame so any duplicates are
correctly tossed rather than double-received.  Other than that, the
rest of the logic is unchanged.

The previous commit did a small subset of this - if there wasn't any reordering
going on then it'd accept the A-MSDUs.  This is the rest of the needed work.

This is a no-op for 11n NICs doing A-MPDU reordering but needing software
A-MSDU decap - they aren't tagged as A-MSDU and so any subsequent
frames added to the reorder slot are tossed.

Tested:

* QCA9880 (ath10k/athp) - STA/AP mode;
* RT3593 (if_rsu) - 11n STA+DWDS mode (I'm committing through it rn);
* QCA9380 (if_ath) - STA/AP mode.

4 years ago[net80211] separate out node allocation and node initialisation.
adrian [Sat, 13 Jun 2020 22:20:02 +0000 (22:20 +0000)]
[net80211] separate out node allocation and node initialisation.

This is a new, optional (for now!) method that drivers can use to separate
node allocation and node initialisation.  Right now they're the same, and
drivers that need to do node allocation via firmware commands need to sleep
and thus they need to defer node allocation into an internal taskqueue.

Right now they're just separate but not deferred.  Later on if I get the time
we'll start deferring the node and key related operations but that requires
making a bunch of other stuff (notably things that generate frames!) also
async/deferred.

Tested:

* RT3593, STA/DWDS mode
* AR9380, STA/AP modes
* QCA9880 (athp) - STA/AP modes

4 years agoRemove usage of empty macro.
tuexen [Sat, 13 Jun 2020 21:23:26 +0000 (21:23 +0000)]
Remove usage of empty macro.

MFC after: 1 week

4 years agoSimpify a condition, no functional change.
tuexen [Sat, 13 Jun 2020 18:38:59 +0000 (18:38 +0000)]
Simpify a condition, no functional change.

MFC after: 1 week

4 years agoFix ldd for PIE binaries after rtld stopped accepting binaries for dlopen.
kib [Sat, 13 Jun 2020 18:21:31 +0000 (18:21 +0000)]
Fix ldd for PIE binaries after rtld stopped accepting binaries for dlopen.

ldd proclaims ET_DYN objects as shared libraries and tries to
dlopen(RTLD_TRACE) them to get dependencies. Since PIE binaries are
ET_DYN | DF_1_PIE, refusal to dlopen such binaries breaks ldd.

Fix it by reading and parsing dynamic segment looking for DF_FLAG_1
and taking DF_1_PIE into account when deciding between binary and
library.

Reported by: Dewayne Geraghty <dewayne@heuristicsystems.com.au>
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D25257

4 years agoprocctl(2): document PROC_KPTI
kib [Sat, 13 Jun 2020 18:19:42 +0000 (18:19 +0000)]
procctl(2): document PROC_KPTI

Reviewed by: bcr
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D25258

4 years agoprocctl(2): consistently refer to the data pointer as 'data'.
kib [Sat, 13 Jun 2020 18:18:34 +0000 (18:18 +0000)]
procctl(2): consistently refer to the data pointer as 'data'.

Reviewed by: bcr
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D25258

4 years agosockstat(1): Add EXAMPLES to man page
fernape [Sat, 13 Jun 2020 17:36:08 +0000 (17:36 +0000)]
sockstat(1): Add EXAMPLES to man page

Add three examples showing the use of -4, -6, -l, -L, -p and -P

Reviewed by: gbe@
Approved by: bcr@

4 years agonvi: fallback to ISO8859-1 as last resort
yuripv [Sat, 13 Jun 2020 14:11:02 +0000 (14:11 +0000)]
nvi: fallback to ISO8859-1 as last resort

Current logic of using user's locale encoding that is UTF-8 doesn't make
much sense if we already failed the looks_utf8() check and skipped
encoding set using "fileencoding" as being UTF-8 as well; fallback to
ISO8859-1 in that case.

Reviewed by: Zhihao Yuan <lichray@gmail.com>
Differential Revision: https://reviews.freebsd.org/D24919

4 years agoawk(1): use -version instead of -V
yuripv [Sat, 13 Jun 2020 09:16:07 +0000 (09:16 +0000)]
awk(1): use -version instead of -V

-V is OpenBSD specific, use -version instead.

While here, fix issue reported by mandoc lint and drop nonexistent
script(7) reference.

PR: 247004
Reviewed by: 0mp, markj
Differential Revision: https://reviews.freebsd.org/D25164

4 years agolocale: exit 1 if unknown keyword was specified
yuripv [Sat, 13 Jun 2020 08:37:24 +0000 (08:37 +0000)]
locale: exit 1 if unknown keyword was specified

PR: 241906
Submitted by: Akos Somfai <akos.somfai@gmail.com>

4 years agoMFV r362143:
cy [Sat, 13 Jun 2020 04:47:59 +0000 (04:47 +0000)]
MFV r362143:

Update sqlite3 to 3.32.2 (3320200).

CVE-2020-11655: SQLite through 3.31.1 allows attackers to cause a denial of
service (segmentation fault) via a malformed window-function query because
the AggInfo object's initialization is mishandled.

CVE-2020-13434: SQLite through 3.32.0 has an integer overflow in
sqlite3_str_vappendf in printf.c.

CVE-2020-13435: SQLite through 3.32.0 has a segmentation fault in
sqlite3ExprCodeTarget in expr.c.

CVE-2020-13630: ext/fts3/fts3.c in SQLite before 3.32.0 has a
use-after-free in fts3EvalNextRow, related to the snippet feature

CVE-2020-13631: SQLite before 3.32.0 allows a virtual table to be renamed
to the name of one of its shadow tables, related to alter.c and build.c.

CVE-2020-13632: ext/fts3/fts3_snippet.c in SQLite before 3.32.0 ha s a
NULL pointer dereference via a crafted matchinfo() query.

PR: 247149
Reported by: spam123@bitbert.com
MFC after: 3 days
Security: vuxml: c4ac9c79-ab37-11ea-8b5e-b42e99a1b9c3
https://nvd.nist.gov/vuln/detail/CVE-2020-11655
https://nvd.nist.gov/vuln/detail/CVE-2020-13434
https://nvd.nist.gov/vuln/detail/CVE-2020-13435
https://nvd.nist.gov/vuln/detail/CVE-2020-13630
https://nvd.nist.gov/vuln/detail/CVE-2020-13631
https://nvd.nist.gov/vuln/detail/CVE-2020-13632

4 years agoFix !DEBUGNET build after r362138
cem [Sat, 13 Jun 2020 03:16:09 +0000 (03:16 +0000)]
Fix !DEBUGNET build after r362138

X-MFC-With: r362138

4 years agoFlip kern.tty_info_kstacks on by default
cem [Sat, 13 Jun 2020 03:04:40 +0000 (03:04 +0000)]
Flip kern.tty_info_kstacks on by default

It's a useful debug aid for anyone using Ctrl-T today, and doesn't seem to be
widely known.  So, enable it out of the box to help people find it.

It's a tunable and sysctl, so if you don't like it, it's easy to disable
locally.

If people really hate it, we can always flip it back.

Reported by: Daniel O'Connor