Commit graph

291448 commits

Author SHA1 Message Date
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
Warner Losh 4fc5f321ba rc.conf.5: Fix translation from netmask to cdir
These two should have been 30 bit masks, not 32, as the original
netmasks were 255.255.255.252.

Fixes: cb808de400
Noticed by: Kelly Hays
2024-05-04 15:41:36 -06:00
Rick Macklem 3f65000b6b nfsd: Fix Link conformance with RFC8881 for delegations
RFC8881 specifies that, when a Link operation occurs on an
NFSv4, that file delegations issued to other clients must
be recalled.  Discovered during a recent discussion on nfsv4@ietf.org.

Although I have not observed a problem caused by not doing
the required delegation recall, it is definitely required
by the RFC, so this patch makes the server do the recall.

Tested during a recent NFSv4 IETF Bakeathon event.

MFC after:	1 week
2024-05-04 14:30:07 -07:00
Dimitry Andric 6f44401900 lib/clang: clean out old llvm/clang Sparc target remnants
The WITH_LLVM_TARGET_ENABLE_SPARC option was removed a long time ago,
but some ifdefs were still laying around, so clean them up.

PR:		276104
MFC after:	3 days
2024-05-04 19:34:18 +02:00
Warner Losh 1c25f3fdf3 ota: Import 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.

Note: This brings in the matchop-deref.* files that were missing (but in
FreeBSD already) and adds system-stauts.ok2. The latter has been deleted
in FreeBSD since it does not fit ATF well. Care must be taken to remove it
before the merge this time.

Sponsored by:		Netflix
2024-05-04 11:10:41 -06:00
Ed Maste 60a517b66a libfido2: update to 1.14.0
Sponsored by:	The FreeBSD Foundation
2024-05-04 12:51:08 -04:00
Lexi Winter cb808de400 rc.conf.5: modernise network_interfaces
It's not 1996 anymore, and we use CIDR nowadays.  Update the various
ifconfig_ examples to use CIDR notation instead of netmasks, and also
add an example of a basic ifconfig_ entry that most users will be
interested in.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1217
2024-05-04 10:43:22 -06:00
Dimitry Andric 894cb08f0d Fixup: Merge llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9
Update version numbers, config headers, etc. Git tricked me into losing
these before pushing.

PR:		276104
Fixes:		d67fc74b9249
MFC after:	3 days
2024-05-04 17:49:57 +02:00
Dimitry Andric 5678d1d98a Merge llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9.

PR:		276104
MFC after:	3 days
2024-05-04 17:44:49 +02:00
Lexi Winter 0ad9b235e1 arp(8): fix a typo in error message for -s/-S
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1214
2024-05-04 09:02:42 -06:00
Alexander Ziaee 9a62cdc013 intro.2 as errno.2: Use the name macro for errno
Reviewed by: imp
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1192
2024-05-04 08:56:10 -06:00