]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agocpucontrol: fix extended signature matching code to avoid fallthough
Dan Nelson [Mon, 14 Jun 2021 19:28:16 +0000 (15:28 -0400)]
cpucontrol: fix extended signature matching code to avoid fallthough

PR: 256502

(cherry picked from commit 87799c5f85dc0aed7e53ca841504e3b2ffc88498)

2 years agostand: Fix __elfN(loadimage) return value
Mark Johnston [Sun, 6 Jun 2021 20:40:25 +0000 (16:40 -0400)]
stand: Fix __elfN(loadimage) return value

Caller functions expect __elfN(loadimage) to return a value of zero on
failure and the file size on success.

PR: 256390
Reviewed by: markj

(cherry picked from commit 1ea87e2a70c31454a8696ab2979d13d21c5575d2)

2 years agobsdconfig: add a new mirror in Bulgaria
Philip Paeps [Thu, 17 Jun 2021 13:07:37 +0000 (21:07 +0800)]
bsdconfig: add a new mirror in Bulgaria

Provided by Telepoint Mirror Service.

Reported by: Valentin Nikolov <mirror@telepoint.bg>

(cherry picked from commit 1c9605fe1e190197b3846e01dce1e491bef0ec34)

2 years agobsdinstall: add a new mirror in Bulgaria
Philip Paeps [Thu, 17 Jun 2021 13:07:37 +0000 (21:07 +0800)]
bsdinstall: add a new mirror in Bulgaria

Provided by Telepoint Mirror Service.

Reported by: Valentin Nikolov <mirror@telepoint.bg>

(cherry picked from commit 7daa45becfd32cb38933bfdc87e8a10fc982d188)

2 years agoipfw.8: synopsis misses nat show form
Lutz Donnerhacke [Mon, 10 May 2021 16:30:42 +0000 (18:30 +0200)]
ipfw.8: synopsis misses nat show form

Document the existing behavior, which is currently only available by
reading third party documentation or the source code itself.

PR: 254617
Submitted by: Oliver Kiddle
Differential Revision: https://reviews.freebsd.org/D30189

(cherry picked from commit c8250c5ada85fec8936e8eb8695d7cb80a3ce8ab)

2 years agopf: don't hold a lock during copyout()
Kristof Provost [Mon, 14 Jun 2021 12:04:02 +0000 (14:04 +0200)]
pf: don't hold a lock during copyout()

copyout() can trigger page faults, so it may potentially sleep.

Reported by: avg
MFC after: 3 days
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 8b5f4e692b1d1585ecfc6690552650114e3e704e)

2 years agodummynet: free(NULL, M_DUMMYNET); is safe
Kristof Provost [Fri, 21 May 2021 14:55:07 +0000 (16:55 +0200)]
dummynet: free(NULL, M_DUMMYNET); is safe

There's no need to check pointers for NULL before free()ing them.

No functional change.

MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D30382

(cherry picked from commit 1b2dbe37fa32d7255faf7d1feec7bb31414a8102)

2 years agodummynet: Fix schedlist and aqmlist locking
Kristof Provost [Fri, 21 May 2021 12:26:49 +0000 (14:26 +0200)]
dummynet: Fix schedlist and aqmlist locking

These are global (i.e. shared across vnets) structures, so we need
global lock to protect them.  However, we look up entries in these lists
(find_aqm_type(), find_sched_type()) and return them. We must ensure
that the returned structures cannot go away while we are using them.

Resolve this by using NET_EPOCH(). The structures can be safely accessed
under it, and we postpone their cleanup until we're sure they're no
longer used.

MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D30381

(cherry picked from commit 51d73df18e4d120f6f062062c18efae3ed5193a6)

2 years agoVNETify dummynet
Tom Jones [Sat, 15 May 2021 12:36:45 +0000 (14:36 +0200)]
VNETify dummynet

This moves dn_cfg and other parameters into per VNET variables.

The taskqueue and control state remains global.

Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D29274

(cherry picked from commit fe3bcfbda30e763a3ec56083b3a19cebbeaf8952)

2 years agoDo not forward datagrams originated by link-local addresses
Zhenlei Huang [Tue, 18 May 2021 20:51:37 +0000 (22:51 +0200)]
Do not forward datagrams originated by link-local addresses

The current implement of ip_input() reject packets destined for
169.254.0.0/16, but not those original from 169.254.0.0/16 link-local
addresses.

Fix to fully respect RFC 3927 section 2.7.

PR: 255388
Reviewed by: donner, rgrimes, karels
Differential Revision: https://reviews.freebsd.org/D29968
Reviewed by: rgrimes, donner, karels, marcus, emaste
Differential Revision: https://reviews.freebsd.org/D30374

(cherry picked from commit 3d846e48227e2e78c1e7b35145f57353ffda56ba)
(cherry picked from commit 03b0505b8fe848f33f2f38fe89dd5538908c847e)

2 years agonetgraph/bridge: malloc without flags
Lutz Donnerhacke [Sun, 13 Jun 2021 22:00:35 +0000 (00:00 +0200)]
netgraph/bridge: malloc without flags

During tests an assert was triggered and pointed to missing flags in
the newlink function of ng_bridge(4).

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

(cherry picked from commit 4c3280e58727e900d4c217054fe655e3512380f1)

2 years agoLinuxKPI: add fault_flag_allow_retry_first
Greg V [Wed, 9 Jun 2021 23:09:16 +0000 (19:09 -0400)]
LinuxKPI: add fault_flag_allow_retry_first

Used by drm 5.7.

Reviewed by: bz, hselasky, nc
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30673

(cherry picked from commit 597cc550e7b98294617cdd41800e9f132b6bcad9)

2 years agotests/netgraph: Tests for ng_vlan_rotate
Lutz Donnerhacke [Sun, 6 Jun 2021 23:56:12 +0000 (01:56 +0200)]
tests/netgraph: Tests for ng_vlan_rotate

Test functionality of ng_vlan_rotate(4):
 - Rotate 1 to 9 stagged vlans in any possible direction and length
 - Rotate random combinations of ethertypes (8100, 88a8, 9100)
 - Automatic reverse rotating for backward data flow
 - Test too many and too few vlans

Reviewed by: kp (earlier version)
Differential Revision: https://reviews.freebsd.org/D30670

(cherry picked from commit 6b08e68be111d50931b0d30145f8b7e3402decaf)

2 years agotests/netgraph: Tests for ng_hub
Lutz Donnerhacke [Thu, 3 Jun 2021 22:22:29 +0000 (00:22 +0200)]
tests/netgraph: Tests for ng_hub

Test functionality of ng_hub(4):
 - replicting traffic to anything but the sending hook
 - persistence
 - an unrestricted loop
 - implementation limits with many hooks.

Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D30633

(cherry picked from commit 7863faa78ae271017c404c635b2a9d07379d4316)

2 years agotests/netgraph: Tests for ng_bridge
Lutz Donnerhacke [Fri, 4 Jun 2021 10:59:00 +0000 (12:59 +0200)]
tests/netgraph: Tests for ng_bridge

Test functionality of ng_bridge(4):
 - replicating traffic to anything but the sending hook
 - persistence
 - detect loops
 - unicast to only one link of many
 - stretch to implementation limits on broadcast

Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D30647
Differential Revision: https://reviews.freebsd.org/D30699

(cherry picked from commit 61814702398ce29430b2bef75cbdd6fd2c07ad12)
(cherry picked from commit 5554abd9cc9702af30af90925b33c5efff4e7d88)

2 years agotests/netgraph: Inital framework for testing libnetgraph
Lutz Donnerhacke [Wed, 2 Jun 2021 22:29:46 +0000 (00:29 +0200)]
tests/netgraph: Inital framework for testing libnetgraph

Provide a framework of functions to test various netgraph modules.
Tests contain:
 - creating, renaming, and destroying nodes
 - connecting and removing hooks
 - sending and receiving data
 - sending ASCII messages and receiving binary responses
 - errors can be passed for indiviual inspection or fail the test

Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D30629
Differential Revision: https://reviews.freebsd.org/D30657
Differential Revision: https://reviews.freebsd.org/D30671
Differential Revision: https://reviews.freebsd.org/D30699

(cherry picked from commit 24ea1dbf257aa6757f469bcd859f90e9ad851e59)
(cherry picked from commit 09307dbfb888a98232096c751a96ecb3344aa77c)
(cherry picked from commit 9021c46603bf29b9700f24b8dce8796b434d7c8f)
(cherry picked from commit 5554abd9cc9702af30af90925b33c5efff4e7d88)

Also contains some fixups:
 - indent all files correctly
 - finish factoring out
 - remove debugging code
 - check for renaming issues reported in PR241954

PR: 241954
Differential Revision: https://reviews.freebsd.org/D30692
Differential Revision: https://reviews.freebsd.org/D30714
Differential Revision: https://reviews.freebsd.org/D30713

(cherry picked from commit a664ade93972ce617f0888ff79e715dff9cf0f87)
(cherry picked from commit 0afa9be03937d60cb5aeba64c81e3e2165bd3737)
(cherry picked from commit 43e4821315c31db067e23564b9bfafb519e77b2b)

2 years agotests/netgraph: Prebuild tests directory
Lutz Donnerhacke [Wed, 16 Jun 2021 11:37:51 +0000 (13:37 +0200)]
tests/netgraph: Prebuild tests directory

(partially cherry picked from commit e8db04c38959c882fe17e7c2b26fbabe74f26311)

2 years agorc.d: liberate powerd from ACPI dependency
Andriy Gapon [Tue, 8 Jun 2021 17:08:10 +0000 (20:08 +0300)]
rc.d: liberate powerd from ACPI dependency

For instance, many non-ACPI ARM systems have CPU power / frequency
levels.

(cherry picked from commit 20eb6bd8c598fdbf4e96ed4ca64a609be255ccba)

2 years agolibcasper: fix descriptors numbers
Mariusz Zaborski [Wed, 9 Jun 2021 21:46:51 +0000 (23:46 +0200)]
libcasper: fix descriptors numbers

Casper services expect that the first 3 descriptors (stdin/stdout/stderr)
will point to /dev/null. Which Casper will ensure later. The Casper
services are forked from the original process. If the initial process
closes one of those descriptors, Casper may reuse one of them for it on
purpose. If this is the case, then renumarate the descriptors used by
Casper to higher numbers. This is done already after the fork, so it
doesn't break the parent process.

PR: 255339
Reported by: Borja Marcos <borjam (at) sarenet.es>
Tested by: jkim@

(cherry picked from commit aa310ebfba3d49a0b6b03a103b969731a8136a73)

2 years agoiwn: adjust EEPROM read timeout for Intel 4965AGN M2
Radosław Chmielarz [Sun, 6 Jun 2021 20:42:10 +0000 (16:42 -0400)]
iwn: adjust EEPROM read timeout for Intel 4965AGN M2

Reading EEPROM from Intel 4965AGN M2 takes 60 us which was causing panic
on system startup.

PR: 255465
Reviewed by: markj

(cherry picked from commit 03d4b58feee396d392668f192ecdde08ecc8036c)

2 years agongatm: Handle errors from uni_msg_extend()
Mark Johnston [Sun, 6 Jun 2021 20:42:16 +0000 (16:42 -0400)]
ngatm: Handle errors from uni_msg_extend()

uni_msg_extend() may fail due to a memory allocation failure.  In this
case, though, the message is freed, so callers shouldn't touch it.

PR: 255861
Reviewed by: harti
Sponsored by: The FreeBSD Foundation

(cherry picked from commit e755e2776ddff729ae4102f3273473aa33b00077)

2 years agopf: Convenience function for optional (numeric) arguments
Kristof Provost [Sat, 15 May 2021 11:45:55 +0000 (13:45 +0200)]
pf: Convenience function for optional (numeric) arguments

Add _opt() variants for the uint* functions. These functions set the
provided default value if the nvlist doesn't contain the relevant value.
This is helpful for optional values (e.g. when the API is extended to
add new fields).

While here simplify the header by also using macros to create the
prototypes for the macro-generated function implementations.

Reviewed by: scottl
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D30510

(cherry picked from commit 7c4342890bf17b72f0d79ada1326d9cbf34e736c)

2 years agoLinuxKPI: add pr_err_once
Greg V [Mon, 7 Jun 2021 14:30:18 +0000 (10:30 -0400)]
LinuxKPI: add pr_err_once

Reviewed by: hselasky, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30672

(cherry picked from commit 05c2d94a081d5948560a01c26c7f432960cde606)

2 years agoums(4): Do not stop USB xfers on FIFO close when evdev is still active
Vladimir Kondratyev [Sun, 23 May 2021 22:38:53 +0000 (01:38 +0300)]
ums(4): Do not stop USB xfers on FIFO close when evdev is still active

This fixes lose of evdev events after moused has been killed.

While here use bitwise operations for UMS_EVDEV_OPENED flag.

Reviewed by: hselasky
Differential revision: https://reviews.freebsd.org/D30342

(cherry picked from commit 05ab03a31798d4cc96c22a8f30b1d9a0d7a3dd35)

2 years agoums(4): Start USB xfers on opening of evdev node unconditionally.
Vladimir Kondratyev [Sun, 23 May 2021 22:41:17 +0000 (01:41 +0300)]
ums(4): Start USB xfers on opening of evdev node unconditionally.

This fixes inability to start USB xfers in a case when FIFO has been
already open()-ed but no read() or poll() calls has been issued yet.

Differential revision: https://reviews.freebsd.org/D30343

(cherry picked from commit 47791339f0cfe3282a6f64b5607047f7bca968ad)

2 years agobectl(8): don't allow creation of boot environments with spaces
Robert Wing [Thu, 3 Jun 2021 16:36:11 +0000 (08:36 -0800)]
bectl(8): don't allow creation of boot environments with spaces

Boot environment datasets that contain spaces are not bootable.

When a user attempts to create a boot environment with a space, abort
the creation and print an error message.

PR:             254441
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D30194

(cherry picked from commit 0e6549c8745049e3d6fba3ad748034de2d5cbd2a)

2 years agoAdd freeze/thaw description to devctl(8)
Li-Wen Hsu [Tue, 1 Jun 2021 04:33:12 +0000 (12:33 +0800)]
Add freeze/thaw description to devctl(8)

This is a follow-up to 5fa29797910346fc0c54829bd979856e83b9b7ea .

PR: 256311
Reviewed by: imp
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D29867

(cherry picked from commit 315674fb6acc4fa54cf82de3863c349c5a71f498)

2 years agoFix test case header function name
Math Ieu [Wed, 2 Jun 2021 04:09:55 +0000 (12:09 +0800)]
Fix test case header function name

This restores the expected behavior (skip) when running with non-root user

MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D30584

(cherry picked from commit 847b7d505490ae407a5c876e14e7788a4add7737)

2 years agonetgraph/ng_base: Renaming a node to the same name is a noop
Lutz Donnerhacke [Tue, 4 May 2021 19:20:39 +0000 (21:20 +0200)]
netgraph/ng_base: Renaming a node to the same name is a noop

Detailed analysis in https://github.com/genneko/freebsd-vimage-jails/issues/2
brought the problem down to a double call of ng_node_name() before and
after a vnet move.  Because the name of the node is already known
(occupied by itself), the second call fails.

PR: 241954
Reported by: Paul Armstrong
Differential Revision: https://reviews.freebsd.org/D30110

(cherry picked from commit 0345fd891fe13a191fc0fae9463ea9458bfaff5a)

2 years agoGet rid of i386 ref here as linux64 is a 64-bit module.
Dmitry Chagin [Wed, 24 Mar 2021 15:56:46 +0000 (18:56 +0300)]
Get rid of i386 ref here as linux64 is a 64-bit module.

Reviewed By: emaste, imp
Differential Revision: https://reviews.freebsd.org/D29412

(cherry picked from commit 88588c4b7611a39cdf965c3c07d8fcc13ed553b4)

2 years agolinux: silence renameat2 flags warning
Mateusz Guzik [Mon, 26 Oct 2020 18:03:50 +0000 (18:03 +0000)]
linux: silence renameat2 flags warning

Hogs the console while building the Linux kernel in a Ubuntu Focal jail.

(cherry picked from commit fe76bef462048f9beb3bffd448ae1adb01969594)

2 years agolinux_renameat2: improve flag checks
Ed Maste [Thu, 7 Nov 2019 15:51:44 +0000 (15:51 +0000)]
linux_renameat2: improve flag checks

In the cases where Linux returns an error (e.g. passing in an undefined
flag) there's no need for us to emit a message.  (The target of this
message is a developer working on the linuxulatorm, not the author of
presumably broken Linux software).

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21606

(cherry picked from commit 01b9ee4c509e2882147af35eea4772d06ecd4150)

2 years agolinux_common: retire extra module version.
Dmitry Chagin [Wed, 26 May 2021 05:34:32 +0000 (08:34 +0300)]
linux_common: retire extra module version.

The second 'linuxcommon' line was added by c66f5b079d2a259c3a65b1efe0f2143cd030dc52
but Linuxulator's modules dependend on 'linux_common'.
To avoid such mistakes in the future rename moduledata name and module
name to  'linux_common' and retire 'linuxcommon' line.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D30409
MFC after: 2 weeks

(cherry picked from commit 5184e2da41921dfec5a3668756890b5c073fbad9)

2 years agoMove V4L feature declarations and DTrace provider definitions from
Tijl Coosemans [Sun, 6 Dec 2020 10:58:55 +0000 (10:58 +0000)]
Move V4L feature declarations and DTrace provider definitions from
linux_common.c to linux_util.c so they become available on i386.

linux_common.c defines the linux_common kernel module but this module does
not exist on i386 and linux_common.c is not included in the linux module.
linux_util.c is included in the linux_common module on amd64 and the linux
module on i386.

Remove linux_common.c from files.i386 again.  It was added recently in
r367433 when the DTrace provider definitions were moved.

The V4L feature declarations were moved to linux_common in r283423.

(cherry picked from commit 77fb6b6644446beb0ea45085b953f464c729c049)

2 years agoFix i386 linux module after r367395.
Tijl Coosemans [Sat, 5 Dec 2020 14:53:24 +0000 (14:53 +0000)]
Fix i386 linux module after r367395.

In r367395 parts of machine dependent linux_dummy.c were moved to a new
machine independent file sys/compat/linux/linux_dummy.c and the existing
linux_dummy.c was renamed to linux_dummy_machdep.c.

Add linux_dummy_machdep.c to the linux module for i386.
Rename sys/amd64/linux32/linux_dummy.c for consistency.
Add the new linux_dummy.c to the linux module for i386.

(cherry picked from commit df4ca45cf943fb62c7771e479f5f999570ec6928)

2 years agolinux(4): Fix loadable modules after r367395
Conrad Meyer [Fri, 6 Nov 2020 22:04:57 +0000 (22:04 +0000)]
linux(4): Fix loadable modules after r367395

Move dtrace SDT definitions into linux_common module code.  Also, build
linux_dummy.c into the linux_common kld -- we don't need separate
versions of these stubs for 32- and 64-bit emulation.

Reported by: several
PR: 250897
Discussed with: emaste, trasz
Tested by: John Kennedy, Yasuhiro KIMURA, Oleg Sidorkin
X-MFC-With: r367395
Differential Revision: https://reviews.freebsd.org/D27124

(cherry picked from commit 76b2bfeda42bbb686c74d3608dbc9b84b8e22e29)

2 years agoDirect commit:
Dmitry Chagin [Thu, 10 Jun 2021 09:22:43 +0000 (12:22 +0300)]
Direct commit:
MFC r367395 (e9b13c6612fea4e74f0c9c543e21d29d91a24dff) by cem:

linux(4): Deduplicate unimpl/dummy syscall handlers

No functional change.

Reviewed by:    emaste, trasz
Differential Revision:  https://reviews.freebsd.org/D27099

2 years agortwn_usb(4): Add a USB ID for the TP-Link Archer T2U v3.
Dmitry Chagin [Thu, 27 May 2021 18:52:10 +0000 (21:52 +0300)]
rtwn_usb(4): Add a USB ID for the TP-Link Archer T2U v3.

PR: 256203
Submitted by: Steve Kargl sgk at troutmask.apl.washington.edu

(cherry picked from commit 434c46c00602e16115cfb19344e4c45135b68b09)

2 years agolibcrypto: Add symbol versions for symbols added since 1.1.1d.
John Baldwin [Fri, 28 May 2021 22:18:15 +0000 (15:18 -0700)]
libcrypto: Add symbol versions for symbols added since 1.1.1d.

While here, trim a spurious local: I missed when added SSL_sendfile.

PR: 255277
Reported by: yuri
Reviewed by: jkim
Differential Revision: https://reviews.freebsd.org/D30483

(cherry picked from commit 7ad70d22c667173586c04fc13dd315995d78fbbf)

2 years agoetcupdate: Add -D destdir to usage for 'extract'.
John Baldwin [Mon, 26 Apr 2021 16:49:34 +0000 (09:49 -0700)]
etcupdate: Add -D destdir to usage for 'extract'.

Reported by: Mark Millard <marklmi@yahoo.com>

(cherry picked from commit 5eb9c93a20d7320b24635ed09eba4908951bdeb2)

2 years agoetcupdate: Add a revert mode to restore one or more stock files.
John Baldwin [Tue, 20 Apr 2021 20:22:35 +0000 (13:22 -0700)]
etcupdate: Add a revert mode to restore one or more stock files.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D29846

(cherry picked from commit ba30215ae0efeb49e5e9ca2469d95edaea78680d)

2 years agoetcupdate: Trim trailing whitespace.
John Baldwin [Tue, 20 Apr 2021 20:22:24 +0000 (13:22 -0700)]
etcupdate: Trim trailing whitespace.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D29845

(cherry picked from commit ada7fd17d57fac3dbafff5a1b3268afb872c8b0b)

2 years agoetcupdate: Gracefully handle SIGINT when building trees.
John Baldwin [Tue, 20 Apr 2021 20:22:11 +0000 (13:22 -0700)]
etcupdate: Gracefully handle SIGINT when building trees.

Run the 'build_tree' function inside of a subshell and trap SIGINT to
return an error to the caller.  This allows callers to gracefully
cleanup a partially created tree.

While here, redirect stdout/stderr of the subshell to the log file
instead of applying redirections individually to each command executed
while building the tree.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D29844

(cherry picked from commit 1f7afa9364805a912270c9d6a70dc4a889d47a4e)

2 years agoetcupdate: Always extract to a temporary tree.
John Baldwin [Tue, 20 Apr 2021 20:21:42 +0000 (13:21 -0700)]
etcupdate: Always extract to a temporary tree.

etcupdate has had a somewhat nasty race condition since its creation
in that its state machine can get very confused if it is interrupted
while building the tree to compare against.  This is exacerbated by
the fact that etcupdate doesn't emit any output while building the
tree which can take several seconds (especially in recent years with
the addition of the tree-wide buildconfig/installconfig passes).

To mitigate this, always install a new tree into a temporary directory
created via mktemp as was previously done only for dry-runs via -n.
The existing trees are only rotated and the new tree installed as
/var/db/etcupdate/current after the update command has completed.

Reported by: dim, np (and many others)
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D29843

(cherry picked from commit 0611aec3cf3a373e6a06f103699dbc91c3d6d472)
(cherry picked from commit b0df36580d5b0df67a0f58ded8f6356b268f7f71)

2 years agopciconf: Fix up pciconf -lc output
David Bright [Mon, 24 May 2021 19:02:43 +0000 (14:02 -0500)]
pciconf: Fix up pciconf -lc output

The pciconf command fails to emit newlines when particular ecap field
values are seen. Fix them up. This has been seen on several systems at
$JOB. The documentation for PCI capabilities says that capability
type 0 should not be used once the spec for PCI capabilities was
published, but that seems more wishful-thinking than reality. pciconf
also chooses not to print fields related to field values that are
zero, but it seems several of these fields are zero on actual
hardware.

Sponsored by: Dell EMC Isilon
Submitted by: Robert Herndon (Robert.Herndon@dell.com)

(cherry picked from commit 2f176a2b20107f7a9132242223e9eef657400514)

2 years agolibsa: Fix infinite loop in bzipfs & gzipfs
David Bright [Mon, 24 May 2021 17:12:15 +0000 (12:12 -0500)]
libsa: Fix infinite loop in bzipfs & gzipfs

A bug in the loader's bzipfs & gzipfs filesystems caused compressed
kernel and modules not to work on EFI systems with a veriexec-enabled
loader. Since the size of files in these filesystems are not known
_a priori_ `stat` would initialize the size to -1 and the loader would
then hang in an infinite loop while trying to seek (read) to the end
of file since the loop termination condition compares the current
offset to that negative target position.

Sponsored by: Dell EMC Isilon

(cherry picked from commit 3df4c387d2e3ca4c2391fb837540b048f60a11c2)

2 years agortwn_usb(4): add revision number for D-Link DWA-121 (N150 Nano).
Dmitry Chagin [Wed, 26 May 2021 06:47:30 +0000 (09:47 +0300)]
rtwn_usb(4): add revision number for D-Link DWA-121 (N150 Nano).

(cherry picked from commit 17dafdc0de7e8ab0c750d1339e4debc78262e19b)

2 years agortwn_usb(4): add D-Link DWA-121 (N150 Nano) to the rtwn_usb hardware list
Dmitry Chagin [Wed, 26 May 2021 05:01:04 +0000 (08:01 +0300)]
rtwn_usb(4): add D-Link DWA-121 (N150 Nano) to the rtwn_usb hardware list

(cherry picked from commit 962b3a092616c95c68c0b0a844f4660675aa40f6)

2 years agortwn_usb(4): add Mercusys MW150US (N150 Nano) to the rtwn_usb hardware list.
Dmitry Chagin [Wed, 26 May 2021 07:13:08 +0000 (10:13 +0300)]
rtwn_usb(4): add Mercusys MW150US (N150 Nano) to the rtwn_usb hardware list.

(cherry picked from commit 399bad7b9a105930b8203ad0a1fd154681bc16b8)

2 years agoCirrus-CI: Add descriptive task name
Ed Maste [Wed, 2 Jun 2021 15:31:48 +0000 (11:31 -0400)]
Cirrus-CI: Add descriptive task name

Previously it appeared only as "main" in places like GitHub's list
of checks run as part of a pull request.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 903526542ac2309c08c769e517ea173a9f67cdb2)

"boot smoke test" dropped from task name for the MFC, because Cirrus
runs a build test only on stable/12 (see 05b9673637fe for details).

2 years agoi386: Make setidt_disp a size_t instead of uintptr_t
Mark Johnston [Tue, 1 Jun 2021 14:28:57 +0000 (10:28 -0400)]
i386: Make setidt_disp a size_t instead of uintptr_t

setidt_disp is the offset of the ISR trampoline relative to the address
of the routines in exception.s, so uintptr_t is not quite right.

Also remove a bogus declaration I added in commit 18f55c67f7, it is not
required after all.

Reported by: jrtc27
Reviewed by: jrtc27, kib
Sponsored by: The FreeBSD Foundation

(cherry picked from commit cbe59a6475b6c36fac4073bcfc328099fc873420)

2 years agopf: Avoid leaking pad bytes in struct pfr_astats when copying out
Mark Johnston [Tue, 1 Jun 2021 14:56:23 +0000 (10:56 -0400)]
pf: Avoid leaking pad bytes in struct pfr_astats when copying out

There is padding between pfr_astats.pfras_a and pfras_packets that was
not getting initialized.

Reported by: KMSAN
Reviewed by: kp, imp
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 60a38abb8982e11ee71559057dd7128bd097043e)

2 years agong_parse: IP address parsing in netgraph eating too many characters
Markus Stoff [Tue, 18 May 2021 20:35:33 +0000 (22:35 +0200)]
ng_parse: IP address parsing in netgraph eating too many characters

Once the final component of the IP address has been parsed, the offset
on the input must not be advanced, as this would remove an unparsed
character from the input.

Submitted by: Markus Stoff
Reviewed by: donner
Differential Revision: https://reviews.freebsd.org/D26489

(cherry picked from commit 63b6a08ce2467b8e230e7a4ecb3e1ddf1b48851c)

2 years agopf tests: Make killstate:match more robust
Kristof Provost [Thu, 3 Jun 2021 13:22:19 +0000 (15:22 +0200)]
pf tests: Make killstate:match more robust

The killstate:match test starts nc as a background process. There was no
guarantee that the nc process would have connected by the time we check
for states, so this test occasionally failed without good reason.

Teach the test to wait for at least some states to turn up before
executing the critical checks.

MFC after: 3 days
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 70dd30d49c29a27e1ef159660a7e3dbb84082674)

2 years agolibalias: Remove unused function LibAliasCheckNewLink
Lutz Donnerhacke [Sat, 15 May 2021 13:24:12 +0000 (15:24 +0200)]
libalias: Remove unused function LibAliasCheckNewLink

The functionality to detect a newly created link after processing a
single packet is decoupled from the packet processing.  Every new
packet is processed asynchronously and will reset the indicator, hence
the function is unusable.  I made a Google search for third party code,
which uses the function, and failed to find one.

That's why the function should be removed: It unusable and unused.
A much simplified API/ABI will remain in anything below 14.

Discussed with: kp
Reviewed by: manpages (bcr)
Differential Revision: https://reviews.freebsd.org/D30275

(cherry picked from commit bfd41ba1fe1d0e40b6a813aeb0354cac8d884f5b)

2 years agoffs: Correct the input size check in sysctl_ffs_fsck()
Mark Johnston [Mon, 31 May 2021 22:56:34 +0000 (18:56 -0400)]
ffs: Correct the input size check in sysctl_ffs_fsck()

Make sure we return an error if no input was specified, since
SYSCTL_IN() will report success in that case.

Reported by: KMSAN
Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation

(cherry picked from commit b2f9575646f89cdddcad76acae3e9305535506a2)

2 years agox86: Fix lapic_ipi_alloc() on i386
Mark Johnston [Mon, 31 May 2021 22:51:14 +0000 (18:51 -0400)]
x86: Fix lapic_ipi_alloc() on i386

The loop which checks to see if "dynamic" IDT entries are allocated
needs to compare with the trampoline address of the reserved ISR.
Otherwise it will never succeed.

Reported by: Harry Schmalzbauer <freebsd@omnilan.de>
Tested by: Harry Schmalzbauer <freebsd@omnilan.de>
Reviewed by: kib
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 18f55c67f746f0ad12fe972328234d340a621df9)

2 years agosqlite3: import sqlite3 3.35.5
Cy Schubert [Fri, 7 May 2021 01:01:44 +0000 (18:01 -0700)]
sqlite3: import sqlite3 3.35.5

Merge commit '0511e356f5e2106928ee352ee974d1470c860a9a' into new_merge

Changes at https://www.sqlite.org/releaselog/3_35_5.html.

MFC after:      1 month

(cherry picked from commit ce9de47260d4edc963a94140789e4a52642c28e6)

2 years agoImport sqlite 3.34.1 (3340100).
Cy Schubert [Mon, 25 Jan 2021 17:45:04 +0000 (09:45 -0800)]
Import sqlite 3.34.1 (3340100).

(cherry picked from commit 25cdacf79b06356c929e59d5074d26c9dac41bdf)

2 years agorun(4): add support for DLINK DWA-130 rev F1 wireless adaptor.
Dmitry Chagin [Sun, 23 May 2021 18:31:51 +0000 (21:31 +0300)]
run(4): add support for DLINK DWA-130 rev F1 wireless adaptor.

PR: 256092
Submitted by: Francois Briere <purplefiasco at gmail.com>

(cherry picked from commit 8746bc91873430d977b09bcc3fbd4d1b417a5a57)

2 years agorsu(4): add ASUS WL-167G V3 to the list of supported devices.
Dmitry Chagin [Sun, 23 May 2021 15:42:29 +0000 (18:42 +0300)]
rsu(4): add ASUS WL-167G V3 to the list of supported devices.

(cherry picked from commit b595729ccfde8e5d5bac0acf9690de9d437a1afd)

2 years agopf: Fix more ioctl memory leaks
Kristof Provost [Tue, 1 Jun 2021 14:05:47 +0000 (16:05 +0200)]
pf: Fix more ioctl memory leaks

We must also remember to free nvlists added to a parent nvlist with
nvlist_append_nvlist_array().

More importantly, when nvlist_pack() allocates memory for us it does so
in the M_NVLIST zone, so we must free it with free(.., M_NVLIST). Using
free(.., M_TEMP) as we did silently failed to free the memory.

MFC after: 3 days
Reported by: kib@
Tested by: kib@
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D30595

(cherry picked from commit 0f86492b09ca82042166a41f6f21b2dbe4f4a464)

2 years agonfsd: Add support for CLAIM_DELEG_PREV_FH to the NFSv4.1/4.2 Open
Rick Macklem [Fri, 21 May 2021 01:37:40 +0000 (18:37 -0700)]
nfsd: Add support for CLAIM_DELEG_PREV_FH to the NFSv4.1/4.2 Open

Commit b3d4c70dc60f added support for CLAIM_DELEG_CUR_FH to Open.
While doing this, I noticed that CLAIM_DELEG_PREV_FH support
could be added the same way.  Although I am not aware of any extant
NFSv4.1/4.2 client that uses this claim type, it seems prudent to add
support for this variant of Open to the NFSv4.1/4.2 server.

This patch does not affect mounts from extant NFSv4.1/4.2 clients,
as far as I know.

(cherry picked from commit d80a903a1c2acd73afbf06598955a0887433f8c6)

2 years agonfscl: Fix NFSv4.1/4.2 mount recovery from an expired lease
Rick Macklem [Wed, 19 May 2021 21:52:56 +0000 (14:52 -0700)]
nfscl: Fix NFSv4.1/4.2 mount recovery from an expired lease

The most difficult NFSv4 client recovery case happens when the
lease has expired on the server.  For NFSv4.0, the client will
receive a NFSERR_EXPIRED reply from the server to indicate this
has happened.
For NFSv4.1/4.2, most RPCs have a Sequence operation and, as such,
the client will receive a NFSERR_BADSESSION reply when the lease
has expired for these RPCs.  The client will then call nfscl_recover()
to handle the NFSERR_BADSESSION reply.  However, for the expired lease
case, the first reclaim Open will fail with NFSERR_NOGRACE.

This patch recognizes this case and calls nfscl_expireclient()
to handle the recovery from an expired lease.

This patch only affects NFSv4.1/4.2 mounts when the lease
expires on the server, due to a network partitioning that
exceeds the lease duration or similar.

(cherry picked from commit c28cb257ddfe3339756f6fd659fa4a2efa4de2cb)

2 years agoaic7xxx: Fix re-building firmware with -fno-common
Jessica Clarke [Fri, 28 May 2021 18:07:17 +0000 (19:07 +0100)]
aic7xxx: Fix re-building firmware with -fno-common

The generated C output for aicasm_scan.l defines yylineno already, so
references to it from other files should use an extern declaration.

The STAILQ_HEAD use in aicasm_symbol.h also provided an identifier,
causing it to both define the struct type and define a variable of that
struct type, causing any C file including the header to define the same
variable. This variable is not used (and confusingly clashes with a
field name just below) and was likely caused by confusion when switching
between defining fields using similar type macros and defining the type
itself.

Reviewed by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30525

(cherry picked from commit 5e912f5fec025766521f535d1237330ede7f18e2)

2 years agolibpfctl: Improve error handling in pfctl_get_states()
Kristof Provost [Thu, 27 May 2021 09:43:17 +0000 (11:43 +0200)]
libpfctl: Improve error handling in pfctl_get_states()

Ensure that we always free nvlists and other allocated memory.

Reviewed by: scottl
MFC after: 3 days
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D30493

(cherry picked from commit 27c77f42ae7402c313deec47aa67a8a8e0889410)

2 years agolibpfctl: fix memory leak
Kristof Provost [Thu, 27 May 2021 09:28:36 +0000 (11:28 +0200)]
libpfctl: fix memory leak

When we create an nvlist and insert it into another nvlist we must
remember to destroy it. The nvlist_add_nvlist() function makes a copy,
just like nvlist_add_string() makes a copy of the string.

See also 4483fb47735c29408c72045469c9c4b3e549668b

Reviewed by: scottl
MFC after: 3 days
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D30492

(cherry picked from commit 6dbb729d35d59cc8bc8451bd56f220f9c35a43f3)

2 years agonfscl: Revert commit 5a8b2c5a46dffa3828ad16abee36ac4676f741bf
Rick Macklem [Thu, 3 Jun 2021 01:13:21 +0000 (18:13 -0700)]
nfscl: Revert commit 5a8b2c5a46dffa3828ad16abee36ac4676f741bf

This is a direct commit, since the MFC mis-merged.

2 years agoipfilter: Fix ip_nat memory leak and use-after-free
Cy Schubert [Tue, 25 May 2021 18:54:49 +0000 (11:54 -0700)]
ipfilter: Fix ip_nat memory leak and use-after-free

Unfortunately the wrong elemet is freed, also resulting in use-after-free.

PR: 255859
Submitted by: lylgood@foxmail.com
Reported by: lylgood@foxmail.com

(cherry picked from commit 323a4e2c4e285e6f8eee8db3fe2cb7490a734da0)

2 years agoMFV d60fa10fd872db7e3d8cb1e161cfdae026c43b14:
Cy Schubert [Wed, 10 Feb 2021 04:25:05 +0000 (20:25 -0800)]
MFV d60fa10fd872db7e3d8cb1e161cfdae026c43b14:

Update unbound 1.13.0 --> 1.13.1.

Includes numerous bugfixes documented at:
https://www.nlnetlabs.nl/projects/unbound/download/#unbound-1-13-1

(cherry picked from commit f44e67d120ad78ef7894241b519ee79fd190a16e)

2 years agonfscl: Fix NFSv4.1/4.2 mount recovery from an expired lease
Rick Macklem [Wed, 19 May 2021 21:52:56 +0000 (14:52 -0700)]
nfscl: Fix NFSv4.1/4.2 mount recovery from an expired lease

The most difficult NFSv4 client recovery case happens when the
lease has expired on the server.  For NFSv4.0, the client will
receive a NFSERR_EXPIRED reply from the server to indicate this
has happened.
For NFSv4.1/4.2, most RPCs have a Sequence operation and, as such,
the client will receive a NFSERR_BADSESSION reply when the lease
has expired for these RPCs.  The client will then call nfscl_recover()
to handle the NFSERR_BADSESSION reply.  However, for the expired lease
case, the first reclaim Open will fail with NFSERR_NOGRACE.

This patch recognizes this case and calls nfscl_expireclient()
to handle the recovery from an expired lease.

This patch only affects NFSv4.1/4.2 mounts when the lease
expires on the server, due to a network partitioning that
exceeds the lease duration or similar.

(cherry picked from commit c28cb257ddfe3339756f6fd659fa4a2efa4de2cb)

2 years agopf tests: Only log critical errors from scapy
Kristof Provost [Wed, 26 May 2021 11:07:50 +0000 (13:07 +0200)]
pf tests: Only log critical errors from scapy

See a26e895f3d803cc1f4ee1c2b33c61330998808b9. Silence these new tests as
well.

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 9d0bc96ef8c0288c05a627b3961edd2da046c5c9)

2 years agopf tests: Test cases for fragment reassembly
Kristof Provost [Thu, 25 Feb 2021 08:50:57 +0000 (09:50 +0100)]
pf tests: Test cases for fragment reassembly

Obtained from: Alexander Bluhm, OpenBSD

(cherry picked from commit d39d5ee2d67f61abc890b51973b5c4a0c81d6647)

2 years agoCirrus-CI: avoid boot smoke test on stable/12
Ed Maste [Wed, 2 Jun 2021 14:11:40 +0000 (10:11 -0400)]
Cirrus-CI: avoid boot smoke test on stable/12

The boot smoke test boots from a FAT filesystem (created in-memory
by QEMU), but this does not work on stable/12:

mountroot: waiting for device /dev/ada0s1...
Mounting from msdosfs:/dev/ada0s1 failed with error 19.

For now on stable/12 use Cirrus-CI as only a build test.

Sponsored by: The FreeBSD Foundation

2 years agonetsmb: Avoid a read-after-free in smb_t2_request_int()
Mark Johnston [Wed, 26 May 2021 13:57:38 +0000 (09:57 -0400)]
netsmb: Avoid a read-after-free in smb_t2_request_int()

Defer freeing the request structure until we've decided whether the
request should be retried.

PR: 255881
MFC after: 1 week

(cherry picked from commit 771e95d2e2ee1b60539f1273c62837b48249590a)

2 years agorpcsec_gss: Use a designated initializer for rpc_gss_ops
Mark Johnston [Wed, 26 May 2021 14:14:35 +0000 (10:14 -0400)]
rpcsec_gss: Use a designated initializer for rpc_gss_ops

No functional change intended.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

(cherry picked from commit ba5bc6e8f9cb9c523d09599d7290a6d75ec9fd8b)

2 years agocxgb: Avoid a read-after-free in get_packet() when cxgb_debug is on
Mark Johnston [Wed, 26 May 2021 14:02:19 +0000 (10:02 -0400)]
cxgb: Avoid a read-after-free in get_packet() when cxgb_debug is on

PR: 255863
MFC after: 1 week

(cherry picked from commit 16f8f89c5c1f324a15a7e0607f03f041a230a572)

2 years agoacpi: Add missing error handling to acpi_pci_link_route_irqs()
Mark Johnston [Wed, 26 May 2021 14:34:39 +0000 (10:34 -0400)]
acpi: Add missing error handling to acpi_pci_link_route_irqs()

Otherwise the resouce buffer may have been freed when
AcpiSetCurrentResources() is called, leading to a use-after-free.

PR: 255862
Submitted by: Lv Yunlong <lylgood@foxmail.com> (original version)
MFC after: 1 week

(cherry picked from commit 4cf33275289088e3b0a913a44b5cd549e348094d)

2 years agotests/libalias: Test LibAliasIn and redirection
Lutz Donnerhacke [Sun, 23 May 2021 12:43:00 +0000 (14:43 +0200)]
tests/libalias: Test LibAliasIn and redirection

Rework the tests to check the correct layer in a single test. Factor
out tests for reuse in other modules. Extend the test suite for
libalias(3) to incoming connections. Test the various types of
redirections.

gettimeofday(3) is almost as expensive as the calls to libalias.
So the call frequency for this call is reduced by a factor of 1000 in
order to neglect it's influence.

Using NAT entries became more realistic: A communication of a random
length of up to 150 packets (10% outgoing, 90% incoming) is applied
for each entry.

Add port forwardings to the performance tests.  This will cause random
incoming packets to match the random port forwardings opends beforehand.

After a long test run, a lot of ressouces have been allocated.
Measure the time tot free them.

Reviewed by: kp (partially)
Differential Revision: https://reviews.freebsd.org/D30412
Differential Revision: https://reviews.freebsd.org/D30408
Differential Revision: https://reviews.freebsd.org/D30405
Differential Revision: https://reviews.freebsd.org/D30443

(cherry picked from commit f1462ab0512c1a0e59f03a7a145df2889bed2997)
(cherry picked from commit 755bab6d55e6e2df168f352f3e2fbdea87002ed8)
(cherry picked from commit 6e87898a2c7e99937656a0c12d03333a43a10c5e)
(cherry picked from commit d62e1ecba07b2acee37e019778087f0f55d977d1)
(cherry picked from commit 5434ebd256a08e452dec376c1488abdf7ff02af8)

Fix various bugs:
(cherry picked from commit ccac04cae538a625cbce224e4005360fa85e1b9d)
(cherry picked from commit 7b8696bf128754712a24ba98ce2d88eed2ee68dc)
(cherry picked from commit fef99da69f983566de3cb8ad4a1b8decc31348ce)
(cherry picked from commit f4c460dacdda5c6e1896a0c51d6096c4f3417b32)

3 years agoiwn(4): Remove duplicate device entry
Gordon Bergling [Sun, 30 May 2021 13:40:33 +0000 (15:40 +0200)]
iwn(4): Remove duplicate device entry

'Intel Centrino Wireless-N 6250' is listed twice in the description
section of the manual page.

PR: 256257
Reported by: Daniel Cervus <danielthedeer at outlook dot com>

(cherry picked from commit 66e2a5803b0f80fff3bb8e3659ae7411ef94cc35)

3 years agotcsh: update to version 6.22.04.
Dmitry Chagin [Wed, 19 May 2021 21:12:27 +0000 (00:12 +0300)]
tcsh: update to version 6.22.04.

Merge commit '174d8b60324d7e8754709f7155e13ca95220b48c' into main.

(cherry picked from commit 6560ac57ce879857203bc456cdc3849808dc0700)

3 years agotcsh: cleanup source tree to reduce diff size.
Dmitry Chagin [Wed, 19 May 2021 21:08:25 +0000 (00:08 +0300)]
tcsh: cleanup source tree to reduce diff size.

Remove makefiles, configure files and unused at build time files
to reduce the diff size. Otherwise the diff contains a lot of
unnecessary lines what makes reviewing and merging proccess so hard,
especially for re@.

(cherry picked from commit 6190ff6104aed4cd753019325a252c4d66495b5e)

3 years agoFix packet cbs/ebs conversion.
Alexander Motin [Wed, 19 May 2021 15:00:21 +0000 (11:00 -0400)]
Fix packet cbs/ebs conversion.

Each packet is counted as 128 bytes by the code, not 125.  Not sure
what I was thinking about here 14 years ago.  May be just a typo.

Reported by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 2 weeks

(cherry picked from commit 4a6830761c6552bfe2c118a73a5a461694cb84c7)

3 years agopf: Move nvlist conversion functions to pf_nv
Kristof Provost [Tue, 18 May 2021 07:24:50 +0000 (09:24 +0200)]
pf: Move nvlist conversion functions to pf_nv

Separate the conversion functions (between kernel structs and nvlists)
to pf_nv. This reduces the size of pf_ioctl.c, which is already quite
large and complex, a good bit. It also keeps all the fairly
straightforward conversion code together.

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D30359

(cherry picked from commit 3032c353882aa70a461ef251b8aa6c59a0829ec5)

3 years agorun(4): fix manual after d6fd321ef60d43dce9f437187c94a7de2b91ab69.
Dmitry Chagin [Sun, 23 May 2021 13:35:31 +0000 (16:35 +0300)]
run(4): fix manual after d6fd321ef60d43dce9f437187c94a7de2b91ab69.

PR: 255759

(cherry picked from commit 43f5d5bf01fdf821e8037272c636a9be18323e00)

3 years agorun(4): add support for ASUS USB-N14 wireless adaptor.
Dmitry Chagin [Sat, 22 May 2021 10:52:12 +0000 (13:52 +0300)]
run(4): add support for ASUS USB-N14 wireless adaptor.

PR: 255759
Submitted by: john.lmurdoch at gmail.com

(cherry picked from commit d6fd321ef60d43dce9f437187c94a7de2b91ab69)

3 years agoDRIVER_MODULE(9): Correct the SYNOPSIS of EARLY_DRIVER_MODULE()
J.R. Oldroyd [Mon, 24 May 2021 14:54:45 +0000 (16:54 +0200)]
DRIVER_MODULE(9): Correct the SYNOPSIS of EARLY_DRIVER_MODULE()

The man page SYNOPSIS for EARLY_DRIVER_MODULE() shows that it has
an "enum sysinit_elem_order order" argument.

The actual macro in sys/bus.h does not have an order argument.

PR: 256103
Reported by: J.R. Oldroyd <fbsd at opal dot com>
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D30411

(cherry picked from commit 3fdd5c1e49cbc0a77935eb34e3561c6021b93650)

3 years agonfsd: Add support for CLAIM_DELEG_CUR_FH to the NFSv4.1/4.2 Open
Rick Macklem [Tue, 18 May 2021 22:53:54 +0000 (15:53 -0700)]
nfsd: Add support for CLAIM_DELEG_CUR_FH to the NFSv4.1/4.2 Open

The Linux NFSv4.1/4.2 client now uses the CLAIM_DELEG_CUR_FH
variant of the Open operation when delegations are recalled and
the client has a local open of the file.  This patch adds
support for this variant of Open to the NFSv4.1/4.2 server.

This patch only affects mounts from Linux clients when delegations
are enabled on the server.

(cherry picked from commit b3d4c70dc60f1913f2363751b905b562c39ca126)

3 years agonfsd: Reduce the callback timeout to 800msec
Rick Macklem [Tue, 18 May 2021 23:17:58 +0000 (16:17 -0700)]
nfsd: Reduce the callback timeout to 800msec

Recent discussion on the nfsv4@ietf.org mailing list confirmed
that an NFSv4 server should reply to an RPC in less than 1second.
If an NFSv4 RPC requires a delegation be recalled,
the server will attempt a CB_RECALL callback.
If the client is not responsive, the RPC reply will be delayed
until the callback times out.
Without this patch, the timeout is set to 4 seconds (set in
ticks, but used as seconds), resulting in the RPC reply taking over 4sec.
This patch redefines the constant as being in milliseconds and it
implements that for a value of 800msec, to ensure the RPC
reply is sent in less than 1second.

This patch only affects mounts from clients when delegations
are enabled on the server and the client is unresponsive to callbacks.

(cherry picked from commit fc0dc94029df8150301b925bda690b20d9d0bcbf)

3 years agotaskqueue: Add missing comma to TASKQUEUE_FAST_DEFINE_THREAD
Colin Percival [Tue, 25 May 2021 03:37:55 +0000 (20:37 -0700)]
taskqueue: Add missing comma to TASKQUEUE_FAST_DEFINE_THREAD

Add missing comma to TASKQUEUE_FAST_DEFINE_THREAD arguments to prevent
compilation errors.

Submitted by: ashafer_badland.io

(cherry picked from commit 27f09959d5f507465cc7f202c1b34987f0cdee55)

3 years agotcp: Use local CC data only in the correct context
Richard Scheffenegger [Wed, 26 May 2021 17:45:06 +0000 (19:45 +0200)]
tcp: Use local CC data only in the correct context

Most CC algos do use local data, and when calling
newreno_cong_signal from there, the latter misinterprets
the data as its own struct, leading to incorrect behavior.

Reported by:  chengc_netapp.com
Reviewed By:  chengc_netapp.com, tuexen, #transport
MFC after:    3 days
Sponsored By: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D30470

(cherry picked from commit c358f1857f0c749ad166fb9e9bef04f4033f3a72)

3 years agoNFSv4 server: Re-establish the delegation recall timeout
Rick Macklem [Sun, 16 May 2021 23:40:01 +0000 (16:40 -0700)]
NFSv4 server: Re-establish the delegation recall timeout

Commit 7a606f280a3e allowed the server to do retries of CB_RECALL
callbacks every couple of seconds.  This was needed to allow the
Linux client to re-establish the back channel.
However this patch broke the delegation timeout check, such that
it would just keep retrying CB_RECALLS.
If the client has crashed or been network patitioned from the
server, this continues until the client TCP reconnects to
the server and re-establishes the back channel.

This patch modifies the code such that it still times out the
delegation recall after some minutes, so that the server will
allow the conflicting client request once the delegation times out.

This patch only affects the NFSv4 server when delegations are
enabled and a NFSv4 client that holds a delegation has crashed
or been network partitioned from the server for at least several
minutes when a delegation needs to be recalled.

(cherry picked from commit 46269d66ed02598c86756d81a7d7b27ec0f0c5cd)

3 years agoFix handling of embedded symbolic links
Kirk McKusick [Mon, 17 May 2021 00:02:42 +0000 (17:02 -0700)]
Fix handling of embedded symbolic links

Sponsored by: Netflix

(cherry picked from commit 9a2fac6ba65fbd14d37ccedbc2aec27a190128ea)

3 years agolibalias: replace placeholder with static constant
Lutz Donnerhacke [Thu, 13 May 2021 21:47:57 +0000 (23:47 +0200)]
libalias: replace placeholder with static constant

The field nullAddress in struct libalias is never set and never used.
It exists as a placeholder for an unused argument only.

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

(cherry picked from commit 189f8eea138a78b09c9f19114b1362b0df1cf87d)
(cherry picked from commit b03a41befeaf17ef25da96fc7bc2dc19c9a6b253)

3 years agolibalias: Style cleanup
Lutz Donnerhacke [Fri, 14 May 2021 13:08:08 +0000 (15:08 +0200)]
libalias: Style cleanup

libalias is a convolut of various coding styles modified by a series
of different editors enforcing interesting convetions on spacing and
comments.

This patch is a baseline to start with a perfomance rework of
libalias.  Upcoming patches should be focus on the code, not on the
style.  That's why most annoying style errors should be fixed
beforehand.

Reviewed by: hselasky
Discussed by: emaste
Differential Revision: https://reviews.freebsd.org/D30259

(cherry picked from commit effc8e57fbf03d7f1423c662caf2b63f0d1d21a9)

At some places the ASSERT was inserted before variable declarations are
finished.  This is fixed now.

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

(cherry picked from commit 2e6b07866f9e1520626a1523f6609cc411bdda1c)

3 years agoliblias: clean up empty lines in .c and .h files
Mateusz Guzik [Sun, 30 May 2021 19:12:53 +0000 (21:12 +0200)]
liblias: clean up empty lines in .c and .h files

Partial apply of a huge commit to libalias only
(cherry picked from commit 662c13053f4bf2d6245ba7e2b66c10d1cd5c1fb9)

3 years agolibalias: Fix remaining compiler warnings
Alex Richardson [Tue, 19 Jan 2021 11:32:32 +0000 (11:32 +0000)]
libalias: Fix remaining compiler warnings

This fixes some sign-compare warnings and adds a missing static to a
variable declaration.

Differential Revision: https://reviews.freebsd.org/D27883

3 years agolibalias: Fix -Wcast-align compiler warnings
Alex Richardson [Tue, 19 Jan 2021 11:32:32 +0000 (11:32 +0000)]
libalias: Fix -Wcast-align compiler warnings

This fixes -Wcast-align warnings caused by the underaligned `struct ip`.
This also silences them in the public functions by changing the function
signature from char * to void *. This is source and binary compatible and
avoids the -Wcast-align warning.

Reviewed By: ae, gbe (manpages)
Differential Revision: https://reviews.freebsd.org/D27882

3 years agotests/libalias: Reduce stress
Lutz Donnerhacke [Sun, 23 May 2021 20:41:26 +0000 (22:41 +0200)]
tests/libalias: Reduce stress

Due to the new, external performance test utility, the regular test
suite can reduce the stress test to a fair amount of activity.

(cherry picked from commit a660948b7b2d875591aba3713620424c51330038)

3 years agoAdd support for Gemini Lake LPSS UARTs.
Konstantin Belousov [Sun, 23 May 2021 16:38:54 +0000 (19:38 +0300)]
Add support for Gemini Lake LPSS UARTs.

PR: 256101

(cherry picked from commit eaf00819bcfa90ab7ac8af324826eb985197d8c8)