Commit graph

291408 commits

Author SHA1 Message Date
Poul-Henning Kamp 0c7237d7e2 Remove GBDE rc support 2024-05-07 07:23:03 +00:00
Poul-Henning Kamp 14b475c479 Remove gbde support from swapon(8) 2024-05-07 07:21:46 +00:00
Poul-Henning Kamp eef9887871 Remove gbde.4 man page 2024-05-07 07:21:28 +00:00
Poul-Henning Kamp 6ac1f02be3 Add GBDE to ObsoleteFiles.inc 2024-05-07 06:50:52 +00:00
Poul-Henning Kamp 74be648512 Disconnect GBDE from the build. (Per earlier announcements of retirement.) 2024-05-07 05:19:03 +00:00
Warner Losh 08b4520338 sg: Add sg(4) man page
Add minimal sg(4) manual page. This implements a subset of the Linux
IOCTL interface for either native FreeBSD programs, or for Linux
binaries in the linuxulator.

Noticed by:	Lexi Winter
Sponsored by:	Netflix
2024-05-06 16:29:58 -06:00
Gleb Smirnoff 0089d83b3a lagg: enable tests that stress the configuration changes
I wasn't able to reproduce a crash in several runs.  Might be that
48698ead6f or earlier changes have closed the races.  In case crashes
with just enabled tests are registered, I will either work on them or
disable tests again.
2024-05-06 15:27:32 -07:00
Gleb Smirnoff fadbb6f85a lagg: remove use of net epoch in the ioctl paths
Rely on LAGG_SLOCK() instead.  The use of network epoch(9) here was added
in 6573d7580b (later tidied by 87bf9b9cbe) as a large sweep that
blindly substituted blocking kernel primitives with epoch(9).  In these
particular code paths use of epoch(9) is incorrect and doesn't provide any
protection against a stale pointer.  Recent fix 48698ead6f, which should
actually have removed the epoch use, created a potential sleeping in epoch
problem.
2024-05-06 15:27:32 -07:00
Gleb Smirnoff 570685971c lagg: propagate up/down to the children
Based on the old submission from asomers@.  With modern state of locking
in lagg(4), the patch got much simplier.  Enable the test that was
waiting for this change.

PR:			226144
Reviewed by:		asomers
Differential Revision:	https://reviews.freebsd.org/D44605
2024-05-06 15:27:32 -07:00
John Baldwin 1d425ef341 nvmf: Add explicit alignment for struct nvmf_fabric_cmd
This avoids -Wcast-align warnings from clang when upcasting from
struct nvmf_fabric_cmd to struct nvmf_fabric_prop_set_cmd.

Reported by:	bapt
Sponsored by:	Chelsio Communications
2024-05-06 15:19:39 -07:00
Ed Maste 2d29d2eceb clock_gettime.2: fix markup
The CLOCK_* constants are "defined variable or preprocessor constants"
and so use .Dv.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45106
2024-05-06 17:52:22 -04:00
John Baldwin a7db82cfd9 nvmf_tcp: Correct tests for PDU direction
Add parentheses to ensure the correct order of operations.

Reported by:	GCC
2024-05-06 14:03:48 -07:00
John Baldwin e75a79f40b nvmf: Remove packing pragmas from nvmf_proto.h
The protocol structures do not need explicit packing and static
assertions verify the size of all the structures as well as the
offsets of several key fields.  The pragma triggers warnings when
building with GCC.

Sponsored by:	Chelsio Communications
2024-05-06 14:03:44 -07:00
Colin Percival 0b1c5628c7 release: Rework vm_extra_pre_umount
The vm_extra_pre_umount function in vmimage.subr served two purposes:
It removed /etc/resolv.conf and /qemu (if cross-building), and it
provided a function for cloudware to override in order to make cloud
specific changes to the filesystem before constructing a disk image.

This resulted in a number of bugs:
1. When cross-building, the emulator binary was left as /qemu in the
Azure, GCE, Openstack and Vagrant images.
2. The build host's resolv.conf was left as /etc/resolv.conf in the
basic-ci and basic-cloudinit images.
3. When building GCE images, a Google-specific resolv.conf file was
constructed, and then deleted before the disk image was created.

Move the bits needed for running code inside a VM staging directory
from vm_install_base into a new vm_emulation_setup routine, and move
the corresponding cleanup bits from vm_extra_pre_umount to a new
vm_emulation_cleanup routine.

Remove the /qemu and /etc/resolv.conf cleanups from the cloudware
configuration files (where they exist) since we will now be running
vm_emulation_cleanup to remove those even when vm_extra_pre_umount
has been overridden.

Override vm_emulation_cleanup in gce.conf since in that one case (and
*only* that one case) we don't want to clean up resolv.conf (since it
was constructed for the VM image rather than copied from the host).

releng/14.1 candidate.

MFC after:	1 week
Sponsored by:	https://www.patreon.com/cperciva
2024-05-06 13:40:47 -07:00
Gleb Smirnoff 99b0270adc sockets: hide socket hhook(9)s under SOCKET_HHOOK
There are no in-tree consumers of these hooks.

Reviewed by:		stevek
Differential Revision:	https://reviews.freebsd.org/D44928
2024-05-06 12:49:29 -07:00
Christos Margiolis a3513995f5 arm: Remove stray references to dev/sound/chip.h
Fixes:		923e0040a5 ("sound: Move chip.h contents to pcm/sound.h")
Reported by:	Jenkins CI
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-05-06 21:35:30 +02:00
Gleb Smirnoff e9b411d273 tests/fusefs: fix all tests that depend on kern.maxphys
The tests try to read kern.maxphys sysctl into int value, while
unsigned long is required.  Not sure when this was broken, seems like
since cd85379104.

Reviewed by:		asomers
Differential Revision:	https://reviews.freebsd.org/D45053
2024-05-06 12:03:20 -07:00
Christos Margiolis 2b14465faa sound: Update pcm/vchan.c LICENSE header
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-05-06 20:47:33 +02:00
Marko Zec 5295e891d0 fib_dxr: update comment.
MFC after:	1 week
2024-05-06 20:42:31 +02:00
Marko Zec 858010643c fib_dxr: free() does nothing if arg is NULL, so remove a redundant check.
MFC after:	1 week
2024-05-06 20:37:44 +02:00
Christos Margiolis 3af2beb8b2 sound: Remove unused "num" argument from chn_init() and related callers
It is always -1 (i.e unused).

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D45095
2024-05-06 20:35:55 +02:00
Christos Margiolis 77ab4263bc sound: Rename pcm_getparentchannel() to vchan_getparentchannel()
Follow the rest of the vchan.c naming convention.

No functional change intended.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D45016
2024-05-06 20:35:55 +02:00
Christos Margiolis 7ad5f383fc sound: Move vchan-related code to pcm/vchan.*
pcm/sound.* contains code that should be part of pcm/vchan.*.

Changes:
- pcm_setvchans() -> vchan_setnew()
- pcm_setmaxautovchans() -> vchan_setmaxauto()
- hw.snd.maxautovchans moved to pcm/vchan.c
- snd_maxautovchans declaration moved to pcm/vchan.h and definition to
  pcm/vchan.c

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	dev_submerge.ch, markj
Differential Revision:	https://reviews.freebsd.org/D45015
2024-05-06 20:35:55 +02:00
Christos Margiolis c597c55792 sound: Use nitems() where possible
No functional change intended.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	markj, emaste
Differential Revision:	https://reviews.freebsd.org/D45014
2024-05-06 20:35:55 +02:00
Christos Margiolis 72cbd38107 sound: Remove unused dsp_cdevs[] fields and devices
These fields and devices are unused as of e8c0d15a64 ("sound: Get rid
of snd_clone and use DEVFS_CDEVPRIV(9)").

While here, remove unused SND_DEV_* defines from pcm/sound.h and convert
the list to an enum.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	dev_submerge.ch, markj
Differential Revision:	https://reviews.freebsd.org/D45013
2024-05-06 20:35:55 +02:00
Christos Margiolis 923e0040a5 sound: Move chip.h contents to pcm/sound.h
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D44997
2024-05-06 20:35:55 +02:00
Christos Margiolis 5224825a0e RELNOTES: Mention hw.snd.version being removed
Sponsored by:	The FreeBSD Foundation
2024-05-06 20:35:35 +02:00
Christos Margiolis 7398d1ece5 sound: Remove hw.snd.version and SND_DRV_VERSION
hw.snd.version and SND_DRV_VERSION define the sound driver version and
are meant to be used in bug reports, but because these values are
constant, there is not much useful information we can extract from them.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	dev_submerge.ch, emaste
Differential Revision:	https://reviews.freebsd.org/D44996
2024-05-06 20:35:06 +02:00
Christos Margiolis 139bcec852 sound: Convert pcm_chn_add() to void
It always returns 0.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	markj, emaste
Differential Revision:	https://reviews.freebsd.org/D44998
2024-05-06 20:27:18 +02:00
Christos Margiolis 76f95bae09 sound: Add __assert_unreachable() to default cases in pcm_chn_add() and pcm_chn_remove()
We should normally never enter these cases.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	markj, emaste
Differential Revision:	https://reviews.freebsd.org/D44994
2024-05-06 20:26:56 +02:00
Christos Margiolis 2e9962ef57 sound: Merge pcm_chn_create() and chn_init()
Follow-up of b3ea087c05 ("sound: Merge
pcm_chn_destroy() and chn_kill()")

While here, add device_printf()'s to all failure points. Also fix an
existing bug where we'd unlock an already unlocked channel, in case we
went to "out" (now "out2") before locking the channel.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D44993
2024-05-06 20:26:37 +02:00
Marko Zec 308caa38cd fib_dxr: log malloc() failures.
MFC after:	1 week
2024-05-06 20:21:55 +02:00
John Baldwin 2f68f6474e git-arc: Add list mode support for the update command
This can be particularly useful to do bulk-updates of multiple commits
using the same message, e.g.

  git arc update -lm "Move function xyz to libfoo" main..myfeature

Similar to the list mode for the create command, git arc will list all
the candidate revisions with a single prompt.  Once that is confirmed,
all the revisions are updated without showing the diffs or pausing
further prompts.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D45050
2024-05-06 10:49:04 -07:00
Jamie Landeg-Jones 3f0b80bc15 ps: handle incorrect -D values
I just noticed a slight issue with the '-D' option. Basically,
I accidentally typed something along the lines of:

ps -Dboth-p303

I.E. missing out the "space". Instead of giving an error, it behaved as
if I'd just typed "ps".

Looking at bin/ps/ps.c, where the -D option is parsed, it doesn't
error-out if there is no valid match.

This commit fixes the bug.
2024-05-06 19:13:35 +02:00
Warner Losh 1314d14c32 endian.h: Define uint{16,32,64}_t
The Draft Posix Issue 8 standard requires that these be defined. Define
them in the usual way that lets multiple headers define them. Opted to
not just use #include <stdint.h>, allowed by the draft, to be
conservative. Add notes about how we comply with Issue 8, and that we've
opted to define these only as macros, though the standard allows
functions, macros or both.

Sponsored by:		Netflix
2024-05-06 10:43:14 -06:00
Dag-Erling Smørgrav e12b7446bd pw: Test home directory ownership and mode.
MFC after:	3 days
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D45099
2024-05-06 18:18:50 +02:00
Dag-Erling Smørgrav 46c4e86ebf adduser: Fix confusion between uclass and _class.
This caused adduser to produce an invalid `pw(8)` command line.  Due to
bugs in `pw(8)`, the command line was silently accepted and led to the
user being created, but locked out and with no home directory.

Also fix the default value for the “Another user?” prompt.

Fixes:		170d088290
MFC after:	3 days
Reviewed by:	karels, allanjude
Differential Revision:	https://reviews.freebsd.org/D45098
2024-05-06 18:18:47 +02:00
Dag-Erling Smørgrav c86119328e pw: Don't silently ignore unparsed command line arguments.
MFC after:	3 days
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D45097
2024-05-06 18:18:43 +02:00
Dag-Erling Smørgrav a9ea647c29 pw: Rename some enums.
Rename `M_PRINT` and `M_UPDATE` to `M_SHOW` and `M_MODIFY` to match the
names of the commands they represent.  No functional change intended.

MFC after:	3 days
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D45096
2024-05-06 18:18:39 +02:00
Kristof Provost 43387b4e57 if: guard against if_ioctl being NULL
There are situations where an struct ifnet has a NULL if_ioctl pointer.

For example, e6000sw creates such struct ifnets for each of its ports so it can
call into the MII code.

If there is then a link state event this calls do_link_state_change()
-> rtnl_handle_ifevent() -> dump_iface() -> get_operstate() ->
get_operstate_ether(). That wants to know if the link is up or down, so it tries
to ioctl(SIOCGIFMEDIA), which doesn't go well if if_ioctl is NULL.

Guard against this, and return EOPNOTSUPP.

PR:		275920
MFC ater:	3 days
Sponsored by:   Rubicon Communications, LLC ("Netgate")
2024-05-06 11:39:08 +02:00
Emmanuel Vadot 7929aeebbd dts: Bump the freebsd branding version to 6.8
Sponsored by:   Beckhoff Automation GmbH & Co. KG
2024-05-06 10:47:26 +02:00
Emmanuel Vadot 8d13bc63c0 Import device-tree files from Linux 6.8
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2024-05-06 10:46:36 +02:00
Emmanuel Vadot c0b8b8188e dts: Bump the freebsd branding version to 6.7
Sponsored by:   Beckhoff Automation GmbH & Co. KG
2024-05-06 10:46:20 +02:00
Emmanuel Vadot 84943d6f38 Import device-tree files from Linux 6.7
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2024-05-06 10:45:28 +02:00
Emmanuel Vadot 13f6b1d0bf dts: Bump the freebsd branding version to 6.6
Sponsored by:   Beckhoff Automation GmbH & Co. KG
2024-05-06 10:44:59 +02:00
Emmanuel Vadot aa1a8ff2d6 Import device-tree files from Linux 6.6
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2024-05-06 10:43:59 +02:00
Konstantin Belousov c097967b9a mlx5en: add diagnostic in one more case of failed eeprom read preparation
Sponsored by:	Nvidia Networking
MFC after:	1 week
2024-05-06 06:15:35 +03:00
Randall Stewart fce03f85c5 TCP can be subject to Sack Attacks lets fix this issue.
There is a type of attack that a TCP peer can launch on a connection. This is for sure in Rack or BBR and probably even the default stack if it uses lists in sack processing. The idea of the attack is that the attacker is driving you to look at 100's of sack blocks that only update 1 byte. So for example if you have 1 - 10,000 bytes outstanding the attacker sends in something like:

ACK 0 SACK(1-512) SACK(1024 - 1536), SACK(2048-2536), SACK(4096 - 4608), SACK(8192-8704)
This first sack looks fine but then the attacker sends

ACK 0 SACK(1-512) SACK(1025 - 1537), SACK(2049-2537), SACK(4097 - 4609), SACK(8193-8705)
ACK 0 SACK(1-512) SACK(1027 - 1539), SACK(2051-2539), SACK(4099 - 4611), SACK(8195-8707)
...
These blocks are making you hunt across your linked list and split things up so that you have an entry for every other byte. Has your list grows you spend more and more CPU running through the lists. The idea here is the attacker chooses entries as far apart as possible that make you run through the list. This example is small but in theory if the window is open to say 1Meg you could end up with 100's of thousands link list entries.

To combat this we introduce three things.

when the peer requests a very small MSS we stop processing SACK's from them. This prevents a malicious peer from just using a small MSS to do the same thing.
Any time we get a sack block, we use the sack-filter to remove sacks that are smaller than the smallest v4 mss (minus 40 for max TCP options) unless it ties up to snd_max (since that is legal). All other sacks in theory should be at least an MSS. If we get such an attacker that means we basically start skipping all but MSS sized Sacked blocks.
The sack filter used to throw away data when its bounds were exceeded, instead now we increase its size to 15 and then throw away sack's if the filter gets over-run to prevent the malicious attacker from over-running the sack filter and thus we start to process things anyway.
The default stack will need to start using the sack-filter which we have talked about in past conference calls to take full advantage of the protections offered by it (and reduce cpu consumption when processing sacks).

After this set of changes is in rack can drop its SAD detection completely

Reviewed by:tuexen@, rscheff@
 Differential Revision:	<https://reviews.freebsd.org/D44903>
2024-05-05 09:08:47 -04:00
Colin Percival 9287d1853c release: Use qemu when cross-building vm images
For a bit over 5 years, we have used qemu when cross-building cloudware
images; in particular, it's necessary when installing packages which
might include post-install scripts.

Use qemu in the vm-images target too; while "generic" vm images don't
install packages, they still run newaliases and /etc/rc.d/ldconfig,
both of which fail without appropriate emulation.

MFC after:	1 week
2024-05-04 23:59:29 -07:00
Warner Losh 1023317ac4 ota: Merge one true awk 20240422 (a3b68e649d2d)
Apr 22, 2024:
	fixed regex engine gototab reallocation issue that was
	introduced during the Nov 24 rewrite. Thanks to Arnold Robbins.
	Fixed a scan bug in split in the case the separator is a single
	character. thanks to Oguz Ismail for spotting the issue.

Mar 10, 2024:
	fixed use-after-free bug in fnematch due to adjbuf invalidating
	the pointers to buf. thanks to github user caffe3 for spotting
	the issue and providing a fix, and to Miguel Pineiro Jr.
	for the alternative fix.
	MAX_UTF_BYTES in fnematch has been replaced with awk_mb_cur_max.
	thanks to Miguel Pineiro Jr.

Sponsored by:		Netflix
2024-05-04 15:50:33 -06:00