]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agopf: Allow states to by killed per 'gateway'
Kristof Provost [Fri, 30 Apr 2021 13:15:05 +0000 (15:15 +0200)]
pf: Allow states to by killed per 'gateway'

This allows us to kill states created from a rule with route-to/reply-to
set.  This is particularly useful in multi-wan setups, where one of the
WAN links goes down.

Submitted by: Steven Brown
Obtained from: https://github.com/pfsense/FreeBSD-src/pull/11/
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D30058

(cherry picked from commit abbcba9cf5b1c26e837f00e0fbc205652cb05e51)

3 years agopfctl: Optionally show gateway information for states
Kristof Provost [Wed, 28 Apr 2021 16:17:40 +0000 (18:17 +0200)]
pfctl: Optionally show gateway information for states

When showing the states, in very verbose mode, also display the gateway
(i.e. the target for route-to/reply-to).

Submitted by: Steven Brown
Reviewed by: donner
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D30051

(cherry picked from commit cc948296e632e023f9374ccee68b5710f2ad54a9)

3 years agopfctl: Start using DIOCKILLSTATESNV
Kristof Provost [Thu, 29 Apr 2021 19:24:56 +0000 (21:24 +0200)]
pfctl: Start using DIOCKILLSTATESNV

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

(cherry picked from commit 2a00c4db93b8db0c326a57363ca8a690ef6ab082)

3 years agopfctl: Start using DIOCCLRSTATESNV
Kristof Provost [Thu, 29 Apr 2021 13:10:50 +0000 (15:10 +0200)]
pfctl: Start using DIOCCLRSTATESNV

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

(cherry picked from commit 53714a586133fd8ae662427007f84ec663cd83ef)

3 years agopf: Introduce DIOCKILLSTATESNV
Kristof Provost [Thu, 29 Apr 2021 15:20:36 +0000 (17:20 +0200)]
pf: Introduce DIOCKILLSTATESNV

Introduce an nvlist based alternative to DIOCKILLSTATES.

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

(cherry picked from commit e989530a09b6e9f77b89c950ecf32f1b4fa709da)

3 years agopf: Introduce DIOCCLRSTATESNV
Kristof Provost [Thu, 29 Apr 2021 09:07:02 +0000 (11:07 +0200)]
pf: Introduce DIOCCLRSTATESNV

Introduce an nvlist variant of DIOCCLRSTATES.

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

(cherry picked from commit 7606a45dcc87cb6b222af929dad37b615cb925cf)

3 years agorelease.sh: pass UNAME_r for embedded builds
Glen Barber [Thu, 13 May 2021 15:02:16 +0000 (11:02 -0400)]
release.sh: pass UNAME_r for embedded builds

This is a direct commit to stable/12 due to a merge conflict
mistake.

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

3 years agorelease: fix logic for ports update/checkout if the directory exists
Glen Barber [Wed, 12 May 2021 15:29:54 +0000 (11:29 -0400)]
release: fix logic for ports update/checkout if the directory exists

This is a direct commit to stable/12.

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

3 years agorelease: fix command to check out ports tree
Glen Barber [Wed, 12 May 2021 15:12:34 +0000 (11:12 -0400)]
release: fix command to check out ports tree

This is a direct commit to stable/12.

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

3 years agorelease: permanently remove the 'reldoc' target and associates
Glen Barber [Thu, 18 Feb 2021 04:00:03 +0000 (23:00 -0500)]
release: permanently remove the 'reldoc' target and associates

Following 7b1d1a1658ffb69eff93afc713f9e88ed8b20eac, the structure
for the reldoc target has significantly changed as result of the
ASCIIDoctor/Hugo migration.  As the release notes related files
on the installation medium are inherently out of date, purge them
entirely.

Discussed within: re, doceng
No objection: re (silence), doceng (silence)
Timeout: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit f61e92ca5a23450bc28169bbdd71d7674df98c19)

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

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

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

(cherry picked from commit 7b1d1a1658ffb69eff93afc713f9e88ed8b20eac)

3 years agofull(4): Use correct section name for AUTHORS
Gordon Bergling [Sun, 9 May 2021 15:31:52 +0000 (17:31 +0200)]
full(4): Use correct section name for AUTHORS

PR: 255715
Reported by: Christos Margiolis <christos at christosmarg dot xyz>

(cherry picked from commit 416051f5818e3270e019ef8978e2f1168f2628fc)

3 years agonfscl: Fix mis-merge in cherry-pick commit 44d99af3c545
Rick Macklem [Wed, 12 May 2021 02:46:46 +0000 (19:46 -0700)]
nfscl: Fix mis-merge in cherry-pick commit 44d99af3c545

This is a direct commit.

3 years agonfscl: add check for NULL clp and forced dismounts to nfscl_delegreturnvp()
Rick Macklem [Wed, 28 Apr 2021 00:30:16 +0000 (17:30 -0700)]
nfscl: add check for NULL clp and forced dismounts to nfscl_delegreturnvp()

Commit aad780464fad added a function called nfscl_delegreturnvp()
to return delegations during the NFS VOP_RECLAIM().
The function erroneously assumed that nm_clp would
be non-NULL. It will be NULL for NFSV4.0 mounts until
a regular file is opened. It will also be NULL during
vflush() in nfs_unmount() for a forced dismount.

This patch adds a check for clp == NULL to fix this.

Also, since it makes no sense to call nfscl_delegreturnvp()
during a forced dismount, the patch adds a check for that
case and does not do the call during forced dismounts.

PR: 255436
(cherry picked from commit f6fec55fe30088bbefd3efe70b62565399a7b9b8)

3 years agonfscl: return delegations in the NFS VOP_RECLAIM()
Rick Macklem [Mon, 26 Apr 2021 00:57:55 +0000 (17:57 -0700)]
nfscl: return delegations in the NFS VOP_RECLAIM()

After a vnode is recycled it can no longer be
acquired via vfs_hash_get() and, as such,
a delegation for the vnode cannot be recalled.

In the unlikely event that a delegation still
exists when the vnode is being recycled, return
the delegation since it will no longer be
recallable.

Until you have this patch in your NFSv4 client,
you should consider avoiding the use of delegations.

(cherry picked from commit aad780464fad1e32c97316515a4044d661413a6b)

3 years agopf: Error tracing SDTs
Kristof Provost [Tue, 20 Apr 2021 09:18:26 +0000 (11:18 +0200)]
pf: Error tracing SDTs

Add additional DTrace static trace points to facilitate debugging
failing pf ioctl calls.

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

(cherry picked from commit 6b146f3b9b665c9baf6ba2cb038bbee359cb738a)

3 years agopf tests: Test set keepcounters
Kristof Provost [Thu, 15 Apr 2021 14:53:16 +0000 (16:53 +0200)]
pf tests: Test set keepcounters

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

(cherry picked from commit e14d56f370184fdf7ef33ec57883a45f4a220cff)

3 years agopf: Optionally attempt to preserve rule counter values across ruleset updates
Kristof Provost [Thu, 15 Apr 2021 14:12:11 +0000 (16:12 +0200)]
pf: Optionally attempt to preserve rule counter values across ruleset updates

Usually rule counters are reset to zero on every update of the ruleset.
With keepcounters set pf will attempt to find matching rules between old
and new rulesets and preserve the rule counters.

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

(cherry picked from commit 42ec75f83aa321fcea8d2eddc4e9099724f0669e)

3 years agopf: Implement the NAT source port selection of MAP-E Customer Edge
Kurosawa Takahiro [Tue, 13 Apr 2021 08:50:00 +0000 (10:50 +0200)]
pf: Implement the NAT source port selection of MAP-E Customer Edge

MAP-E (RFC 7597) requires special care for selecting source ports
in NAT operation on the Customer Edge because a part of bits of the port
numbers are used by the Border Relay to distinguish another side of the
IPv4-over-IPv6 tunnel.

PR: 254577
Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D29468

(cherry picked from commit 2aa21096c7349390f22aa5d06b373a575baed1b4)

3 years agonfscl: fix the handling of NFSERR_DELAY for Open/LayoutGet RPCs
Rick Macklem [Tue, 27 Apr 2021 00:48:21 +0000 (17:48 -0700)]
nfscl: fix the handling of NFSERR_DELAY for Open/LayoutGet RPCs

For a pNFS mount, the NFSv4.1/4.2 client uses compound RPCs that
have both Open and LayoutGet operations in them.
If the pNFS server were tp reply NFSERR_DELAY for one of these
compounds, the retry after a delay cannot be handled by
newnfs_request(), since there is a reference held on the open
state for the Open operation in them.

Fix this by adding these RPCs to the "don't do delay here"
list in newnfs_request().

This patch is only needed if the mount is using pNFS (the "pnfs"
mount option) and probably only matters if the MDS server
is issuing delegations as well as pNFS layouts.

Found by code inspection.

(cherry picked from commit f5ff282bc025f0395afcef40f5b6e778202c4181)

3 years agonfsd: fix a NFSv4.1 Linux client mount stuck in CLOSE_WAIT
Rick Macklem [Tue, 27 Apr 2021 22:32:35 +0000 (15:32 -0700)]
nfsd: fix a NFSv4.1 Linux client mount stuck in CLOSE_WAIT

It was reported that a NFSv4.1 Linux client mount against
a FreeBSD12 server was hung, with the TCP connection in
CLOSE_WAIT state on the server.
When a NFSv4.1/4.2 mount is done and the back channel is
bound to the TCP connection, the soclose() is delayed until
a new TCP connection is bound to the back channel, due to
a reference count being held on the SVCXPRT structure in
the krpc for the socket. Without the soclose() call, the socket
will remain in CLOSE_WAIT and this somehow caused the Linux
client to hang.

This patch adds calls to soshutdown(.., SHUT_WR) that
are performed when the server side krpc sees that the
socket is no longer usable.  Since this can be done
before the back channel is bound to a new TCP connection,
it allows the TCP connection to proceed to CLOSED state.

PR: 254590
(cherry picked from commit db8c27f499105dcc9872dcc46e88bdd570c24fee)

3 years agonfsclient: Copy only initialized fields in nfs_getattr()
Mark Johnston [Tue, 4 May 2021 12:53:57 +0000 (08:53 -0400)]
nfsclient: Copy only initialized fields in nfs_getattr()

When loading attributes from the cache, the NFS client is careful to
copy only the fields that it initialized.  After fetching attributes
from the server, however, it would copy the entire vattr structure
initialized from the RPC response, so uninitialized stack bytes would
end up being copied to userspace.  In particular, va_birthtime (v2 and
v3) and va_gen (v3) had this problem.

Use a common subroutine to copy fields provided by the NFS client, and
ensure that we provide a dummy va_gen for the v3 case.

Reviewed by: rmacklem
Reported by: KMSAN
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30090

(cherry picked from commit 8bde6d15d1fa9a947c2bdc5eddae36cfbb1076dc)

3 years agopf: Trivial typo fix
Kristof Provost [Thu, 29 Apr 2021 08:34:00 +0000 (10:34 +0200)]
pf: Trivial typo fix

PV -> PF

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

(cherry picked from commit eaabed8ac449dbd9a7f4f567e9378bda4636221e)

3 years agopfsync: Expose PFSYNCF_OK flag to userspace
Kristof Provost [Fri, 23 Apr 2021 12:24:59 +0000 (14:24 +0200)]
pfsync: Expose PFSYNCF_OK flag to userspace

Add 'syncok' field to ifconfig's pfsync interface output. This allows
userspace to figure out when pfsync has completed the initial bulk
import.

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

(cherry picked from commit 5f5bf88949df421ec3ccd7e14a999e8d8b9251bf)

3 years agopf tests: Test killing states with multiple labels
Kristof Provost [Wed, 21 Apr 2021 14:12:48 +0000 (16:12 +0200)]
pf tests: Test killing states with multiple labels

Now that we support having multiple labels on a rule ensure that we can
use each rule label to kill states.

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

(cherry picked from commit 5632f585355ad380cb9ef932c419e2efdb1fc46b)

3 years agopf: Allow multiple labels to be set on a rule
Kristof Provost [Tue, 20 Apr 2021 09:04:48 +0000 (11:04 +0200)]
pf: Allow multiple labels to be set on a rule

Allow up to 5 labels to be set on each rule.
This offers more flexibility in using labels. For example, it replaces
the customer 'schedule' keyword used by pfSense to terminate states
according to a schedule.

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

(cherry picked from commit 6fcc8e042ac480f9276177339f7de1ad0f95c1b0)

3 years agopf tests: Test automatically generated tables
Kristof Provost [Mon, 26 Apr 2021 09:14:44 +0000 (11:14 +0200)]
pf tests: Test automatically generated tables

Add a test case where the pfctl optimizer will generate a table
automatically. These tables have long names, which we accidentally broke
in the nvlist ADDRULE ioctl.

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

(cherry picked from commit 08d77308211f823b8532d27790e8fd29eaf75c77)

3 years agopf: Fix parsing of long table names
Kristof Provost [Sat, 24 Apr 2021 13:55:24 +0000 (15:55 +0200)]
pf: Fix parsing of long table names

When parsing the nvlist for a struct pf_addr_wrap we unconditionally
tried to parse "ifname". This broke for PF_ADDR_TABLE when the table
name was longer than IFNAMSIZ. PF_TABLE_NAME_SIZE is longer than
IFNAMSIZ, so this is a valid configuration.

Only parse (or return) ifname or tblname for the corresponding
pf_addr_wrap type.

This manifested as a failure to set rules such as these, where the pfctl
optimiser generated an automatic table:

pass in proto tcp to 192.168.0.1 port ssh
pass in proto tcp to 192.168.0.2 port ssh
pass in proto tcp to 192.168.0.3 port ssh
pass in proto tcp to 192.168.0.4 port ssh
pass in proto tcp to 192.168.0.5 port ssh
pass in proto tcp to 192.168.0.6 port ssh
pass in proto tcp to 192.168.0.7 port ssh

Reported by: Florian Smeets
Tested by: Florian Smeets
Reviewed by: donner
X-MFC-With: 5c11c5a3655842a176124ef2334fcdf830422c8a
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D29962

(cherry picked from commit 402dfb0a8d2c6417cb9bff4460ef250a42b0aa05)

3 years agoUPDATING: Add an entry for commit e9959506d2cc
Rick Macklem [Mon, 10 May 2021 16:05:10 +0000 (09:05 -0700)]
UPDATING: Add an entry for commit e9959506d2cc

3 years agoparam.h: Bump __FreeBSD_version to 1202507 for commit e9959506d2cc
Rick Macklem [Mon, 10 May 2021 16:00:50 +0000 (09:00 -0700)]
param.h: Bump __FreeBSD_version to 1202507 for commit e9959506d2cc

Commit e9959506d2cc changed the internal KAPI between the
nfscl.ko and nfscommon.ko modules, so they both need to be
rebuilt from sources.

3 years agonfsd: fix the slot sequence# when a callback fails
Rick Macklem [Mon, 26 Apr 2021 23:24:10 +0000 (16:24 -0700)]
nfsd: fix the slot sequence# when a callback fails

Commit 4281bfec3628 patched the server so that the
callback session slot would be free'd for reuse when
a callback attempt fails.
However, this can often result in the sequence# for
the session slot to be advanced such that the client
end will reply NFSERR_SEQMISORDERED.

To avoid the NFSERR_SEQMISORDERED client reply,
this patch negates the sequence# advance for the
case where the callback has failed.
The common case is a failed back channel, where
the callback cannot be sent to the client, and
not advancing the sequence# is correct for this
case.  For the uncommon case where the client's
reply to the callback is lost, not advancing the
sequence# will indicate to the client that the
next callback is a retry and not a new callback.
But, since the FreeBSD server always sets "csa_cachethis"
false in the callback sequence operation, a retry
and a new callback should be handled the same way
by the client, so this should not matter.

Until you have this patch in your NFSv4.1/4.2 server,
you should consider avoiding the use of delegations.
Even with this patch, interoperation with the
Linux NFSv4.1/4.2 client in kernel versions prior
to 5.3 can result in frequent 15second delays if
delegations are enabled.  This occurs because, for
kernels prior to 5.3, the Linux client does a TCP
reconnect every time it sees multiple concurrent
callbacks and then it takes 15seconds to recover
the back channel after doing so.

(cherry picked from commit 87597731488105dd1ab921a95e39bb62e1abe668)

3 years agonfsd: fix session slot handling for failed callbacks
Rick Macklem [Fri, 23 Apr 2021 22:24:47 +0000 (15:24 -0700)]
nfsd: fix session slot handling for failed callbacks

When the NFSv4.1/4.2 server does a callback to a client
on the back channel, it will use a session slot in the
back channel session. If the back channel has failed,
the callback will fail and, without this patch, the
session slot will not be released.
As more callbacks are attempted, all session slots
can become busy and then the nfsd thread gets stuck
waiting for a back channel session slot.

This patch frees the session slot upon callback
failure to avoid this problem.

Without this patch, the problem can be avoided by leaving
delegations disabled in the NFS server.

(cherry picked from commit 4281bfec36285e2212f41568459c077bf4dbd91c)

3 years agobhyve: Set SO_REUSEADDR on the gdb stub socket
Mark Johnston [Mon, 3 May 2021 16:42:54 +0000 (12:42 -0400)]
bhyve: Set SO_REUSEADDR on the gdb stub socket

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30037

(cherry picked from commit 02e7a6514e63ceca680fade40797280aef1bf55f)

3 years agoAdd Apollo Lake SIO/LPSS UARTs PCI IDs
Jose Luis Duran [Sun, 2 May 2021 21:20:25 +0000 (21:20 +0000)]
Add Apollo Lake SIO/LPSS UARTs PCI IDs

PR: 255556

(cherry picked from commit 8f1562430fbb83f6cedff6450e1aa1b593e3d7e7)

3 years agouart_bus_pci.c: Style
Jose Luis Duran [Sun, 2 May 2021 21:20:25 +0000 (21:20 +0000)]
uart_bus_pci.c: Style

PR: 255556

(cherry picked from commit 5b8b6b26e40a81320f02a46df98b96bd8e93295a)

3 years agoifconfig: Minor documentation fix
Jose Luis Duran [Thu, 29 Apr 2021 11:03:48 +0000 (11:03 +0000)]
ifconfig: Minor documentation fix

PR: 255557

(cherry picked from commit 0ea8a7f36db31bfc550bbe5e39703fdedd12fa8c)

3 years agonetgraph/ng_source: Switch queuing framework
Lutz Donnerhacke [Fri, 29 Jan 2021 11:03:17 +0000 (12:03 +0100)]
netgraph/ng_source: Switch queuing framework

Change the queuing framework from ifq to mbufq.

Reported by: glebius
Reviewed by: glebius, kp
Differential Revision: https://reviews.freebsd.org/D28407

(cherry picked from commit ebc61c86b5567f2e5a3c5f452e86879b558b376b)

3 years agonetgraph/ng_source: If queue is full, don't enqueue
Lutz Donnerhacke [Sat, 23 Jan 2021 17:54:47 +0000 (18:54 +0100)]
netgraph/ng_source: If queue is full, don't enqueue

Submitted by: nc
Reviewed by: donner, kp
Differential Revision: https://reviews.freebsd.org/D23477

(cherry picked from commit d7dd28bb09fa51b9958a5dc288d2aeef56a67491)

3 years agonetgraph/ng_base: Allow larger BINARY2ASCII conversions
Lutz Donnerhacke [Sun, 7 Feb 2021 21:07:34 +0000 (22:07 +0100)]
netgraph/ng_base: Allow larger BINARY2ASCII conversions

Allocate the necessary memory for the conversion dynamically starting
with a value which is sufficient for almost all normal cases.

PR: 187835
Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D23840

(cherry picked from commit 45d75e3ac3fb5bf8230ca28dc09b48c6e5ed7a4f)

3 years agosbin/ipfw: Fix null pointer deference when printing counters
Lutz Donnerhacke [Sun, 9 May 2021 12:48:47 +0000 (14:48 +0200)]
sbin/ipfw: Fix null pointer deference when printing counters

ipfw -[tT] prints statistics of the last access. If the rule was never
used, the counter might be not exist.  This happens unconditionally on
inserting a new rule.  Avoid printing statistics in this case.

PR: 255491
Reported by: Haisheng Zhouz
Reviewed by: ae
Differential Revision: https://reviews.freebsd.org/D30046

(cherry picked from commit bf7cc0f9cb6603a6bdd6131c8d1939724ce6e62d)

3 years agonfscl: fix delegation recall when the file is not open
Rick Macklem [Sun, 25 Apr 2021 19:52:48 +0000 (12:52 -0700)]
nfscl: fix delegation recall when the file is not open

Without this patch, if a NFSv4 server recalled a
delegation when the file is not open, the renew
thread would block in the NFS VOP_INACTIVE()
trying to acquire the client state lock that it
already holds.

This patch fixes the problem by delaying the
vrele() call until after the client state
lock is released.

This bug has been in the NFSv4 client for
a long time, but since it only affects
delegation when recalled due to another
client opening the file, it got missed
during previous testing.

Until you have this patch in your client,
you should avoid the use of delegations.

(cherry picked from commit 02695ea8909d818ceaa726f90f889889dfd39fac)

3 years agoless: upgrade to v581.2.
Xin LI [Mon, 19 Apr 2021 02:46:19 +0000 (19:46 -0700)]
less: upgrade to v581.2.

(cherry picked from commit 50d31dbc6e2bc3aa6007edb8cdecbcb84e85d6c0)

less: upgrade to v581.

(cherry picked from commit 2235c7feac959bcc9ddfd6a2bc6be32102b1f84c)

3 years agorelease.7: update for current context
Ed Maste [Tue, 1 Sep 2020 15:30:40 +0000 (15:30 +0000)]
release.7: update for current context

It's no longer unusual to be able to build a release with a single
command, so drop "actually" that hints at a surprise.  Also just use
"network install directory" instead of referencing FTP; it's more
likely to be HTTP now.

Reviewed by: gjb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D26260

(cherry picked from commit 55c9a224e2a9c01d461003837ff6563803b63210)

3 years agopf tests: Test scrub fragment reassemble on interfaces with different MTU
Kristof Provost [Tue, 27 Apr 2021 16:46:03 +0000 (18:46 +0200)]
pf tests: Test scrub fragment reassemble on interfaces with different MTU

There's a problem with pf's reassembly code where it produces incorrect
checksums when reassembling across interfaces with different MTUs.
Test this.

PR: 255432
Reviewed by: donner
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D30013

(cherry picked from commit 388c0cde10293d9a3434e99146bf391aec6878a3)

3 years agopf: Fix IP checksum on reassembly
Kristof Provost [Wed, 28 Apr 2021 10:56:06 +0000 (12:56 +0200)]
pf: Fix IP checksum on reassembly

If we reassemble a packet we modify the IP header (to set the length and
remove the fragment offset information), but we failed to update the
checksum. On certain setups (mostly where we did not re-fragment again
afterwards) this could lead to us sending out packets with incorrect
checksums.

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

(cherry picked from commit 055c55abefbe19fe46a56894595af9c9dad7678c)

3 years agopf: PFRULE_REFS should not be user-visible
Kristof Provost [Thu, 15 Apr 2021 11:38:56 +0000 (13:38 +0200)]
pf: PFRULE_REFS should not be user-visible

Split the PFRULE_REFS flag from the rule_flag field. PFRULE_REFS is a
kernel-internal flag and should not be exposed to or read from
userspace.

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

(cherry picked from commit 4f1f67e88853ac9e3c2d8897cf6dab6cfda8d16e)

3 years agolibpfct: Fix PIC flag
Kristof Provost [Fri, 16 Apr 2021 19:00:51 +0000 (21:00 +0200)]
libpfct: Fix PIC flag

Use ${PICFLAG} rather than hard-adding -fPIC, which removes the
requirement for libnv to be built PIC.

MFC after:      4 weeks
Sponsored by:   Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 8403170b3d39326f836bc999534fe8c4d41cda11)

3 years agopf tests: Test clearing rules counters
Kristof Provost [Mon, 12 Apr 2021 15:29:19 +0000 (17:29 +0200)]
pf tests: Test clearing rules counters

This was briefly broken, so ensure that we can read and clear rules
counters.

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

(cherry picked from commit 112f007e12818ba3d54869b331139090e69dbc74)

3 years agopfctl: Fix clearing rules counters
Kristof Provost [Mon, 12 Apr 2021 15:23:33 +0000 (17:23 +0200)]
pfctl: Fix clearing rules counters

After the migration to libpfctl for rule retrieval we accidentally lost
support for clearing the rules counters.

Introduce a get_clear variant of pfctl_get_rule() which allows rules
counters to be cleared.

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

(cherry picked from commit 4eabfe468b6e80a0823523d83dc908c27ec823c7)

3 years agopfctl, libpfctl: introduce pfctl_pool
Kurosawa Takahiro [Mon, 12 Apr 2021 14:03:40 +0000 (16:03 +0200)]
pfctl, libpfctl: introduce pfctl_pool

Introduce pfctl_pool to be able to extend the pool part of the pf rule
without breaking the ABI.

Reviewed by: kp
MFC after: 4 weeks
Differential Revision: https://reviews.freebsd.org/D29721

(cherry picked from commit 600bd6ce0639c84b763516477250df5964e8edf6)

3 years agopf: Ensure that we don't use kif passed to pfi_kkif_attach()
Kristof Provost [Mon, 12 Apr 2021 09:45:48 +0000 (11:45 +0200)]
pf: Ensure that we don't use kif passed to pfi_kkif_attach()

Once a kif is passed to pfi_kkif_attach() we must ensure we never re-use
it for anything else.
Set the kif to NULL afterwards to guarantee this.

Reported-by: syzbot+be5d4f4a7a4c295e659a@syzkaller.appspotmail.com
MFC after: 4 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 5e98cae661f3a7e85df7f277660765b823454073)

3 years agolibnv: Use PICFLAG rather than -fPIC
Kristof Provost [Sat, 10 Apr 2021 09:23:57 +0000 (11:23 +0200)]
libnv: Use PICFLAG rather than -fPIC

Suggested by: andrew
MFC after: 4 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 15ca66220874c177602c13a114b2f3d17773b788)

3 years agolibpfctl: Fix u_* counters
Kristof Provost [Thu, 8 Apr 2021 08:36:18 +0000 (10:36 +0200)]
libpfctl: Fix u_* counters

struct pf_rule had a few counter_u64_t counters. Those couldn't be
usefully comminicated with userspace, so the fields were doubled up in
uint64_t u_* versions.

Now that we use struct pfctl_rule (i.e. a fully userspace version) we
can safely change the structure and remove this wart.

Reviewed by: glebius
MFC after: 4 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D29645

(cherry picked from commit ab5707a5cf86ed66dbd11e03ad9676766da9a47b)

3 years agolibpfctl: Switch to pfctl_rule
Kristof Provost [Thu, 8 Apr 2021 08:31:46 +0000 (10:31 +0200)]
libpfctl: Switch to pfctl_rule

Stop using the kernel's struct pf_rule, switch to libpfctl's pfctl_rule.
Now that we use nvlists to communicate with the kernel these structures
can be fully decoupled.

Reviewed by: glebius
MFC after: 4 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D29644

(cherry picked from commit e9eb09414a8de8f3329f51b48c90a5e5ac8f09cf)

3 years agopf: Move prototypes for userspace functions to userspace header
Kristof Provost [Wed, 7 Apr 2021 17:49:51 +0000 (19:49 +0200)]
pf: Move prototypes for userspace functions to userspace header

These functions no longer exist in the kernel, so there's no reason to
keep the prototypes in a kernel header. Move them to pfctl where they're
actually implemented.

Reviewed by: glebius
MFC after: 4 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D29643

(cherry picked from commit a9b338b260be39cc74dddb599d6c95b8794ca98b)

3 years agobsnmp: Use libpfctl
Kristof Provost [Mon, 29 Mar 2021 15:43:25 +0000 (17:43 +0200)]
bsnmp: Use libpfctl

Reviewed by: glebius
MFC after: 4 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D29642

(cherry picked from commit 956e7d232549ce4b17f5b1a079e5b51229479dda)

3 years ago(t)ftp-proxy: use libpfctl
Kristof Provost [Mon, 29 Mar 2021 12:03:39 +0000 (14:03 +0200)]
(t)ftp-proxy: use libpfctl

Reviewed by: glebius
MFC after: 4 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D29641

(cherry picked from commit 95be9288f01f30a50440ea56d11468a2c6e18fed)

3 years agopfctl: Move ioctl abstraction functions into libpfctl
Kristof Provost [Fri, 26 Mar 2021 10:38:58 +0000 (11:38 +0100)]
pfctl: Move ioctl abstraction functions into libpfctl

Introduce a library to wrap the pf ioctl interface.

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

(cherry picked from commit 0d71f9f36e6c1849fdaf6c1edc1178be07357034)

3 years agolibnv: Build PIC
Kristof Provost [Fri, 2 Apr 2021 15:06:02 +0000 (17:06 +0200)]
libnv: Build PIC

Build libnv as position independent code so we can use it from shared
libraries.

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

(cherry picked from commit 0dd13c77432ade1ae94c9661cbad5537e3e6ab1d)

3 years agopfctl: Use the new DIOCGETRULENV ioctl
Kristof Provost [Fri, 26 Mar 2021 10:22:15 +0000 (11:22 +0100)]
pfctl: Use the new DIOCGETRULENV ioctl

Create wrapper functions to handle the parsing of the nvlist and move
that code into pfctl_ioctl.c.
At some point this should be moved into a libpfctl.

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

(cherry picked from commit 0d6c8174ef2f3d8d6fb02ec97753a0937796a5c6)

3 years agopf: Implement nvlist variant of DIOCGETRULE
Kristof Provost [Thu, 25 Mar 2021 09:39:14 +0000 (10:39 +0100)]
pf: Implement nvlist variant of DIOCGETRULE

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

(cherry picked from commit d710367d1159423ed4da6628b7ab042d3e44f900)

3 years agopfctl: Move to DIOCADDRULENV
Kristof Provost [Fri, 12 Mar 2021 17:03:14 +0000 (18:03 +0100)]
pfctl: Move to DIOCADDRULENV

Start using the new nvlist based ioctl to add rules.

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

(cherry picked from commit 5c11c5a3655842a176124ef2334fcdf830422c8a)

3 years agopf: Introduce nvlist variant of DIOCADDRULE
Kristof Provost [Thu, 11 Mar 2021 15:21:23 +0000 (16:21 +0100)]
pf: Introduce nvlist variant of DIOCADDRULE

This will make future extensions of the API much easier.
The intent is to remove support for DIOCADDRULE in FreeBSD 14.

Reviewed by: markj (previous version), glebius (previous version)
MFC after: 4 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D29557

(cherry picked from commit 5c62eded5a11ebdb1d57134d923596e2b04e9466)

3 years agopf: Remove unused variable rt_listid from struct pf_krule
Kristof Provost [Thu, 8 Apr 2021 09:08:33 +0000 (11:08 +0200)]
pf: Remove unused variable rt_listid from struct pf_krule

Reviewed by: donner
MFC after: 4 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D29639

(cherry picked from commit 4967f672ef3095300fe74a9d1ae873d0897cc0a5)

3 years agoioccom: define ioctl cmd value that can never be valid
Konstantin Belousov [Thu, 22 Apr 2021 19:40:08 +0000 (22:40 +0300)]
ioccom: define ioctl cmd value that can never be valid

(cherry picked from commit 619fe095861274576a2cb45628076968051b1585)

3 years agoarp(8): fixing the deletion failure of IEEE1394 associated addresses
Tai-hwa Liang [Mon, 12 Apr 2021 06:27:03 +0000 (06:27 +0000)]
arp(8): fixing the deletion failure of IEEE1394 associated addresses

Without this, 'arp -d ${IEEE1394_ADDRESS}' gives the following error:

arp: delete: cannot locate 10.0.0.71

Reviewed by: glebius
MFC after: 2 weeks

(cherry picked from commit a0d6d0d0b9aba6d4c025b2f2807e7c4b4c4b2415)

3 years agoif_firewire: fixing panic upon packet reception for VNET build
Tai-hwa Liang [Sat, 10 Apr 2021 15:32:27 +0000 (15:32 +0000)]
if_firewire: fixing panic upon packet reception for VNET build

netisr_dispatch_src() needs a valid VNET pointer or firewire_input() will panic
when receiving a packet.

Reviewed by: glebius
MFC after: 2 weeks

(cherry picked from commit d9b61e7153c64b141436b4d9619b166c6d35a0a6)

3 years agopipe: Avoid calling selrecord() on a closing pipe
Mark Johnston [Wed, 28 Apr 2021 14:42:59 +0000 (10:42 -0400)]
pipe: Avoid calling selrecord() on a closing pipe

pipe_poll() may add the calling thread to the selinfo lists of both ends
of a pipe.  It is ok to do this for the local end, since we know we hold
a reference on the file and so the local end is not closed.  It is not
ok to do this for the remote end, which may already be closed and have
called seldrain().  In this scenario, when the polling thread wakes up,
it may end up referencing a freed selinfo.

Guard the selrecord() call appropriately.

Reviewed by: kib
Reported by: syzkaller+KASAN
Differential Revision: https://reviews.freebsd.org/D30016

(cherry picked from commit d1e9441583fd85c7de5f48197d80c287f1a9494b)

3 years agoFix build post a0409676120c1e558d0ade943019934e0f15118d.
Cy Schubert [Mon, 22 Mar 2021 15:42:18 +0000 (08:42 -0700)]
Fix build post a0409676120c1e558d0ade943019934e0f15118d.

(cherry picked from commit 048488c0c4e47aa2aac9709b18d7da14b06f78cd)

3 years agopkg(7): replace usage of sbuf(9) with open_memstream(3)
Baptiste Daroussin [Tue, 27 Apr 2021 02:38:55 +0000 (04:38 +0200)]
pkg(7): replace usage of sbuf(9) with open_memstream(3)

open_memstream(3) is a standard way to obtain the same feature we do get
by using sbuf(9) (aka dynamic size buffer), switching to using it makes
pkg(7) more portable, and reduces its number of dependencies.

Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D30005

(cherry picked from commit cc9a8a116d19daf224222506441e91a3d329160e)

3 years agopkg(7): indentation fixes
Baptiste Daroussin [Tue, 27 Apr 2021 02:07:05 +0000 (04:07 +0200)]
pkg(7): indentation fixes

Non functional changes

(cherry picked from commit f648d757b76d70d58bbda7c3ed3ff79261d24d0f)

3 years agopkg(7): when bootstrapping first search for pkg.pkg file then pkg.
Baptiste Daroussin [Fri, 12 Mar 2021 17:36:30 +0000 (18:36 +0100)]
pkg(7): when bootstrapping first search for pkg.pkg file then pkg.

The package extension is going to be changed to .pkg to be among other
things resilient to the change of compression format used and reduce
the impact of all third party tool of that change.

Ensure the bootstrap knows about it

Reviewed by: manu
Differential revision: https://reviews.freebsd.org/D29232

(cherry picked from commit a2aac2f5e5642740507a3cadb98046f3dd434ce4)
(cherry picked from commit c244b1d8a38731041d0f3ff4191192a85dd8608b)

3 years agopkg(7): add an -r reponame option for bootstrap and add
Kyle Evans [Fri, 12 Feb 2021 00:58:26 +0000 (18:58 -0600)]
pkg(7): add an -r reponame option for bootstrap and add

This is limited to bootstrap/add because some real pkg(8) commands
have -r flags with an incompatible meaning/usage, e.g., pkg-audit.
pkg(7) will still commence the search as it has, but it will ignore any
repo objects without the given name so that overrides and whatnot still
work as expected.

The use of it for add is noted in the manpage; notably, that the
signature config for that repository will be used over global config if
it's specified. i.e., pkg(7) should assume that the given pkg did come
from that repository and treat it appropriately.

Reviewed by: bapt, manu
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D28524

3 years agousr.sbin/pkg: Don't re-define roundup2
Alex Richardson [Thu, 28 Jan 2021 17:25:50 +0000 (17:25 +0000)]
usr.sbin/pkg: Don't re-define roundup2

The file already includes sys/param.h and should use that definition.
I found this while testing D28332.

Reviewed By: bapt
Differential Revision: https://reviews.freebsd.org/D28331

3 years agopkg(7): rework the arguments handling
Baptiste Daroussin [Wed, 6 Jan 2021 10:35:22 +0000 (11:35 +0100)]
pkg(7): rework the arguments handling

Rework the arguments handling around using getopt_long:
* add long option support
* add -4 and -6 support to enforce ipv4 or ipv6

While here fix a regression which occured between FreeBSD 12.1 and
FreeBSD 12.2 where pkg bootstrap -y stopped working

PR: 252270
Submitted by: evilham <contact@evilham.com>
Differential Revision: https://reviews.freebsd.org/D27860

(cherry picked from commit ae994fdc5bd2ccc0ac0b8745fd1f1be67ad6e071)

3 years agoUse asprintf instead of sbuf
Baptiste Daroussin [Mon, 19 Oct 2020 07:26:42 +0000 (07:26 +0000)]
Use asprintf instead of sbuf

3 years agofix up docs, if signature checking is enabled, the file MUST exist...
John-Mark Gurney [Fri, 6 Nov 2020 22:11:05 +0000 (22:11 +0000)]
fix up docs, if signature checking is enabled, the file MUST exist...

(cherry picked from commit e771d590741ea39be83558bda72854c65e1084ae)

3 years agopw(8): use open_memstream(3) instead of sbuf(9)
Baptiste Daroussin [Tue, 27 Apr 2021 03:05:13 +0000 (05:05 +0200)]
pw(8): use open_memstream(3) instead of sbuf(9)

open_memstream(3) is a standard function that brings here the same
functionnality what we were doing with sbuf(9).

(cherry picked from commit 0cd4b781a6fa1ed4ca04a7b642f41652e25bbc9b)

3 years agolibedit: vendor import libedit 2021-03-28
Baptiste Daroussin [Mon, 22 Mar 2021 14:34:14 +0000 (15:34 +0100)]
libedit: vendor import libedit 2021-03-28

(cherry picked from commit f9a159da2a292968cd5c37b56a6c43b6af8c5eed)
(cherry picked from commit 19318a62d7f8cfe2f0f5c24178fa33e8844ae5d1)

3 years agolibucl: vendor import snapshort 20210314
Baptiste Daroussin [Mon, 22 Mar 2021 14:13:02 +0000 (15:13 +0100)]
libucl: vendor import snapshort 20210314

(cherry picked from commit a0409676120c1e558d0ade943019934e0f15118d)

3 years agoMake pkg(7) use environment variables specified in pkg.conf
Moritz Schmitt [Tue, 27 Apr 2021 01:59:12 +0000 (03:59 +0200)]
Make pkg(7) use environment variables specified in pkg.conf

Modify /usr/sbin/pkg to use environment variables specified in pkg.conf.
This allows control over underlying libraries like fetch(3), which can
be configured by setting HTTP_PROXY.

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

(cherry picked from commit e869d3c60147bbb226b5ad97d2ef73391aeebafa)

3 years agosh: improve emacs mode
Baptiste Daroussin [Tue, 30 Mar 2021 09:37:29 +0000 (11:37 +0200)]
sh: improve emacs mode

In emacs mode, force ^R to backware search the history
This behaviour is the default in emacs mode for most of the other shells

Note: Note that this can still be overridden via $EDITRC, ~/.editrc or a
bind command after set -o emacs.

Approved by: jilles
Reviewed by: jilles, arichardson, pstef
Differential Revision: https://reviews.freebsd.org/D29494

(cherry picked from commit 660045fb5360d328da199ae78c89d5cc15b6d1ca)

3 years agoarcmsr(4): Fix SCSI command timeout on ARC-1886.
Xin LI [Wed, 21 Apr 2021 08:03:54 +0000 (01:03 -0700)]
arcmsr(4): Fix SCSI command timeout on ARC-1886.

Many thanks to Areca for continuing to support FreeBSD.

Submitted by: 黃清隆 <ching2048 areca com tw>

(cherry picked from commit 438b5532070f7c52e88f514380ee8662de1f600b)

3 years agoSet PCIe device's Max_Payload_Size to match PCIe root's.
Alexander Motin [Mon, 5 Apr 2021 14:34:40 +0000 (10:34 -0400)]
Set PCIe device's Max_Payload_Size to match PCIe root's.

Usually on boot the MPS is already configured by BIOS.  But we've
found that on hot-plug it is not true at least for our Supermicro
X11 boards.  As result, mismatch between root's configuration of
256 bytes and device's default of 128 bytes cause problems for some
devices, while others seem to work fine.

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

(cherry picked from commit 5a898b2b78ce04d608bbaaa0813424b11f921ae7)

3 years agopf tests: Test using '<ifgroup>:network' in tables
Kristof Provost [Sun, 25 Apr 2021 10:18:48 +0000 (12:18 +0200)]
pf tests: Test using '<ifgroup>:network' in tables

MFC after: 1 week

(cherry picked from commit daa5350d0e0c5fbe42c5a057dd37b9d22df91bb7)

3 years agopfctl: Revert "pfctl: Another set skip <group> fix"
Kristof Provost [Mon, 26 Apr 2021 08:07:07 +0000 (10:07 +0200)]
pfctl: Revert "pfctl: Another set skip <group> fix"

This reverts commit 0c156a3c32cd0d9168570da5686ddc96abcbbc5a.
This fix broke using '<ifgroup>:network' in tables.

MFC after: 1 week

(cherry picked from commit d5b08e13dd6beb3436e181ff1f3e034cc8186584)

3 years agonfscommon: fix function name in comment
Rick Macklem [Tue, 20 Apr 2021 03:09:46 +0000 (20:09 -0700)]
nfscommon: fix function name in comment

(cherry picked from commit 78ffcb86d98fc9c27ac7a723c65621667036c42d)

3 years agonfsd: fix stripe size reply for the File Layout pNFS server
Rick Macklem [Tue, 20 Apr 2021 00:51:07 +0000 (17:51 -0700)]
nfsd: fix stripe size reply for the File Layout pNFS server

At a recent testing event I found out that I had misinterpreted
RFC5661 where it describes the stripe size in the File Layout's
nfl_util field. This patch fixes the pNFS File Layout server
so that it returns the correct value to the NFSv4.1/4.2 pNFS
enabled client.

This affects almost no one, since pNFS server configurations
are rare and the extant pNFS aware NFS clients seemed to
function correctly despite the erroneous stripe size.
It *might* be needed for correct behaviour if a recent
Linux client mounts a FreeBSD pNFS server configuration
that is using File Layout (non-mirrored configuration).

(cherry picked from commit 5a89498d19863d0c4cb074f9b93862a70040bf1b)

3 years agogpioc_detach: fix freeing of wrong pointers
Andriy Gapon [Tue, 23 Mar 2021 10:45:18 +0000 (12:45 +0200)]
gpioc_detach: fix freeing of wrong pointers

MFC after: 1 week

(cherry picked from commit 3c6b59567f61277ed487320aa9ad130c6894ad7a)

3 years agoimgact_elf: Ensure that the return value in parse_notes is initialized
Mark Johnston [Mon, 26 Apr 2021 18:53:16 +0000 (14:53 -0400)]
imgact_elf: Ensure that the return value in parse_notes is initialized

parse_notes relies on the caller-supplied callback to initialize "res".
Two callbacks are used in practice, brandnote_cb and note_fctl_cb, and
the latter fails to initialize res.  Fix it.

In the worst case, the bug would cause the inner loop of check_note to
examine more program headers than necessary, and the note header usually
comes last anyway.

Reviewed by: kib
Reported by: KMSAN
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29986

(cherry picked from commit 409ab7e109c692014e3484a74af248dd7a4746e8)

3 years agoe1000: Fix register name in reg_dump sysctl
Kevin Bowling [Mon, 26 Apr 2021 16:30:54 +0000 (09:30 -0700)]
e1000: Fix register name in reg_dump sysctl

The correct name of this register is CTRL_EXT.

Approved by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D29967

(cherry picked from commit ba7b31b3e967a57c0269330d4e5aacf541d1b479)

3 years agoe1000: Add support for [Tiger, Alder, Meteor] Lake
Kevin Bowling [Mon, 19 Apr 2021 02:11:27 +0000 (19:11 -0700)]
e1000: Add support for [Tiger, Alder, Meteor] Lake

Add support for current and future client platform PCI IDs. These are
all I219 variants and have no known driver changes versus previous
generation client platform I219 variants.

Reviewed by: markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D29801

(cherry picked from commit 59690eab572dde1176886bff7ed0c506df974e5e)

3 years agoconnectat(2): clarify that the s argument is socket
Konstantin Belousov [Wed, 28 Apr 2021 15:47:31 +0000 (18:47 +0300)]
connectat(2): clarify that the s argument is socket

(cherry picked from commit 07f229d20c0cd6285c5ddf1df45eb69bbea4445b)

3 years agoFix mismerge in 00f85e3f264d665b30f0ce2a.
Konstantin Belousov [Sat, 1 May 2021 13:42:27 +0000 (16:42 +0300)]
Fix mismerge in 00f85e3f264d665b30f0ce2a.

nfslock is still needed on stable/12.
This is the direct commit to the stable/12 branch.

Noted by: rmacklem
Sponsored by: The FreeBSD Foundation

3 years agonfs client: depend on xdr
Konstantin Belousov [Tue, 13 Apr 2021 11:47:20 +0000 (14:47 +0300)]
nfs client: depend on xdr

(cherry picked from commit 8cca7b7f28feaf0c5e2dfedb985ae334a4013ef6)

3 years agoStyle.
Konstantin Belousov [Thu, 18 Mar 2021 10:40:20 +0000 (12:40 +0200)]
Style.

(cherry picked from commit 42be0a7b10b14113ba9c4e4a738e8f20e235b736)

3 years agovn_open_vnode(): handle error when fp == NULL
Konstantin Belousov [Mon, 19 Apr 2021 10:25:30 +0000 (13:25 +0300)]
vn_open_vnode(): handle error when fp == NULL

PR: 255119

(cherry picked from commit 54f98c4dbf9b1203a4e3e1b13fd0738441226991)

3 years agoAT_RESOLVE_BENEATH is bsd-specific
Konstantin Belousov [Thu, 11 Mar 2021 15:07:02 +0000 (17:07 +0200)]
AT_RESOLVE_BENEATH is bsd-specific

(cherry picked from commit d51b4b0aac43d9d25f7eb3f17b2d3034a5c851d8)

3 years agob_vflags update requries bufobj lock
Konstantin Belousov [Tue, 13 Apr 2021 10:22:56 +0000 (13:22 +0300)]
b_vflags update requries bufobj lock

(cherry picked from commit e3d675958539eee899d42438f5b46a26f3c64902)

3 years agopseudofs: limit writes to 1M
Konstantin Belousov [Tue, 13 Apr 2021 19:48:44 +0000 (22:48 +0300)]
pseudofs: limit writes to 1M

(cherry picked from commit 5edf7227ec339f651c7328e63df323f6ef10345f)