Commit Graph

142479 Commits

Author SHA1 Message Date
Dmitry Chagin
bb46e9b510 linux(4): Prevent an attempt to copy an uninitialized source address.
PR:			259380
MFC after:		3 days
2022-04-11 23:29:45 +03:00
Mike Karels
6ca0ca7b4c IPv4 multicast: fix LOR in shutdown path
X_ip_mrouter_done() was calling the interface ioctl routines via
if_allmulti() while holding a write lock.  However, some interface
ioctl routines, including em/iflib and tap, use sxlocks, which are
not permitted while holding a non-sleepable lock, and this elicits
a warning from WITNESS.  Fix the locking issue by recording the
affected interface pointers in a malloc'ed array, and call
if_allmulti() on each after dropping the rwlock.

Reviewed by:	bz
Differential Revision: https://reviews.freebsd.org/D34845
2022-04-11 14:51:16 -05:00
Fernando Apesteguía
0f2041a5b0 [linprocfs] add sys/kernel/random/boot_id
This file holds a UUID that is invariant for every boot. In our case, it is
invariant per mount.

PR:	262369
Reported by:	sodynet1@gmail.com
Approved by:	dchagin@
Differential Revision:	https://reviews.freebsd.org/D34860
2022-04-11 18:23:28 +02:00
Kristof Provost
4496aecb56 pf: drain Ethernet rules cleanup before starting a new transaction
Inactive Ethernet rules get cleaned by a net_epoch callback. This
callback may still be pending when we try to start a new (pf rules)
transaction, causing it to fail.
This is especially likely to occur in scripted scenarios, such as the
regression tests.

Drain the epoch callbacks before starting a new transaction, ensuring
we've had the opportunity to clean up the inactive rules.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D34846
2022-04-11 15:47:57 +02:00
Tong Zhang
57f7a82fbb if_axgbe: properly release resource in error case
PR:		262899
Reviewed by:	markj
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D34628
2022-04-11 09:52:32 -04:00
Andrey V. Elsukov
7d98cc096b Fix ipfw fwd that doesn't work in some cases
For IPv4 use dst pointer as destination address in fib4_lookup().
It keeps destination address from IPv4 header and can be changed
when PACKET_TAG_IPFORWARD tag was set by packet filter.

For IPv6 override destination address with address from dst_sa.sin6_addr,
that was set from PACKET_TAG_IPFORWARD tag.

Reviewed by:	eugen
MFC after:	1 week
PR:		256828, 261697, 255705
Differential Revision: https://reviews.freebsd.org/D34732
2022-04-11 14:16:43 +03:00
Andrey V. Elsukov
4763c0aa68 ipfw: fix matching and setting DSCP value for IPv6
Matching for DSCP codes has used incorrect bits. Use IPV6_DSCP()
macro for matching opcodes to fix this. Also this leads to always
use value from a mbuf instead of cached value.

Previously different opcodes have used both cached in f_id value
and stored in the mbuf, and it did not always work after setdscp
action, since cached value was not updated.

Update IPv6 flowid value cached in the f_id.flow_id6 when we do
modification of DSCP value in O_SETDSCP opcode, it may be used by
external modules.

Also added logging support for O_SETDSCP opcode.

Reviewed by:	kp
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D34807
2022-04-11 13:13:49 +03:00
Enji Cooper
567378cc07 Fix OID format for vm.swap_reserved and vm.swap_total
The correct OID format for CTLTYPE_U64 is `QU` (`uquad_t`), not `A`
(text expressed via `char *`).

This issue was noticed while doing an sysctl tree walk using a
sysctl(9) consumer that relies on the OID format to intuit what the
type should be for a given sysctl.

MFC after:	1 month
Sponsored by:	DellEMC Isilon
Differential Revision: https://reviews.freebsd.org/D34877
2022-04-10 18:17:09 -07:00
Robert Wing
d4e8207317 vmm_instruction_emul.c: fix bhyve build
The __diagused macro was used to cure a "set but not used" warning. This
broke the build for bhyve since __diagused is only defined in the
kernel. Define __diagused when not building the kernel.

Fixes:          5241577a22 ("vmm: fix set but not used warning")
Reported by:    Jenkins
2022-04-10 13:37:24 -08:00
Rick Macklem
5580e5bd71 nfscl: Clean up the code by removing unused arguments
The "void *stuff" (also called fstuff and dstuff) argument
was used by the Mac OSX port.  For FreeBSD, this argument
is always NULL, so remove it to clean up the code.

This commit gets rid of "stuff" for nfscl_request().
Future commits will do the same for other functions.
2022-04-10 14:05:44 -07:00
Robert Wing
5a17f489d5 vmm: fix set but not used warning 2022-04-10 10:30:19 -08:00
Robert Wing
5241577a22 vmm: fix set but not used warning 2022-04-10 10:30:16 -08:00
Robert Wing
3587bfa797 vmm: fix set but not used warning 2022-04-10 10:30:14 -08:00
Robert Wing
5c272efaba vmm: fix set but not used warnings 2022-04-10 10:30:11 -08:00
Robert Wing
f877977a03 vmm: fix set but not used warnings 2022-04-10 10:30:08 -08:00
Robert Wing
893a3dd697 vmm: fix set but not used warning 2022-04-10 10:30:05 -08:00
Andrew Turner
f3ef799f56 Only return a mapped address from efi_phys_to_kva
On some hardware the EFI system table is not in memory mapped in the
DMAP section. Rather than panic the kernel check if it is mapped and
return a failure if not from efi_phys_to_kva.

Reported by:	kevans
Differential Revision: https://reviews.freebsd.org/D34858
2022-04-10 09:41:54 +01:00
Andrew Turner
57e47ae514 Include the EFI Runtime Code in the DMAP
Some UEFI implementations place the system table in a runtime code
memory region. Include it in the DMAP so we can read it later.

Reviewed by:	kevans
Differential Revision: https://reviews.freebsd.org/D34861
2022-04-10 09:41:54 +01:00
Rick Macklem
38c3cf6aed nfscl: Clean up the code by removing unused arguments
The "void *stuff" (also called fstuff and dstuff) argument
was used by the Mac OSX port.  For FreeBSD, this argument
is always NULL, so remove it to clean up the code.

This commit gets rid of "stuff" for nfscl_postop_attr().
Future commits will do the same for other functions.
2022-04-09 18:53:25 -07:00
Rick Macklem
c45d934f6b nfscl: Ansify a function header 2022-04-09 15:14:05 -07:00
Konstantin Belousov
eca39864f7 Add sysctl KERN_LOCKF
reporting the shapshot of the active advisory locks.

A new VFS ops method vfs_report_lockf if provided in the mount point
op table.  If it is NULL, as it is currently for all existing
filesystems, vfs_report_lockf() function is used, which gathers
information from the standard implementation inside kern/kern_lockf.c.

Filesystems implementing its own locking (NFSv4 as example) can provide
a custom implementation.

Reviewed by:	markj, rmacklem
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34756
2022-04-10 00:43:53 +03:00
Konstantin Belousov
6ead1379fd sys/user.h: Add kinfo_lockf structure to report advisory locks
Reviewed by:	markj, rmacklem
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34756
2022-04-10 00:43:53 +03:00
Konstantin Belousov
147e4fe3f1 kern_lockf.c: remove no longer neeeded UFS headers
Reviewed by:	markj, rmacklem
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34756
2022-04-10 00:43:53 +03:00
Konstantin Belousov
59e85819be lockf: remove lf_inode from struct lockf_entry
The UFS-specific struct inode cannot be used in generic advisory lock
code.  It was probably used as a shortcut for the debugging, as the
remnants of the code around it indicates.

Use somewhat more verbose and less concentrated, but universal,
VOP_PRINT(), where needed.

Reviewed by:	markj, rmacklem
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34756
2022-04-10 00:43:53 +03:00
Konstantin Belousov
5c075d6404 ufs/acl.h: forward-declare struct inode
Right now it is incidentally declared in sys/lockf.h, which will be
corrected shortly.

Reviewed by:	markj, rmacklem
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34756
2022-04-10 00:43:53 +03:00
Konstantin Belousov
8cc19b1e47 Style.
Reviewed by:	markj, rmacklem
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34756
2022-04-10 00:43:53 +03:00
Gordon Bergling
ecbdfbfd18 netgraph(3): Remove a double word in a source code comment
- s/it it/it/

MFC after:	3 days
2022-04-09 14:41:40 +02:00
Gordon Bergling
d048e8c619 ofed: Fix a typo in a source code comment
- s/it it/it to/

MFC after:	3 days
2022-04-09 14:39:36 +02:00
Gordon Bergling
75e1650d7f bhnd(4): Remove a double word in a source code comment
- s/an an/an/

MFC after:	3 days
2022-04-09 14:31:19 +02:00
Gordon Bergling
9a22f7fb9d i386: Remove a double word in a source code comment
- s/an an/an/

MFC after:	3 days
2022-04-09 14:30:34 +02:00
Gordon Bergling
ffedb32dd3 pax(1): Remove a few double words in source code comments
- s/an an/an/

MFC after:	3 days
2022-04-09 14:27:39 +02:00
Gordon Bergling
a9f09d75dd netpfil: Remove a double word in a source code comment
- s/a a/a/

MFC after:	3 days
2022-04-09 14:20:09 +02:00
Gordon Bergling
f171938cd6 jail: Remove a double word in a source code comment
- s/a a/a/

MFC after:	3 days
2022-04-09 14:19:17 +02:00
Gordon Bergling
a37c6fcc46 mpt(4): Fix a typo in a source code comment
- s/proccessor/processor/

MFC after:	3 days
2022-04-09 14:10:05 +02:00
Gordon Bergling
2dd0c2bc7f tcp_bbr(4): Fix a typo in a source code comment
- s/possiblity/possibility/

MFC after:	3 days
2022-04-09 13:26:20 +02:00
Gordon Bergling
addb2c6585 tcp_rack: Fix a typo in a source code comment
- s/possiblity/possibility/

MFC after:	3 days
2022-04-09 13:25:50 +02:00
Gordon Bergling
77a44875e5 netgraph(4): Fix a typo in a source code comment
- s/peform/perform/

MFC after:	3 days
2022-04-09 11:40:14 +02:00
Gordon Bergling
1a15a383a6 net: Fix a typo in a source code comment
- s/peform/perform/

MFC after:	3 days
2022-04-09 11:37:57 +02:00
Gordon Bergling
6a734168cb al_eth: Remove a double word in a source code comment
- s/for for/for/

MFC after:	3 days
2022-04-09 11:06:18 +02:00
Gordon Bergling
5f93395f2f ce(4): Remove a double word in a source code comment
- s/for for/for/

MFC after:	3 days
2022-04-09 11:05:38 +02:00
Gordon Bergling
586023f10d iwm(4): Remove a double word in a source code comment
- s/for for/for/

MFC after:	3 days
2022-04-09 11:04:23 +02:00
Gordon Bergling
2e09a4ac3b usb(4): Remove a double word in a source code comment
- s/for for/for/

MFC after:	3 days
2022-04-09 11:02:23 +02:00
Gordon Bergling
10df4dc724 iscsi(4): Remove a double word in a source code comment
- s/for for/for/

MFC after:	3 days
2022-04-09 11:01:43 +02:00
Gordon Bergling
6de6c95691 ofed: Remove a double word in a source code comment
- s/for for/for/

MFC after:	3 days
2022-04-09 11:00:48 +02:00
Gordon Bergling
97d8c695cf sys: Remove a double word in a source code comment
- s/for for/for/

MFC after:	3 days
2022-04-09 10:58:31 +02:00
Gordon Bergling
db739f1c19 sfxge(4): Remove a double word in a few source code comments
- s/for for/for/

MFC after:	3 days
2022-04-09 10:57:31 +02:00
Gordon Bergling
6cff32b3c4 ath(4): Remove a double word in a few source code comments
- s/for for/for/

MFC after:	3 days
2022-04-09 10:55:00 +02:00
Gordon Bergling
bafe4cee3d ips(4): Remove a double word in a few source code comments
- s/for for/for/

MFC after:	3 days
2022-04-09 10:53:50 +02:00
Gordon Bergling
609e6f6d28 ena(4): Remove a double word in a source code comment
- s/for for/for/

MFC after:	3 days
2022-04-09 10:50:49 +02:00
Gordon Bergling
c3721292e3 kern: Remove a double word in a source code comment
- s/for for/for/

MFC after:	3 days
2022-04-09 10:50:04 +02:00