Commit Graph

284396 Commits

Author SHA1 Message Date
Alexander V. Chernikov
84b41342da ipfw: add eaction tests
MFC after:	2 weeks
2023-06-15 06:36:16 +00:00
Marko Zec
32b28e3ae2 route.8: mention DXR in FIB_ALGO section
While here, add a sentence describing DPDK DIR24-8 principle of
operation.

MFC after:	2 weeks.
2023-06-15 07:21:51 +02:00
Kyle Evans
f5e5dcdbeb caroot: update the root bundle
Summary:
- Zero (0) newly trusted
- Five (5) modified
- Nine (9) distrusted

MFC after:	3 days
2023-06-14 23:30:19 -05:00
Jessica Clarke
456c1199d3 resizewin: Stop printing bogus NUL to TTY
A char array has an implicit NUL terminating it, which sizeof will
include, so we need to subtract 1 here. Printing a NUL can cause issues
for things like CI environments that aren't expecting it, especially
with recent Jenkins being stricter about not putting NUL in XML files.

Fixes:		3d222369ac ("Add a small tool, resizewin(1), to query terminal for window size")
MFC after:	1 week
2023-06-14 23:58:36 +01:00
Gleb Smirnoff
6eb2dbfa63 tcp: add missing static keywords
Without them compilation with -O0 would produce kernel modules
that depend on symbol that doesn't exist.
2023-06-14 14:21:28 -07:00
Colin Percival
bcf9147144 EC2: Default to "uefi-preferred" boot mode
In EC2, UEFI boots faster than BIOS, but not all amd64 instance types
support UEFI.  AMIs need to have their boot mode designated, which
created a dilemma: Faster boots, or wider compatibility?

The recently added "uefi-preferred" option solves this: AMIs can be
marked to use UEFI where it's available, but fall back to BIOS on
instance types which do not support UEFI.

This uses bsdec2-image-upload 1.4.6, which recently landed in the
ports tree.

PR:		265697
Reviewed by:	delphij, imp
MFC after:	1 week
Sponsored by:	https://www.patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D40470
2023-06-14 11:31:10 -07:00
Mitchell Horne
104e8215cc hwpmc: flatten conditional in pmc_process_exit()
Use a goto to clarify the control flow when there is no process
descriptor. This wins back a level of indentation.

No functional change intended.

Reviewed by:	jkoshy
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40518
2023-06-14 13:34:21 -03:00
Mitchell Horne
93fe5909ba hwpmc: split out PMC_OP_PMCRW
Split out the functional logic from the syscall handler into a helper
function. This keeps it separate from the syscall control-flow logic,
resulting in better readability overall. It also wins back a level of
indentation.

Reviewed by:	jkoshy
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40294
2023-06-14 13:34:21 -03:00
Mitchell Horne
f4fac946c6 hwpmc: split out PMC_OP_PMCRELEASE
Split out the functional logic from the syscall handler into a helper
function. This keeps it separate from the syscall control-flow logic,
resulting in better readability overall. It also wins back a level of
indentation.

Reviewed by:	jkoshy
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40293
2023-06-14 13:34:21 -03:00
Mitchell Horne
c514a571af hwpmc: split out PMC_OP_PMCALLOCATE
Split out the large chunk of functional logic from the syscall handler
into a helper function. This keeps it separate from the syscall
control-flow logic, resulting in better readability overall. It also
wins back a level of indentation.

Flip the return values of the pmc_can_allocate_row() and
pmc_can_allocate_rowindex() functions to boolean types, like their
naming implies. We weren't actually using the error codes they were
returning.

While here, make some small style cleanups. No functional change
intended.

Reviewed by:	jkoshy
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40292
2023-06-14 13:34:21 -03:00
Mitchell Horne
a133f64239 hwpmc: split out PMC_OP_PMCATTACH/PMC_OP_PMCDETACH
Begin splitting out the large chunks of functional logic from the
syscall handler into separate helper functions. This keeps it separate
from the syscall control-flow logic, resulting in better readability
overall. It also wins back a level of indentation.

For this and the similar changes to follow, try to keep copyin() and
copyout() calls outside of the helper functions. The changes are
intended to have no functional impact, but do address style issues.

Reviewed by:	jkoshy
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40291
2023-06-14 13:34:21 -03:00
Mitchell Horne
c498169442 hwpmc: split out PMC_FN_PROCESS_EXEC
Move the functionality into a separate helper function. All other
actions in pmc_hook_handler() already have this.

While here make some small style improvements. Restructure one for loop.

Reviewed by:	jkoshy
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40333
2023-06-14 13:34:21 -03:00
Mitchell Horne
01c35b677f hwpmc_mod.c: misc style cleanup
Everything else I found worthy of adjustment.

 - Order local variable declarations per style(9)
 - Make use of __unused annotations rather than cast to void
 - Remove unnecessary casts
 - Add (void) casts to PMC class methods where the return value is
   ignored
 - A couple instances of reordering statements for clarity
 - Prefer bool type where applicable
 - unsigned int -> u_int
 - Use uintmax_t/%j in printf calls
 - Formatting of comments

Reviewed by:	jkoshy
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40517
2023-06-14 13:34:20 -03:00
Mitchell Horne
e4fbd0395c hwpmc_mod.c: prototype style
Improve alphabetical organization, grouping, and whitespace.

Reviewed by:	jkoshy
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40516
2023-06-14 13:34:20 -03:00
Mitchell Horne
d5ee4074c2 hwpmc_mod.c: conditional and loop style
- Explicitly check the value in conditional statements, per style(9)
 - Add braces around more loops and conditionals, wherever it appears
   (to me) to aid legibility
 - Expand some assignments within if statements
 - Fix formatting around list-type FOREACH macros

Reviewed by:	jkoshy
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40515
2023-06-14 13:34:20 -03:00
Mitchell Horne
693cd30797 hwpmc_mod.c: whitespace style cleanup
Handle a few things related to spacing:
 - Remove redundant/superfluous blank lines (and add a couple where
   helpful)
 - Add spacing around binary operators
 - Remove spacing after casts and before goto labels
 - Adjustments for line width of 80 chars
 - Tab/space character issues

Reviewed by:	jkoshy
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40514
2023-06-14 13:34:20 -03:00
Mitchell Horne
52ebac7fd0 hwpmc_mod.c: return statement style
Reviewed by:	jkoshy
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40513
2023-06-14 13:34:20 -03:00
Mitchell Horne
0589e7059b hpwmc: add __pmcdbg_used annotation
For variables which are only used in PMCDBG* macros.

Reviewed by:	jkoshy, emaste
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40288
2023-06-14 13:34:20 -03:00
Alexander V. Chernikov
52ff888318 ifconfig: fix ifconfig crash when compiled w/WITHOUT_NETLINK.
Properly update the recently-introduced `ctx->ifname` when iterating
over interfaces.

Reported by:	Gary Jennejohn <garyj@gmx.de>
MFC after:	2 weeks
2023-06-14 10:37:07 +00:00
Alexander V. Chernikov
3927d0fb37 ifconfig: fix -Wunused warnings
MFC after:	2 weeks
2023-06-14 09:16:09 +00:00
Alexander V. Chernikov
a6094f844a ifconfig: remove 'newaddr' global variable
Differential Revision: https://reviews.freebsd.org/D40441
MFC after:	2 weeks
2023-06-14 09:16:09 +00:00
Alexander V. Chernikov
bbad5525fa ifconfig: start ifconfig context from main()
Differential Revision: https://reviews.freebsd.org/D40440
MFC after:	2 weeks
2023-06-14 09:15:58 +00:00
Alexander V. Chernikov
d61064229f ifconfig: fix comparison in printmimo().
Differential Revision: https://reviews.freebsd.org/D40301
MFC after:	2 weeks
2023-06-14 07:39:06 +00:00
Emmanuel Vadot
624f956bd9 fwget: Always install packages
This wasn't done before as -y wasn't added to the pkg install line.

Sponsored by:	Beckhoff Automation GmbH & Co. KG
2023-06-14 09:17:55 +02:00
Gleb Smirnoff
171a7bbfc0 tcpdump: fix build with WITHOUT_PF=1
Fixes:	ee67461e56
2023-06-13 20:58:36 -07:00
Xin LI
6cc4a1c320 Fix build with gcc12. 2023-06-13 20:24:07 -07:00
Dag-Erling Smørgrav
246aec9a3c nss_tacplus: Support setting the login class.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	thj
Differential Revision:	https://reviews.freebsd.org/D40376
2023-06-13 16:08:32 +00:00
Dag-Erling Smørgrav
21850106fd libtacplus: Allow additional AV pairs to be configured.
* Replace hand-rolled input tokenizer with openpam_readlinev() which supports line continuations and has better quoting and escaping.
* Simplify string handling by merging struct clnt_str and struct srvr_str into just struct tac_str.
* Each server entry in the configuration file can now have up to 255 AV pairs which will be appended to the ones returned by the server in response to a successful authorization request.

This allows nss_tacplus(8) to be used with servers which do not provide identity information beyond confirming the existence of the user.

This adds a dependency on libpam, however libtacplus is currently only used by pam_tacplus(8) (which is already always used with libpam) and the very recently added nss_tacplus(8) (which is extremely niche).  In the longer term it might be a good idea to split this out into a separate library.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	pauamma_gundo.com, markj
Differential Revision:	https://reviews.freebsd.org/D40285
Relnotes:	yes
2023-06-13 16:08:08 +00:00
Alexander V. Chernikov
9247238cc4 netlink: fix failing TestRtNlAddIfaddrLo::test_add_6 tests.
Recent netlink commit added hook for calling IPv6 code upon implicit
inteface bring-up on adding first interface address. This hook handles
link-local ifa addition for the loopback interface, resulting in
failed assertion in the loopback tests.

Fix the tests by fixing the assert.
2023-06-13 15:26:44 +00:00
Warner Losh
bd76e4c860 UPDATING: Add note about nvd aliases
Add note about nvd alias disabling to UPDATING so it's easily at hand.

Sponsored by:		Netflix
2023-06-13 09:23:58 -06:00
Warner Losh
6a8d4071c4 nvd/nda: Add release notes info.
Sponsored by:		Netflix
2023-06-13 09:18:18 -06:00
Kristof Provost
1e1bb5780c dummynet tests: attempt to provoke wf2q+ use-after-free
Attempt to provoke known use-after-free issues with WF2Q+.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-06-13 15:51:48 +02:00
Kristof Provost
0ba9cb5e71 dummynet: fix wf2q use-after-free
When we clean up a wf2q+ queue we need to ensure that we remove it from
the correct heap. If we leave a queue pointer behind in an unexpected
heap we'll later write to it, causing a use-after-free and unpredictable
panics.

Teach the dummynet heap code to verify that we're removing the correct
object so we can safely attempt to remove objects not contained in the
heap.

Remove a to-be-removed queue from all heaps.

Also don't continue the enqueue function if we're not finding the queue
on the idle heap as we'd expect.

While here also remove the empty heap warning, because this is now
expected to happen.

See also:	https://redmine.pfsense.org/issues/14433
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-06-13 15:51:47 +02:00
Kristof Provost
081acb837c dummynet: remove unused field from dn_pkt_tag
ip6opt is never used, so remove it, slightly reducing memory use for
each packet tag.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-06-13 15:51:47 +02:00
Christos Margiolis
1aa4862187 kinst: rename t_kinst to t_kinst_tramp
The forthcoming RISC-V and ARM64 ports of kinst introduce a new field
named "t_kinst_curprobe", so "t_kinst" (which points to a trampoline)
becomes a misleading name.

No functional change intended.

Reviewed by:	markj
Approved by:	markj (mentor)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40507
2023-06-13 15:46:45 +03:00
Christos Margiolis
333731274f kinst: hide KINST_TRAMPCHUNK_SIZE from ISA-specific headers
Reviewed by:	markj
Approved by:	markj (mentor)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40505
2023-06-13 15:46:33 +03:00
Christos Margiolis
0fbe78cdba proc.h: capitalize letter in TD_LOCKS_DEC
The other related macros capitalize "thread" as well, so use the same
style. No functional change intended.

Reviewed by:	markj
Approved by:	markj (mentor)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40506
2023-06-13 15:46:20 +03:00
Dmitry Chagin
cea7c564c7 namei: Reset the lookup to start from the real root for abs symlink target
Since fd745e1d Linux ABI specifies alternative root directory to reroot
lookups. First, an attempt is made to lookup the file in /ABI/original-path.
If that fails, the lookup is done in /original-path. In case of lookup
symbolic link with leading / in target namei() fails due to reroot reloads
original file name.
To avoid this handle restart in a special maner, without origin path name
reloading.

Reported by:		Goran Mekić, Vincent Milum Jr
Tested by:		Goran Mekić
Reviewed by:		kib
Differential Revision:	https://reviews.freebsd.org/D40479
2023-06-13 15:24:25 +03:00
Dmitry Chagin
861abdadf9 namei: Add a comment explaining ISRESTARTED flag
Reviewed by:		kib
Differential Revision:	https://reviews.freebsd.org/D40494
2023-06-13 15:22:09 +03:00
Alexander V. Chernikov
6a9cfebaf1 ipfw: simplify action case parser
Remove "goto charg" from the action parser.
This is a prerequisite for the further split of the gigantic
compile_rule().

Differential Revision: https://reviews.freebsd.org/D40490
MFC after: 2 weeks
2023-06-13 11:55:37 +00:00
Alexander V. Chernikov
9f44a47fd0 ipfw(8): add ioctl/instruction generation tests
Differential Revision: https://reviews.freebsd.org/D40488
MFC after:	2 weeks
2023-06-13 11:55:37 +00:00
Peter Holm
fa273fa154 stress2: Added a regression test for mksnap_ffs(8) 2023-06-13 11:01:43 +02:00
Corvin Köhne
740d76544a
linuxkpi: advance platform_device
These are required by some linux driver like:
https://github.com/beckhoff/bbapi

Reviewed by:		manu
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39554
2023-06-13 09:49:01 +02:00
Kirk McKusick
f1549d7d52 Write out corrected superblock when creating a UFS/FFS snapshot.
When taking a snapshot on a UFS version 1 filesystem we need to
call ffs_oldfscompat_write() to unwind any in-memory changes that
were made to the superblock before writing it. The cause of this bug
was that the trimmed down maximum file size was not being reverted.

PR:           271352
Tested-by:    Peter Holm
MFC-after:    1 week
Sponsored-by: The FreeBSD Foundation
2023-06-13 00:22:13 -07:00
Trond Endrestol
d77ca41f77 ifconfig(8): add the dotted format for MAC addresses.
MFC after:	2 weeks
PR:	261572
2023-06-13 06:40:15 +00:00
Alexander V. Chernikov
ea73ff9752 ifconfig: remove global_args variable.
This variable was temporarily introduced in the beginning of the
code cleanup. Use on-stack instance in main() instead.

Reviewed By: kp
Differential Revision: https://reviews.freebsd.org/D40439
MFC after:	2 weeks
2023-06-13 06:25:16 +00:00
Alexander V. Chernikov
85e0016a97 ifconfig: remove global 'name' variable.
Consistenly use newly-added 'ctx->ifname' as the name of the current
target interface.

Reviewed By: kp
Differential Revision: https://reviews.freebsd.org/D40438
MFC after:	2 weeks
2023-06-13 06:22:41 +00:00
Alexander V. Chernikov
c6f0602f23 ifconfig: pass if_ctx instead of socket to the tunnel handlers.
This is a pre-requisite for the global 'name' variable removal.

Reviewed By: kp
Differential Revision: https://reviews.freebsd.org/D40432
MFC after:	2 weeks
2023-06-13 06:20:00 +00:00
Alexander V. Chernikov
4106282ec4 ifconfig: remove global 'printifname' variable.
This variable was used to print the created interface name in the
atexit(3) handler. The interface name was calculated in the
ifclonecreate() by matching old & new names.

This change alter the implementation the following way:
1) the function responsible for the interface creation (ifcreate_ioctl)
 updates all necessary state internally. This removes the need for the
 name manipulation hack in wlan_create().
2) As atexit(3) handler does not accept any parameters, explicitly store
 the name to print in the ifname_to_print variable read by the atexit(3)
 handler.

Reviewed By: kp
Differential Revision: https://reviews.freebsd.org/D40431
MFC after:	2 weeks
2023-06-13 06:18:10 +00:00
Alexander V. Chernikov
c6885dbda7 ifconfig: eliminate global 'verbose' and 'printkey' variables
Reviewed By: kp
Differential Revision: https://reviews.freebsd.org/D40427
MFC after:	2 weeks
2023-06-13 06:16:14 +00:00