Commit Graph

291610 Commits

Author SHA1 Message Date
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
Kyle Evans
e55512504d Prepare the system for _FORTIFY_SOURCE
Notably:
- libc needs to #undef some of the macros from ssp/* for underlying
  implementations
- ssp/* wants a __RENAME() macro (snatched more or less from NetBSD)

There's some extra hinkiness included for read(), since libc spells it
as "_read" while the rest of the world spells it "read."

Reviewed by:	imp, ngie
Sponsored by:	Stormshield
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D32307
2024-05-13 00:23:50 -05:00
Kyle Evans
be04fec426 Import _FORTIFY_SOURCE implementation from NetBSD
This is a mostly-unmodified copy of the various *_chk implementations
and headers from NetBSD, without yet modifying system headers to start
actually including them.  A future commit will also apply the needed
bits to fix ssp/unistd.h.

Reviewed by:	imp, pauamma_gundo.com (both previous versions), kib
Sponsored by:	Stormshield
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D32306
2024-05-13 00:23:49 -05:00
Alan Cox
94b09d388b arm64: map kernel using large pages when page size is 16K
When the page size is 16K, use ATTR_CONTIGUOUS to map the kernel code
and data sections using 2M pages.  Previously, they were mapped using
16K pages.

Reviewed by:	markj
Tested by:	markj
Differential Revision:	https://reviews.freebsd.org/D45162
2024-05-12 18:22:38 -05:00
Fernando Apesteguía
47535ba3d3 bsdinstall: Remove unused variables in fetchmissingdists
ALL_DISTRIBUTIONS and VERIFY_MANIFEST_SIG

They are neither used in the script nor exported.
Not referenced anywhere in bsdinstall/*

Approved by:		imp@
Differential Revision:	https://reviews.freebsd.org/D42369
2024-05-12 19:25:06 +02:00
Warner Losh
71ffda4130 Revert linprocfs commits
There's a race in these that I missed in my review that needs
to be resolved.

This reverts commit ee2e36686e.
This reverts commit 02f481a30b.
This reverts commit 099a81a417.
2024-05-12 09:09:03 -06:00
Gordon Bergling
78e4dbc345 ipfw: Fix a typo in a source code comment
- s/defaul/default/

MFC after:	3 days
2024-05-12 10:53:40 +02:00
Warner Losh
ee2e36686e linprocfs: Really fix time_t type issue
The cast to (long) is wrong on all the other 32-bit platforms. (long
long) is the correct type on all platforms. Also, use a z modifier for
size_t which also fails on 32-bit platforms.

Fixes: 02f481a30b
Sponsored by: Netflix
2024-05-11 22:53:15 -06:00
Konstantin Belousov
6d79564fe3 devfs_allocv(): style
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-05-12 04:13:00 +03:00
Konstantin Belousov
e934040651 cdev_pager_allocate(): ensure that the cdev_pager_ops ctr is called only once
per allocated vm_object.  Otherwise, since constructors are not
idempotent, we e.g. leak device reference in case of non-managed pager.

PR:	278826
Reported by:	Austin Zhang <austin.zhang@dell.com>
Reviewed by:	alc, markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D45113
2024-05-12 04:13:00 +03:00