Commit graph

291797 commits

Author SHA1 Message Date
Andrew Turner 06db20ffec rtld: Add MD_OBJ_ENTRY to extend Struct_Obj_Entry
Add a macro the architectures can use to add per-arch fields to
Struct_Obj_Entry.

Reviewed by:	kib
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45116
2024-05-17 09:36:08 +00:00
Emmanuel Vadot a7b222db12 linuxkpi: rwlock: Fix rwlock_init
Some linux code re-init some spinlock so add MTX_NEW to mtx_init.

Reported by:    rlibby
Fixes:          5c0a192348 ("linuxkpi: rwlock: Simplify code")
2024-05-17 07:59:02 +02:00
Emmanuel Vadot cff79fd026 linuxkpi: Fix spin_lock_init
Some linux code re-init some spinlock so add MTX_NEW to mtx_init.

Reported by:	David Wolfskill <david@catwhisker.org>
Fixes:		ae38a1a1bf ("linuxkpi: spinlock: Simplify code")
2024-05-17 07:58:59 +02:00
John Baldwin 75529910f7 Trim a spurious trailing backslash
Reported by:	dim
Fixes:		1687d77197 man filesystems: move driver pages to section four
2024-05-16 12:29:40 -07:00
Dimitry Andric fcfb2d6393 Merge commit 87f3407856e6 from llvm-project (by Phoebe Wang):
[X86][Driver] Do not add `-evex512` for `-march=native` when the target doesn't support AVX512 (#91694)

This prevents problems with ports that fail to build with
CPUTYPE=native, if the native CPU supports AVX512F, resulting in errors
like:

  /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:197:21: error: always_inline function '_mm512_set1_epi8' requires target feature 'evex512', but would be inlined into function 'adler32_x86_avx512_vl512_vnni' that is compiled without support for 'evex512'
    197 |         const vec_t ones = VSET1_8(1);
        |                            ^
  /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:116:23: note: expanded from macro 'VSET1_8'
    116 | #  define VSET1_8(a)            _mm512_set1_epi8(a)
        |                                 ^
  /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:197:21: error: AVX vector return of type '__m512i' (vector of 8 'long long' values) without 'evex512' enabled changes the ABI
  /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:116:23: note: expanded from macro 'VSET1_8'
    116 | #  define VSET1_8(a)            _mm512_set1_epi8(a)
        |                                 ^

Ports known to be affected are: archivers/libdeflate, devel/highway,
www/node20, and lang/rust.

(For rust itself there is also a similar issue reported at
https://github.com/rust-lang/rust/pull/121088).

PR:		276104
Reported by:	netchild
MFC after:	3 days
2024-05-16 20:41:45 +02:00
Mariusz Zaborski 3cb6c6c9ee libcapsicum: document return values
Reviewed by:	emaste
Requested by:	des
Differential Revision:	https://reviews.freebsd.org/D45222
2024-05-16 20:29:18 +02:00
Konstantin Belousov 87a1565275 SysV IPC: provide in-kernel helpers to obtain ipcs(8)-like information
PR:	278949
Reviewed by:	markj
Tested by:	Ricardo Branco <rbranco@suse.de>
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D45175
2024-05-16 20:53:31 +03:00
Konstantin Belousov 53725168e1 SysV SHM: move SHMSEG constants to sys/shm.h
There are planned consumers in linprocfs.

Tested by:	Ricardo Branco <rbranco@suse.de>
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D45175
2024-05-16 20:53:31 +03:00
Austin Shafer 28a59100b5 linuxkpi: Provide a non-NULL value for THIS_MODULE
THIS_MODULE is used to differentiate modules on Linux. We currently
completely stub out any Linux struct module usage, but THIS_MODULE
is still used to populate the "owner" fields of various drivers.
Even though we don't actually dereference these "owner" fields they
are still used by drivers to check if devices/dmabufs/etc come
from different modules. For example, during DRM GEM import some
drivers check if the dmabuf's owner matches the dev's owner. If
they match because they are both NULL drivers may incorrectly think
two resources come from the same module.

This adds a general purpose __this_linker_file which will point to
the linker file of the module that uses it. We can then use that
pointer to have a valid value for THIS_MODULE.

Reviewed by:	bz, jhb
Differential Revision:	https://reviews.freebsd.org/D44306
2024-05-16 10:36:36 -07:00
Ed Maste 65fd76b5f5 makeman: extend duplicate option warning to OPT_ options
In a local tree I accidentally had OPT_INIT_ALL defaulting to zero in
userland and none in kernel.  This resulted in the INIT_ALL text
appearing twice in src.conf.5.

Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45184
2024-05-16 13:30:37 -04:00
Pierre Pronchery f38117359a ctladm: fix resource leak
The str variable in cctl_nvlist_end_element() does not get free()'d when
converted to an integer value. (name is "trtype")

Reported by:	Coverity Scan
Coverity ID:	1545039
Sponsored by:	The FreeBSD Foundation

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1237
2024-05-16 11:22:48 -06:00
Pierre Pronchery 1787871a66 bhyve: avoid resource leak
In bhyve_parse_config_option(), a string is allocated and passed to
nvlist_add_string() but not free'd afterwards.

Reported by:	Coverity
CID:		1544049
Sponsored by:	The FreeBSD Foundation

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1234
2024-05-16 11:19:33 -06:00
Lexi Winter 304a03275a sys/modules/dpdk_lpm4: do not build without INET
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1236
2024-05-16 11:16:29 -06:00
Lexi Winter ae9c0ba8ef netstat(8): for -W, use IFNAMSIZ
If -W is specified, use IFNAMSIZ as the width of the Netif column,
instead of the default 12.

Reviewed by: imp,zlei,Mina Galić
Pull Request: https://github.com/freebsd/freebsd-src/pull/1223
2024-05-16 11:07:34 -06:00
Lexi Winter d33b87e8cf netstat(1): increase width of Netif column
The previous width of Netif (10 or 8) was too short for modern interface
names; make it 12, which is long enough to display "epair0a.1000".

This came up in practice with genet(4) interfaces, since the base
interface name is long enough that with the previous limit, VLAN
identifiers would be truncated at 1 character in the IPv6 output:
"genet0.100" becomes "genet0.1".

The width is now fixed, and doesn't depend on the address family,
because there's no reason that length of the interface name would vary
based on the AF.

Reviewed by: imp,zlei,Mina Galić
Pull Request: https://github.com/freebsd/freebsd-src/pull/1223
2024-05-16 11:07:34 -06:00
Alexander Ziaee 1a720cbec5 man filesystems: fix xrefs after move to section 4
Reviewed by: des, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1077
2024-05-16 10:25:29 -06:00
Alexander Ziaee a03e8a40d4 man filesystems: ObsoleteFiles after move to sec 4
Reported by: imp
Reviewed by: des, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1077
2024-05-16 10:25:13 -06:00
Alexander Ziaee 1687d77197 man filesystems: move driver pages to section four
Filesystem manual pages describe drivers, not formats;
except for fs, which describes the structures of ffs/ufs,
not how to use it in the system.

Reported by: emaste
Reviewed by: des, imp, meena (previous version)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1077
2024-05-16 10:24:40 -06:00
Alfonso S. Siciliano a6d8be451f
contrib/bsddialog: Import version 1.0.2
Implicitly import also 1.0.1, both versions are for fixing and
feature requests.

Fixing:
Change --mixedform behavior to fix a bsdinstall fault avoiding
to change the command line in wlanconfig.

Feature requests:
 * Add keys to navigate menus.
 * Add key to redraw dialogs.
 * Avoid to handle env NCURSES_NO_UTF8_ACS in PuTTY.

See '2024-04-11 Version 1.0.2' and '2023-11-16 Version 1.0.1' in
/usr/src/contrib/bsddialog/CHANGELOG for more detailed information.

PR:			274472
Differential Revision:	D42380

Merge commit 'be8846bd9e069f4a6bea3d769005bea96cf43990'
2024-05-16 15:32:56 +02:00
Alfonso S. Siciliano be8846bd9e
contrib/bsddialog: Import version 1.0.2
Implicitly import also 1.0.1, both versions are for fixing and
feature requests.

Fixing:
Change --mixedform behavior to fix a bsdinstall fault avoiding
to change the command line in wlanconfig.

Feature requests:
 * Add keys to navigate menus.
 * Add key to redraw dialogs.
 * Avoid to handle env NCURSES_NO_UTF8_ACS in PuTTY.

See '2024-04-11 Version 1.0.2' and '2023-11-16 Version 1.0.1' in
/usr/src/contrib/bsddialog/CHANGELOG for more detailed information.

PR:			274472
Differential Revision:	D42380
2024-05-16 15:24:49 +02:00
Emmanuel Vadot abb1a1340e linuxkpi: refcount: Use atomic_t directly
Simply use a typedef for refcount_t on atomic_t, this allow us
to use a nativ type and also changing struct kref to directly use
a refcount_t like Linux.

Reviewed by:		bz
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D45207
2024-05-16 09:40:46 +02:00
Emmanuel Vadot 5c0a192348 linuxkpi: rwlock: Simplify code
Just use a typedef for rwlock_t, no need to create a useless
structure.

Reviewed by:		bz
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D45206
2024-05-16 09:40:03 +02:00
Emmanuel Vadot ae38a1a1bf linuxkpi: spinlock: Simplify code
Just use a typedef for spinlock_t, no need to create a useless
structure.

Reviewed by:		bz, emaste
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D45205
2024-05-16 09:39:36 +02:00
Konstantin Belousov 21ccdb4119 vfs_domount_update(): postpone setting MNT_UNION until VFS_MOUNT() is done
The file system that handles updating the mount point might do lookups
during the update, in which case it could find the flag MNT_UNION set on
the mp while mount point is still not updated.  In particular, the
rootvp->v_mount->mnt_vnodecovered is not yet set.

Delay setting MNT_UNION until the mount is performed.

PR:	265311
Reported by:	Robert Morris <rtm@lcs.mit.edu>
Reviewed by:	mckusick, olce
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D45208
2024-05-16 04:00:26 +03:00
Konstantin Belousov 5a061a38cd vfs_domount_update(): style, use space instead of tab
Noted by:	mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2024-05-16 04:00:26 +03:00
Mitchell Horne d7adf3b47a riscv: fix L0 PTE setup (Sv48)
Per the Privilege Spec, the Accessed (A) or Dirty (D) bits must only be
set for a leaf PTE.

It seems newer versions of QEMU have started to enforce this
requirement, and without this change, pmap_bootstrap() hangs when
switching to Sv48 mode.

Reviewed by:	jrtc27, markj
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D45210
2024-05-15 14:07:33 -03:00
Jessica Clarke fc59fc3c1f uart: Honour clock-frequency in FDT for UART_FDT_CLASS if present
The StarFive VisionFive 2 has a Synopsys DesignWare ABP UART, whose
driver uses UART_FDT_CLASS rather than UART_FDT_CLASS_AND_DEVICE as it
has its own separate newbus driver. This UART is driven by a 24MHz clock
as specified in the FDT, but we don't currently look at the property
here, instead passing down 0 and letting the default value be used in
the 8250 driver (~1.8MHz). As a result the divisor is misconfigured for
the current baud rate for the entire kernel boot process. Once the
newbus driver attaches the correct frequency is saved in the softc, but
that does not take effect until the next time ns8250_param is called and
the divisor is recalculated, namely when userspace runs and /dev/console
is opened (note that ns8250_init does not get called when the newbus
device corresponding to the current console attaches).

Fix this issue by attemmpting to get the current clock frequency as for
the UART_FDT_CLASS_AND_DEVICE_CASE, but falling back to 0 rather than
failing on error.

Reviewed by:	imp, mhorne
Differential Revision:	https://reviews.freebsd.org/D45159
2024-05-15 16:53:33 +01:00
Joseph Mingrone ea3751fb53
freebsd-tips: Tweak fortune to find font providing Unicode character
While here, remove my name and email address.

Reported by:	bapt
Sponsored by:	The FreeBSD Foundation
2024-05-15 11:34:39 -03:00
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