Commit graph

287746 commits

Author SHA1 Message Date
Konstantin Belousov bddc7a8a94 Tweak compat_freebsd32_bit feature name
Mark the current name 'compat_freebsd_32bit' as legacy, and add the
new name 'compat_freebsd32'.  This seems to help with some make and
shell uses.

Requested by:	jrtc27
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D42641
2023-11-21 13:56:15 +02:00
Konstantin Belousov 26b36a64be sysctl kern.supported_archs: return correct value
in case COMPAT_FREEBSD32 was enabled in config but hardware does not
support executing 32bit binaries.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D42641
2023-11-21 13:56:06 +02:00
Konstantin Belousov 5a2bbacea5 FEATURE compat_freebsd_32bit: only report on arm64 when support is present
depending on hardware support for aarch32.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D42641
2023-11-21 13:55:59 +02:00
Konstantin Belousov 46f3a29ee1 sys/sysctl.h: FEATURE_ADD()
A macro to dynamically register report of the kernel feature.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D42641
2023-11-21 13:55:52 +02:00
Andrew Turner 25d0310ed8 arm64: Mark the armv8 crc32c as supporting BTI
This is built into a test so needs the BTI elf note for the rest of the
test to be built with BTI support enabled.

As the assembly uses the ENTRY macro it already supports BTI, so mark
it as such.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D42595
2023-11-21 11:25:43 +00:00
Andrew Turner 1b9096cd1d arm64: Set the Guarded Page flag in the kernel
Now the kernel and modules are built with branch protection we can
enablethe Guarded Page flag in the page tables. This causes indirect
branches to a location without a correct landing pad instruction to
raise an exception.

This should help mitigate some attacks where a function pointer is
changed to point somewhere other than the start of the function,
however it doesn't stop an attacker pointing it to an unintended
function.

Reviewed by:	alc, scottph (both earlier version), markj
Sponsored by:	Arm Ltd
Sponsored by:	The FreeBSD Foundation (earlier version)
Differential Revision:	https://reviews.freebsd.org/D42080
2023-11-21 10:02:58 +00:00
Andrew Turner fd5aaf2ea0 libc: Teach libc about the BTI elf note
Add the Branch Target Identification (BTI) note to libc assembly
sources. As all obect files need the note for the library to have it
we need to insert it in all asm files.

Reviewed by:	emaste, markj
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D42228
2023-11-21 10:02:51 +00:00
Andrew Turner f3a83b3a62 arm64: Remove an old comment
This was missed when removing kern_delta

Sponsored by:	Arm Ltd
2023-11-21 09:30:45 +00:00
Warner Losh 0abe05aeac stand: bandaide for acpi
Old binaries do not set acpi.rsdp early enough. So when we boot with an
older loader.efi from an ESP that's not been updated, we assume there's
no ACPI on this system. This is unwise. Put a band-aide on this until we
can implement a proper 'feature' variable that the binary reports so we
can do conditionals for things like this in the future.

This is at best a rapid-response stop-gap.

Glanced at by: kevans
Sponsored by:		Netflix
2023-11-20 20:30:16 -07:00
Warner Losh f213da893c Makefile.inc1: Remove beri straggler
Beri's boot loader needed md5 to build. It was the only thing that
needed that, so remove it (confirmed with univers and grep).

Sponsored by:		Netflix
2023-11-20 20:30:02 -07:00
Robert Wing fb51ddb20d bhyve: increase fbuf display resolution limit
This enables connecting to the VNC server at a higher resolution.

Reviewed by:	corvink, markj
Differential Revision:	https://reviews.freebsd.org/D42620
2023-11-20 16:17:53 -09:00
Martin Matuska a2b560cc69 zfs: merge openzfs/zfs@a94860a6d
Notable upstream pull request merges:
 #15511 92dc4ad83 Consider `dnode_t` allocations in dbuf cache size accounting
 #15514 22c8c33a5 Use abd_zero_off() where applicable
 #15515 5a3bffab1 ZIO: Optimize zio_flush()
 #15527 cd67bc0ae freebsd: remove __FBSDID macro use

Obtained from:	OpenZFS
OpenZFS commit: a94860a6de
2023-11-21 01:46:00 +01:00
Brooks Davis bbde5c0725 pf: Remove __FBSDID() macro use
These are local additions that no longer make sense with the transition
to git.

This partially reverts a10f530f93.

Reviewed by:	kp, imp
Differential Revision:	https://reviews.freebsd.org/D42687
2023-11-21 00:21:11 +00:00
Brooks Davis ea2be8ed28 Remove __FBSDID from netbsd libc sources
I added them per then-current practice when I imported them, but now
they are just gratuious local diffs.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D42686
2023-11-21 00:21:11 +00:00
Brooks Davis db94e7c3f9 vis: relocate _DIAGASSERT() define
Other similar files from NetBSD define it unconditionally as a local
diff.

Reviewed by:	imp (as part of D42686)
2023-11-21 00:21:11 +00:00
Tony Hutter a94860a6de
ZTS: Fix 'could not unmount datasets' on Alma 9 (#15542)
Many tests are failing on AlmaLinux 9 because ZTS could not destroy the
pool in cleanup.  This was due to $PWD being set to '.' instead of the
expected full path.  This patch sets $PWD to the full path.

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Don Brady <don.brady@delphix.com>
2023-11-20 16:07:32 -08:00
Gleb Smirnoff bbbd7aab1b inpcb: garbage collect in_pcbnotifyall() 2023-11-20 14:38:31 -08:00
Gleb Smirnoff 367e8adb4b tests/netgraph: start ng_socket test suite
Just one check now, check node name.
2023-11-20 14:36:58 -08:00
Simon J. Gerraty 0a45a7e99f Fix share/zoneinfo for DIRDEPS_BUILD
The tranditional build makes multiple passes through the tree.
The DIRDEPS_BUILD visits each directory only once per architecture,
thus makefiles should be able to everything they need in a single pass.

The use of TZS!= when doing make(*install*)
only works if the directory has previously been visited to do zoneinfo
since before the zoneinfo target is run TZS will be empty.

To fix this, have the zoneinfo target capture the list of files to
zoneinfo, and install-zoneinfo use that list.
Rename that target to zonefiles - since that is now what it does.

This is more efficient - we only gather the list of zones when it is
likely to have changed, and allows the makefile to do everything in a
single pass.

Reviewed by:	stevek
Differential Revision:	https://reviews.freebsd.org/D42624
2023-11-20 12:52:43 -08:00
Arthur Kiyanovski fec0c3fb08 Add myself (akiyano) to calendar.freebsd
Approved by: cperciva (mentor)
2023-11-20 20:50:52 +00:00
R. Christian McDonald e0f3dc8272 loader: improve lua ACPI detection and handling
This is a follow-up patch to https://reviews.freebsd.org/D42459
that modifies the loader lua to use the correct loader variables
for determining ACPI availability.

This also fixes a bug where ACPI can be inadvertently disabled when
setting System Defaults at the loader menu.

Reviewed by:	imp, kevans
Approved by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D42483
2023-11-20 14:03:59 -05:00
R. Christian McDonald 0b01d45783 loader: fix EFI ACPI detection
lua was previously unable to determine ACPI presence because this
probing was postponed until the final loading and execution of the
kernel.

This patch resolves that by detecting ACPI early (similar to
the order of operations in the legacy i386 loader).

Reviewed by:	kevans
Approved by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D42459
2023-11-20 14:03:59 -05:00
R. Christian McDonald 34de1d507b committers-src: Add rcm as a src committer and kp as mentor
Approved by:	kp
2023-11-20 11:23:07 -05:00
Igor Ostapenko b453e3f755 pf tests: fix name and description of divert-to cases
Reflect the correct order of events for dummynet+ipdivert.
2023-11-20 12:30:18 +01:00
Igor Ostapenko 7e1affa242 pf.conf.5: revise divert-to and divert-reply 2023-11-20 12:30:18 +01:00
Konstantin Belousov 806e4e3273 ldconfig: filter out non-existing directories from default path
This is done only for ld-elf32.so.1, where /lib32 is kept in the path
due to the way STANDARD_LIBRARY_PATH is defined in rtld_paths.h.

This change fixes innocent warning appearing after
99132daf6f

Reviewed by:	dim, emaste
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D42626
2023-11-20 13:26:00 +02:00
Alvin Chen e0d0f0930e pseudofs: fix off by one in hash iteration in pfs_purge
Sponsored by:	Dell Technologies
Differential Revision:	https://reviews.freebsd.org/D42628
2023-11-20 05:57:25 +00:00
Warner Losh 1b681154f5 math: Move to const instead of __const
There's no reason to use the __const construct here. This is a left-over
from supporting K&R and ANSI compilers in the original Sun msun. All
other K&R crutches have been removed. Remove these as well. There's no
semantic difference. And there's already several others in math.h.

Sponsored by:		Netflix
2023-11-19 20:55:57 -07:00
Warner Losh 8ae4bb9398 cdefs: remove __GNUCLIKE_MATH_BUILTIN_CONSTANTS
Exp Run PR:		275123
Sponsored by:		Netflix
2023-11-19 19:36:51 -07:00
Warner Losh cc02e98a95 cdefs: Remove __GNUCLIKE_ASM
It's no longer used in the tree.

Exp Run PR:		275123
Sponsored by:		Netflix
2023-11-19 19:36:46 -07:00
Warner Losh 7b7975e032 cdefs: Remove __GNUCLIKE___TYPEOF from cdefs.h
It's been unused for quite some time, so remove it from sys/cdefs.h.

Exp Run PR:		275123
Sponsored by:		Netflix
2023-11-19 19:35:53 -07:00
Mateusz Guzik 305a2676ae vfs: dodge locking for lseek(fd, 0, SEEK_CUR)
It is very common and according to dtrace while running poudriere almost
all calls with SEEK_CUR pass 0.
2023-11-19 22:25:45 +00:00
Michael Tuexen 99c79cab42 if_tuntap: add LRO support to tap devices
This allows testing the LRO code with packetdrill in local mode.

Reviewed by:		rscheff
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D42548
2023-11-19 15:57:53 +01:00
Arthur Kiyanovski 33db883c95 Add akiyano as src committer and cperciva as mentor
Approved by: cperciva (mentor)
2023-11-19 13:54:29 +00:00
Martin Matuska 3c773cad57 cat: fallback on EISDIR with copy_file_range(2)
The filesystem may support reading directories directly
when security.bsd.allow_read_dir is set.

MFC after:	1 week
PR:		275099
2023-11-19 02:14:50 +01:00
Jamie Gritton 6000d46fc3 Move "jail -e" out of the rest of jail(8) flow. 2023-11-18 12:47:50 -08:00
John Baldwin 84f773037e bsdinstall.8: Clarify the description of ZFSBOOT_FORCE_4K_SECTORS
This variable does not set the exact sector size of the pool, but
controls the minimum sector size.  The sector size of the underlying
disks can always be larger than the minium controlled by this knob.

PR:		274513
Reported by:	Albin "a12l" Otterhäll <bugs.freebsd.org@a12l.xyz>
2023-11-18 11:45:42 -08:00
John Baldwin de82aed119 bsdinstall zfsboot: Don't override ZFSBOOT_FORCE_4K_SECTORS if it is null.
Only set a default value of 1 if the shell variable is unset.  This allows
installer scripts to disable the variable.

PR:		274513
Reported by:	Albin "a12l" Otterhäll <bugs.freebsd.org@a12l.xyz>
Differential Revision:	https://reviews.freebsd.org/D42319
2023-11-18 11:18:29 -08:00
John Baldwin 3eed4803f9 vfs mount: Consistently use ENODEV internally for an invalid fstype
Change vfs_byname_kld to always return an error value of ENODEV to
indicate an unsupported fstype leaving ENOENT to indicate errors such
as a missing mount point or invalid path.  This allows nmount(2) to
better distinguish these cases and avoid treating a missing device
node as an invalid fstype after commit 6e8272f317.

While here, change mount(2) to return EINVAL instead of ENODEV for an
invalid fstype to match nmount(2).

PR:		274600
Reviewed by:	pstef, markj
Differential Revision:	https://reviews.freebsd.org/D42327
2023-11-18 11:08:34 -08:00
Jens Schweikhardt f06fda7ff1 Spaces to tabs for consistency. No content change. 2023-11-18 16:05:22 +01:00
Jens Schweikhardt 8703e04009 Apply non-abrasive script-cleaning fluid.
* consistent use of tabs
* consistent quoting of parameters
* if/then cosmetics to match rc.subr style
2023-11-18 11:58:26 +01:00
Gordon Bergling 8c8ffe541e Add a HISTORY section for memcpy(3) and mempcpy(3)
The memcpy() function first appeared in AT&T System V UNIX and was
reimplemented for 4.3BSD-Tahoe. The mempcpy() function first appeared in
FreeBSD 13.1.

PR:	272227
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42630
2023-11-18 10:09:40 +01:00
Gordon Bergling fa9f742201 getpeerid.3: Clarify the 's' argument
The argument 's' of getpeerid(3) must be a connected UNIX-domain socket,
so document it.

PR:	248614
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D42629
2023-11-18 10:02:12 +01:00
Warner Losh 34a6ad848f nvme: Don't use version to listen for events for ns and fw changes
Instead, use the attribtue bits from the identification data to
determine if we should listen to namespace changes and firmware
activation. Should have no functional change, though we may stop
listening for events that will never happen.

Sponsored by:		Netflix
2023-11-17 21:25:57 -07:00
Warner Losh 4ac3cfa939 traceroute: Remove stray __P
Remove stray __P(). It's no longer needed, and since the whole rest of
the file lacks them, it's not very useful.

Sponsored by:		Netflix
2023-11-17 21:05:00 -07:00
Warner Losh f863f39636 pnpinfo: Remove __P
We don't need to compile on a K&R compiler (and we've long ago lost the
ability to do so). It's not even clear if it ever worked with a pure K&R
compiler, but maybe it once did...

Sponsored by:		Netflix
2023-11-17 21:04:59 -07:00
Brooks Davis 54d487c4d0 makesyscalls: don't make syscall.mk by default
We only want to produce syscall.mk for the main syscall table so default
to not producing it (send it to /dev/null) and add a syscalls.conf to
sys/kern to trigger the creation of sys/sys/syscall.mk.  This eliminates
the need for entries in other syscalls.conf files and is a cleaner
pattern going forward.

Reviewed by:	kevans, imp
Differential Revision:	https://reviews.freebsd.org/D42663
2023-11-18 00:48:14 +00:00
Kirk McKusick bde3cdf18d Spacing and alignment cleanups.
No functional change.

MFC-after: 1 week
2023-11-17 14:40:09 -08:00
Kristof Provost 7093414c63 pf: sctp heartbeats confirm a connection
When we create a new state for multihomed sctp connections (i.e.
based on INIT/INIT_ACK or ASCONF parameters) the new connection will
never see a COOKIE/COOKIE_ACK exchange. We should consider HEARTBEAT_ACK
to be a confirmation that the connection is established.

This ensures that such connections do not time out earlier than
expected.

MFC after:	1 week
Sponsored by:	Orange Business Services
2023-11-17 23:33:44 +01:00
Kristof Provost a8dbbeb1c7 pf: skip urpf check for sctp multihomed states
When we create a new state for multihomed sctp connections (i.e.
based on INIT/INIT_ACK or ASCONF parameters) we cannot know what
interfaces we'll be seeing that traffic on. These states are floating
states, i.e. on "all" interfaces. We cannot do reverse path filtering
for these states, so do not do so.

MFC after:	1 week
Sponsored by:	Orange Business Services
2023-11-17 23:33:44 +01:00