Commit graph

291619 commits

Author SHA1 Message Date
Dag-Erling Smørgrav 42b28f8152 ifconfig: Markup nits.
MFC after:	3 days
Reviewed by:	imp, allanjude
Differential Revision:	https://reviews.freebsd.org/D45209
2024-05-15 15:38:53 +02:00
Dag-Erling Smørgrav 46a619c6d4 adduser: Additional variable fixes.
One function used `_input` without making it local, causing its value to
leak into other functions.  This broke the `-f` case.  Fix that instance
and initialize all local variables that weren't already initialized.

Fixes:		170d088290
MFC after:	3 days
Reviewed by:	karels
Differential Revision:	https://reviews.freebsd.org/D45204
2024-05-15 14:13:49 +02:00
Dag-Erling Smørgrav 3b092e4936 ldns: Ignore commented-out lines in resolv.conf.
This merges upstream PR 238 + an additional bug fix.

PR:		278721
MFC after:	1 week
2024-05-15 12:20:15 +02:00
Dag-Erling Smørgrav 4891157c57 Fix bug in upstream PR 238. 2024-05-15 12:15:47 +02:00
Dag-Erling Smørgrav 154ad8e0f8 Revert "Issue #237 : Resolver uses nameserver commented out in /etc/resolv.conf"
This reverts commit b5fb1f44ed.
2024-05-15 12:10:20 +02:00
Dag-Erling Smørgrav a7beca6fb1 atf: Guard against multiple evaluation.
Note that the ATF-C++ macros have the same issue, but they are not as
easily fixed.

MFC after:	3 days
Reviewed by:	ngie
Differential Revision:	https://reviews.freebsd.org/D45148
2024-05-15 12:08:44 +02:00
Willem Toorop b5fb1f44ed Issue #237 : Resolver uses nameserver commented out in /etc/resolv.conf
This /etc/resolv.conf:
    # x

    # nameserver 8.8.8.8

Still configured 8.8.8.8 as nameserver, because the comment detection in `ldns_resolver_new_frm_fp_l()` didn't anticipate empty lines before the comment.
This fix removed all comment handling from `ldns_resolver_new_frm_fp_l()`. Instead a new function is introduced `ldns_fget_token_l_resolv_conf()` that skips comments that start with '#' and ';'. The old `ldns_fget_token_l()` (that is used for zonefiles too) still accepts only ';' for comments.
2024-05-15 11:52:49 +02:00
Willem Toorop 0c57cb21e0 Issue #237 : Resolver uses nameserver commented out in /etc/resolv.conf
This /etc/resolv.conf:
    # x

    # nameserver 8.8.8.8

Still configured 8.8.8.8 as nameserver, because the comment detection in `ldns_resolver_new_frm_fp_l()` didn't anticipate empty lines before the comment.
This fix removed all comment handling from `ldns_resolver_new_frm_fp_l()`. Instead a new function is introduced `ldns_fget_token_l_resolv_conf()` that skips comments that start with '#' and ';'. The old `ldns_fget_token_l()` (that is used for zonefiles too) still accepts only ';' for comments.
2024-05-15 11:46:36 +02:00
Kirk McKusick 61dece6d27 Enable soft updates by default for UFS2 filesystems.
Soft updates dramatically improve the performance of UFS filesystems.
The newfs(8) utility currently does not enable them by default. The
FreeBSD installer enables soft updates by default. However custom
built installations that do not specify the -U option to newfs(8)
and the prebuilt UFS system images get filesystems without soft
updates enabled.

There are several testing sites that run benchmarks comparing the
performance of Linux distributions versus BSD distributions. When
they run filesystem comparison benchmarks they use newfs(8) to
create the UFS filesystem. Because it does not have soft updates
enabled it runs poorly versus the Linux ext4 filesystem. When I
have suggested to them that they should enable soft updates on the
UFS filesystem in their testing their response is that they expect
the utility that creates the filesystem to use optimal defaults and
that they cannot be expected to fiddle with various option settings.

The purpose of this change is to give a filesystem created with
newfs(8) reasonably optimal settings. For UFS2 this means enabling
soft updates. For UFS1 which tends to be used on small systems with
minimal memory and CPU speed, the lower memory footprint of running
without soft updates is a more sensible default.

This change adds a note in the section of the newfs(8) manual page
that describes the -U option for enabling soft updates that they
are enabled by default for UFS2 filesystems and that they can be
disabled by using tunefs(8).

Reviewed-by: Warner Losh, kib
MFC after:   1 week
Differential Revision: https://reviews.freebsd.org/D45201
2024-05-14 22:40:01 -07:00
Kyle Evans 5af6fbd727 ssp: appease -Wgnu-statement-expression-from-macro-expansion
It's a stupid warning, but some ports enable it by default and were
already defining _FORTIFY_SOURCE, thus exposing the new macros
immediately.  This at least fixes the libfido2 build, perhaps others as
well.

While we're here, fix a fresh build of stand w/ FORTIFY_SOURCE enabled
by not pulling in the ssp headers if _STANDALONE is defined.  We do not
have runtime support in libsa as of the time of writing.

Reported by:	netchild
Sponsored by:	Stormshield
Sponsored by:	Klara, Inc.
2024-05-14 18:22:18 -05:00
Konstantin Belousov c6113ac5a2 AMD CPUs: update bits and data from CPUID 0x8000_0008
from AMD APM vol3 doc no 24594 Rev. 3.36 March 2024

Reviewed and tested by:	emaste
Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D45188
2024-05-15 02:06:23 +03:00
Adrian Chadd c7f5f140bf net80211: add initial key management suites from 802.11-2016, APIs to register them
The WPA1/WPA2 driver capabilities aren't really enough in today's world.
There are a /lot/ more key management suites to support!

So, add initial support for net80211 and drivers to announce what
key management suites are supported.  These are the list from 802.11-2016
section 9.4.2.25.3 (AKM suites.)

The flags are for software supported key management.

Drivers may support more key management suites and are welcome to
announce more; net80211 will only announce ones that we know
net80211 knows "enough" about to support correctly.

There /are/ other suites that may be interesting to some people in
the future that are not part of this set - eg if anyone ever
wants to support the Chinese WAPI standard - so this bitmap is not
specifically just the AKM suites in the RSN OUI.

This should eventually be communicated up to the wpa_supplicant and
hostapd via a replacement driver/vap capabilities call so they know
what to enable rather than just IEEE80211_C_WPA1 / IEEE80211_C_WPA2.

Differential Revision:	https://reviews.freebsd.org/D44919
Reviewed by:	bz
2024-05-14 14:39:33 -07:00
Adrian Chadd dcf6ab2f2e net80211: allow a single wlan crypto module to register for >1 cipher
This allows a single wlan crypto module to register for more than
one cipher.  Without it, duplicate linkerset structs are initialised
for the actual module loading machinery itself.

I've tested this in my private tree with wlan_ccmp providing both
128 and 256 bit cipher support.

Differential Revision:	https://reviews.freebsd.org/D44901
Reviewed by:	bz, cc, cy
Approved by:	bz, cc, cy
2024-05-14 14:39:24 -07:00
Adrian Chadd 98e8df90b5 net80211: add placeholder module names for the new ciphers
This is effectively a no-op as we currently don't advertise these
ciphers as available anywhere.

Note though the intent to support 128 and 256 bit ciphers in the same
crypto module.

Differential Revision:	https://reviews.freebsd.org/D44900
Reviewed by:	cc, cy
Approved by:	cc, cy
2024-05-14 14:39:11 -07:00
Adrian Chadd 05540e62e7 net80211: add the 802.11-2016 cipher list to the crypto array set.
These are the bitmap / cipher module number fields used for net80211
ciphers.

This requires a kernel recompile, but nothing (currently) in userland
is using these.

Differential Revision:	 https://reviews.freebsd.org/D44899
Reviewed by:	bz, cc
2024-05-14 14:39:00 -07:00
Warner Losh eb690a0576 awk: Merge in bsd-feature branch of OTA from 20240422 (31bb33a32f71)
In the last 2nd edition import, I mistakenly grabbed from the 'main'
branch of upstream rather than the bsd-feature branch. This means that
we have a regression in awk from that point forward: all the
BSD-specific bit functions (and a few others) were dropped. This
restores it at the same level.

MFC After:		1 day
Sponsored by:		Netflix
2024-05-14 12:17:55 -06:00
Warner Losh 887b27736b ota: Import bsd-feature branch from 20240422 (31bb33a32f71)
The prior import(s) of 2nd edition awk imported the 'main' branch of
OTA, not the bsd-feature branch, resulting in a regression for the
bsd-specific features. This re-imports those from the correct branch.
2024-05-14 12:08:31 -06:00
Christos Margiolis 305db91d4b sound: Remove ncards variable from sound_oss_card_info()
The loop counter is also the card's index, so ncards is redundant.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D45144
2024-05-14 15:42:20 +02:00
Christos Margiolis 278953360e snd_hda: Rename LENOVO_I* to LENOVO_IDEAPAD*
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D45105
2024-05-14 15:42:15 +02:00
Christos Margiolis 54cc353f50 snd_hda: Add patch for Lenovo Ideapad 3
Reported by:	bsd-lists@bsdforge.com
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D45100
2024-05-14 15:42:04 +02:00
Baptiste Daroussin 79bffdf3f4 usb_vendors: update to 2024.03.18 2024-05-14 14:18:52 +02:00
Baptiste Daroussin b0b9435ef1 pci_vendors: update to 2024.05.14 2024-05-14 14:18:20 +02:00
Baptiste Daroussin 5681636ead nuageinit: by default to not enable nuageinit
MFC After:	1 day
Reported by:	karels@
2024-05-14 14:16:45 +02:00
Dag-Erling Smørgrav 847ef59d4b ifconfig: Add format shortcuts.
MFC after:	1 week
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D45166
2024-05-14 08:51:50 +02:00
Simon J. Gerraty c9f4001f81 Merge bmake-20240508
Merge commit '3c2ab5fddc576e58f3ffa70dc5fa95144646a513'
2024-05-13 22:19:20 -07:00
Doug Moore b5a1f0406b arm64_pmap: narrow scope of bti_same test
The pmap_bti_same test in pmap_enter_l3c only happens in the
!ADDR_IS_KERNEL case; in the other case, a KASSERT fails. So move the
test into that case to save a bit of time when ADDR_IS_KERNEL.

Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D45160
2024-05-13 23:22:52 -05:00
Simon J. Gerraty 3c2ab5fddc Import bmake-20240508
Intersting/relevant changes since bmake-20240430

ChangeLog since bmake-20240430

2024-05-07  Simon J Gerraty  <sjg@beast.crufty.net>

	* VERSION (_MAKE_VERSION): 20240508
	Merge with NetBSD make, pick up
	o make: ensure variables set on command line get added to
	.MAKEOVERRIDES (even if they start with '.') so they are passed to
	sub-makes.

mk/ChangeLog since bmake-20240430

2024-05-04  Simon J Gerraty  <sjg@beast.crufty.net>

	* install-mk (MK_VERSION): 20240504

	* dirdeps.mk: allow BUILD_DIRDEPS_OVERRIDES to pass overrides to
	sub-make building DIRDEPS_CACHE.
2024-05-13 21:13:22 -07:00
Zhenlei Huang d9f1f0a901 boottrace: Use NULL for SYSINIT's last arg, which is a pointer type
MFC after:	3 days
2024-05-14 12:03:50 +08:00
Koine Yuusuke 338d53965d x86: Add Intel TD/HFI related MSR/CPUID defines to specialregs.h
for the coredirector driver.

MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D44453
2024-05-14 03:10:52 +03:00
Joseph Mingrone 2735824564
freebsd-tips: Add fortune to find font providing Unicode character
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D45183
2024-05-13 20:02:17 -03:00
Kyle Evans dec211c6cf Stop removing ssp headers
These were previously installed by the GCC implementation of libssp, but
now they're installed once again with our implementation of
FORTIFY_SOURCE.

Reported by:	jkim
Fixes:	be04fec426 ("Import _FORTIFY_SOURCE implementation [...]")
2024-05-13 17:45:55 -05:00
Kyle Evans 0ed58ac88a include: ssp: kill off leftover $FreeBSD$ tag
Most of these were fixed when rebasing the patch forward, but this one
seems to have been missed.

Reported by:	marck
Fixes:	be04fec426 ("Import _FORTIFY_SOURCE implementation [...]")
2024-05-13 17:45:55 -05:00
Warner Losh 0dd84c3b11 nvme: Add comment about where tr->deadline is set
It's easy to overlook the chain of events that lead to tr->deadline
being updated. Add a comment here to explain what otherwise looks like
an oversight w/o careful study.

Sponsored by:		Netflix
2024-05-13 16:14:04 -06:00
Warner Losh c931cf6af0 nvme: Slight simplification
We don't need to dereference qpair to get the ctrlr pointer each time,
so use the cached value. It's not going to change. No change intended.

Sponsored by:		Netflix
2024-05-13 16:14:04 -06:00
Warner Losh 9db8ca92b9 nvme: Slight reworking this loop to match FreeBSD style
Update the comment for the code, and slightly rework the code in the
'fast exit' paradigm that FreeBSD generally tries to do.

Sponsored by:		Netflix
2024-05-13 16:14:04 -06:00
Warner Losh 5a178b831a nvme: Add locking asserts
nvme_qpair_complete_tracker and nvme_qpair_manual_complete_tracker have
to be called without the qpair lock, so assert its unowned.

Sponsored by:		Netflix
2024-05-13 16:14:03 -06:00
John Baldwin da4230af3f nvme/f: Use strlcpy instead of strncpy + manual string termination
Reviewed by:	dab, imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D45153
2024-05-13 12:04:03 -07:00
John Baldwin 01fc488381 nvme: Use strlcpy instead of strncpy to ensure termination
Reviewed by:	dab, imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D45152
2024-05-13 12:03:49 -07:00
Mariusz Zaborski e90259af59 regen
Pointed out by:	brooks
2024-05-13 20:37:20 +02:00
Konstantin Belousov 4681194979 tmpfs_destroy_vobject(): clear v_object under the object lock
Which allows tmpfs_pager_writecount_recalc() to reliably detect
reclaimed vnode and make its accesses to object->un_pager.swp.private
(== vp) safe against reclaim.  Note that vnode instantiation already
assigns v_object under the object lock.

Reviewed by:	markj
Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D45119
2024-05-13 21:33:59 +03:00
Konstantin Belousov 6ada4e8a0a swap-like pagers: assert that writemapping decrease does not pass zero
Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D45119
2024-05-13 21:33:29 +03:00
Konstantin Belousov 58d7ac11e7 tmpfs: recalculate OBJ_TMPFS_VREF on reinstantiating node' vnode
Reported and tested by:	pho
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D45119
2024-05-13 21:33:29 +03:00
Mariusz Zaborski 663838451e syscalls: regen
Pointed out by: trasz
2024-05-13 19:29:57 +02:00
Kyle Evans 8b0682644e Fix the GCC build after _FORTIFY_SOURCE import
We haven't exposed gets(3) in a long time, rip out __gets_chk before
it's too late and something builds a gets(3) user with it enabled.
2024-05-13 11:21:38 -05:00
Ed Maste b667c40f9f src.conf.5: regen after addition of _FORTIFY_SOURCE build knob
Regen to pick up WITHOUT_SSP addition from commit 9bfd3b4076.

Sponsored by:	The FreeBSD Foundation
2024-05-13 11:28:52 -04:00
Edward Tomasz Napierala 050555e129 syscalls.master: allow vfork(2) in capsicum(4) capability mode
There is no reason not do do this, we already allow fork(2),
and I need vfork(2) for CHERI process colocation.

Reviewed by:	brooks, emaste, oshogbo
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39829
2024-05-13 16:12:29 +02:00
Dag-Erling Smørgrav f3eeeb959c expand: Fix markup for the -t option.
PR:		274897
Fixes:		8993d785a2
MFC after:	3 days
Reviewed by:	gbe
Differential Revision:	https://reviews.freebsd.org/D45167
2024-05-13 12:41:38 +02:00
Kristof Provost 59a6666ec9 if_ovpn: cope with loops
User misconfiguration may lead to routing loops where we try to send the tunnel
packet into the tunnel. This eventually leads to stack overflows and panics.

Avoid this using if_tunnel_check_nesting(), which will drop the packet if we're
looping or we hit three layers of nested tunnels.

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-05-13 12:11:06 +02:00
Gordon Bergling 421025a274 access.2: Mention that lstat(2) should be used for symbolic links
access(), eaccess() and faccessat() will always dereference
symbolic links.

So add a note in the manual page, that lstat(2) should be
used in the case of symbolic links.

PR:	262895
Reviewed by:	gbe, pauamma_gundo.com
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D44890
2024-05-13 10:40:12 +02:00
Kyle Evans 9bfd3b4076 Add a build knob for _FORTIFY_SOURCE
In the future, we will Default to _FORTIFY_SOURCE=2 if SSP is enabled,
otherwise default to _FORTIFY_SOURCE=0.  For now we default it to 0
unconditionally to ease bisect across older versions without the new
symbols, and we'll put out a call for testing.

include/*.h include their ssp/*.h equivalents as needed based on the
knob. Programs and users are allowed to override FORTIFY_SOURCE in their
Makefiles or src.conf/make.conf to force it off.

Reviewed by:	des, markj
Relnotes:	yes
Sponsored by:	Stormshield
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D32308
2024-05-13 00:23:50 -05:00