]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agoloader: r362262 did miss the pathlen check
Toomas Soome [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.

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

Sponsored by: Innovate UK

3 years agoloader: strings in nvlist are counted strings, not c-strings
Toomas Soome [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.

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

3 years agoevdev: Add AT translated set1 scancodes for 'Eisu' & 'Kana' keys.
Vladimir Kondratyev [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

3 years agoloader: vidc_init should also erase the screen
Toomas Soome [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.

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

MFC after: 2 weeks

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

I use all of these..

3 years ago[run] mention that some 11n functionality is now available.
Adrian Chadd [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.

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

3 years agovm: Drop vm_map_clip_{start,end} macro wrappers
Conrad Meyer [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

3 years agoApply default security flavor in vfs_export
Ryan Moeller [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

3 years agortld: Allow to load ET_DYN && DF_1_PIE when tracing.
Konstantin Belousov [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

3 years agortld: Add debug line for dlopen_object().
Konstantin Belousov [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

3 years agoSystematically pass RTLD_LO_TRACE to load_needed_objects().
Konstantin Belousov [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

3 years agoComplete a function block with Fc, no content change.
Sergey Kandaurov [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.

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

3 years agoUpdate VFS_CHECKEXP.9 for the argument changes done by r362158.
Rick Macklem [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.

3 years agoboot2: need to expand tab output and mask getchar
Toomas Soome [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.

3 years agoImprove unit parsing of mpsutil.
Juli Mallett [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)

3 years agollvm: Default to -mno-relax on RISC-V
Kristof Provost [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

3 years agoiSo in doing final checks on OCA firmware with all the latest tweaks the dup-ack...
Randall Stewart [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

3 years agonewsyslog(8): make configuration parser more robust.
Eugene Grosbein [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

3 years agoFix pointer name to match the name used in the function prototype
Marc Fonvieille [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>

3 years agoMake KENV_MVALLEN tunable
Simon J. Gerraty [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

3 years agolibcasper(3): Document HISTORY within the manpages
Gordon Bergling [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

3 years agocmp(1): Add EXAMPLES section
Fernando Apesteguía [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

3 years agoFix typo in the documentation about the daily ntpd status
Baptiste Daroussin [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

3 years agoSo it turns out rack has a shortcoming in dup-ack counting. It counts the dupacks but
Randall Stewart [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

3 years agoRe-add opencsd as a vendor import from the dist directory
Andrew Turner [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

3 years agoRemove opencsd so I can re-import it with the correct ancestry
Andrew Turner [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

3 years agoloader: zfs_cmd.c does not really compile without libzfs.h
Toomas Soome [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.

3 years agoloader: variable i is unused without MBR/GPT support built in
Toomas Soome [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.

3 years ago[ifconfig] add UAPSD and LPDC flags
Adrian Chadd [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..

3 years agoMake use of the UID_NOBODY and GID_NOGROUP definitions in sys/conf.h.
Rick Macklem [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

3 years agoExpose UID_xxx and GID_xxx definitions to userspace.
Rick Macklem [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

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

Whoops, forgot to land this one too!

3 years ago[net80211] Add missing commit to previous-1 uapsd commit.
Adrian Chadd [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.

3 years ago[net80211] Add uapsd option to ifconfig
Adrian Chadd [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.

3 years ago[net80211] Add initial U-APSD negotiation support.
Adrian Chadd [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.

3 years agoMake Linux uname(2) return x86_64 to 32-bit apps. This helps Steam.
Edward Tomasz Napierala [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

3 years agoif_vtnet: let vtnet_rx_vq_intr() and vtnet_rxq_tq_intr() share code
Vincenzo Maffione [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

3 years agoRemove the sed hack for ABI tag notes.
John Baldwin [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

3 years agoSimplify MACHINE_ARCH to be a single string.
John Baldwin [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

3 years agoAvoid trying to toggle TSO twice
Ryan Moeller [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

3 years agoUpdate event masks constant to Bluetooth core spec V5.2
Takanori Watanabe [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

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

Sponsored by: Innovate UK

3 years agomd5(1): fix style in man page
Fernando Apesteguía [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

3 years agovtnet: Fix regression introduced in r361944
Jessica Clarke [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

3 years agoiflib: netmap: enter/exit netmap mode after device stops
Vincenzo Maffione [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

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

No functional changes intended.

Sponsored by: Netflix, Klara Inc.

3 years agonetmap: vtnet: fix races in vtnet_netmap_reg()
Vincenzo Maffione [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

3 years agosh/tests: Add tests for SIGINT in non-jobc background commands
Jilles Tjoelker [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

3 years ago[PowerPC] Fix scc z8530 driver
Brandon Bergren [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

3 years agoAllocate the mbuf for the signature in the COOKIE or the correct size.
Michael 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

3 years agoMake linux(4) warn about unsupported CMSG level/type.
Edward Tomasz Napierala [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

3 years agoAdd support for the timecreate attribute
Doug Rabson [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.

3 years agoloader.efi: update console after gfx mode change
Toomas Soome [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.

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

MFC after: 1 week

3 years agoMove font related data structured to sys/font.c and update vtfontcvt
Toomas Soome [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

3 years agolibc manpages: various improvements from NetBSD
Gordon Bergling [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

3 years agoAdd HISTORY sections to ZFS and dtrace manpage
Gordon Bergling [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

3 years agolibutil: Document function HISTORY within the manpages
Gordon Bergling [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

3 years agoAdd a HISTORY section to ctime(3)
Gordon Bergling [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

3 years agoOops, r362158 committed a duplicate definition of MAXSECFLAVORS.
Rick Macklem [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.

3 years agoModify mountd to use the new struct export_args committed by r362158.
Rick Macklem [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

3 years ago[net80211] Treat frames without an rx status as not a decap'ed A-MSDU.
Adrian Chadd [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.

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

Whoops - this belonged in my previous commit.

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

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

3 years agoFix export_args ex_flags field so that is 64bits, the same as mnt_flags.
Rick Macklem [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

3 years ago[net80211] Handle offloaded AMSDU in AMPDU reordering.
Adrian Chadd [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.

3 years ago[net80211] separate out node allocation and node initialisation.
Adrian Chadd [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

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

MFC after: 1 week

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

MFC after: 1 week

3 years agoFix ldd for PIE binaries after rtld stopped accepting binaries for dlopen.
Konstantin Belousov [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

3 years agoprocctl(2): document PROC_KPTI
Konstantin Belousov [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

3 years agoprocctl(2): consistently refer to the data pointer as 'data'.
Konstantin Belousov [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

3 years agosockstat(1): Add EXAMPLES to man page
Fernando Apesteguía [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@

3 years agonvi: fallback to ISO8859-1 as last resort
Yuri Pankov [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

3 years agoawk(1): use -version instead of -V
Yuri Pankov [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

3 years agolocale: exit 1 if unknown keyword was specified
Yuri Pankov [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>

3 years agoMFV r362143:
Cy Schubert [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

3 years agoImport sqlite3-3.32.2 (3320200)
Cy Schubert [Sat, 13 Jun 2020 03:50:35 +0000 (03:50 +0000)]
Import sqlite3-3.32.2 (3320200)

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

X-MFC-With: r362138

3 years agoFlip kern.tty_info_kstacks on by default
Conrad Meyer [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

3 years agoLinuxkpi uses the rb-tree structures without using their interfaces,
Doug Moore [Sat, 13 Jun 2020 01:54:09 +0000 (01:54 +0000)]
Linuxkpi uses the rb-tree structures without using their interfaces,
making them break when the representation changes. Revert changes that
eliminated the color field from rb-trees, leaving everything as it was
before.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D25250

3 years agonet80211: Add framework for debugnet(4) support
Conrad Meyer [Sat, 13 Jun 2020 00:59:36 +0000 (00:59 +0000)]
net80211: Add framework for debugnet(4) support

Allow net80211 drivers to register a small vtable of debugnet-related
methods.

This is not a functional change.  Driver support is needed, similar to
debugnet(4) for wired NICs.

Reviewed by: adrian, markj (earlier version both)
Differential Revision: https://reviews.freebsd.org/D17308

3 years agoAllow <sys/elf_common.h> to be used in assembly.
John Baldwin [Fri, 12 Jun 2020 23:43:44 +0000 (23:43 +0000)]
Allow <sys/elf_common.h> to be used in assembly.

Hide C-only declarations under #ifndef LOCORE.  This will be used by
future changes to define ELF notes in assembly.

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

3 years agoAllow <sys/param.h> to be included from userland assembly files.
John Baldwin [Fri, 12 Jun 2020 23:42:36 +0000 (23:42 +0000)]
Allow <sys/param.h> to be included from userland assembly files.

This will be used by future changes to define ELF notes in assembly.

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

3 years agoVarious optimizations to software AES-CCM and AES-GCM.
John Baldwin [Fri, 12 Jun 2020 23:10:30 +0000 (23:10 +0000)]
Various optimizations to software AES-CCM and AES-GCM.

- Make use of cursors to avoid data copies for AES-CCM and AES-GCM.

  Pass pointers into the request's input and/or output buffers
  directly to the Update, encrypt, and decrypt hooks rather than
  always copying all data into a temporary block buffer on the stack.

- Move handling for partial final blocks out of the main loop.

  This removes branches from the main loop and permits using
  encrypt/decrypt_last which avoids a memset to clear the rest of the
  block on the stack.

- Shrink the on-stack buffers to assume AES block sizes and CCM/GCM
  tag lengths.

- For AAD data, pass larger chunks to axf->Update.  CCM can take each
  AAD segment in a single call.  GMAC can take multiple blocks at a
  time.

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

3 years agoFix a regression in r361804 for TLS 1.3.
John Baldwin [Fri, 12 Jun 2020 22:27:26 +0000 (22:27 +0000)]
Fix a regression in r361804 for TLS 1.3.

I was not including the record type stored in the first byte of the
trailer as part of the payload to be encrypted and hashed.

Sponsored by: Netflix

3 years agoControl for Special Register Buffer Data Sampling mitigation.
Konstantin Belousov [Fri, 12 Jun 2020 22:14:45 +0000 (22:14 +0000)]
Control for Special Register Buffer Data Sampling mitigation.

New microcode update for Intel enables mitigation for SRBDS, which
slows down RDSEED and related instructions.  The update also provides
a control to limit the mitigation to SGX enclaves, which should
restore the speed of random generator by the cost of potential
cross-core bufer sampling.

See https://software.intel.com/security-software-guidance/insights/deep-dive-special-register-buffer-data-sampling

GIve the user control over it.

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

3 years agox86: add bits definitions for SRBDS mitigation control.
Konstantin Belousov [Fri, 12 Jun 2020 22:12:57 +0000 (22:12 +0000)]
x86: add bits definitions for SRBDS mitigation control.

See https://software.intel.com/security-software-guidance/insights/deep-dive-special-register-buffer-data-sampling

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

3 years agortld: set osrel when in the direct exec mode.
Konstantin Belousov [Fri, 12 Jun 2020 22:10:03 +0000 (22:10 +0000)]
rtld: set osrel when in the direct exec mode.

Rtld itself is a shared object which does not have vendor note, so
after the direct exec of ld-elf.so.1 process has p_osrel set to zero.
This affects the ABI of syscalls.

Set osrel to the __FreeBSD_version value at compile time right after
rtld identified direct exec mode.  Then, switch to the osrel read from
the binary note or zero if no note, right before starting calling
ifunc resolvers, which is the first byte of the user code.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

3 years agoverify_pcr_export: bump kenv_mvallen if needed
Simon J. Gerraty [Fri, 12 Jun 2020 21:55:30 +0000 (21:55 +0000)]
verify_pcr_export: bump kenv_mvallen if needed

The loader.ve.hashed list can easily exceed KENV_MVALLEN.
If so, bump kenv_mvallen to a multiple of KENV_MVALLEN to
accommodate the value.

Reviewed by: stevek
MFC after: 1 week

3 years agoHonor db_pager_quit in some vm_object ddb commands
Eric van Gyzen [Fri, 12 Jun 2020 21:53:08 +0000 (21:53 +0000)]
Honor db_pager_quit in some vm_object ddb commands

These can be rather verbose.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

3 years agomac_veriexec_fingerprint_check_vnode: v_writecount > 0 means active writers
Simon J. Gerraty [Fri, 12 Jun 2020 21:51:20 +0000 (21:51 +0000)]
mac_veriexec_fingerprint_check_vnode: v_writecount > 0 means active writers

v_writecount can actually be < 0 for text,
so check for v_writecount > 0

Reviewed by: stevek
MFC after: 1 week

3 years agoMinor cleanup of initialized variables
Simon J. Gerraty [Fri, 12 Jun 2020 21:48:46 +0000 (21:48 +0000)]
Minor cleanup of initialized variables

Sort the list and cleanup trailing white-space

Reviewed by: stevek
MFC after: 1 week

3 years agoFix AES-CCM requests with an AAD size smaller than a single block.
John Baldwin [Fri, 12 Jun 2020 21:33:02 +0000 (21:33 +0000)]
Fix AES-CCM requests with an AAD size smaller than a single block.

The amount to copy for the first block is the minimum of the size of
the AAD region or the remaining space in the first block.

Reported by: cryptocheck -z
MFC after: 2 weeks
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D25140