Commit Graph

284114 Commits

Author SHA1 Message Date
Dmitry Chagin
07c0b6e535 vfs: Retire kern_alternate_path() as unused anymore
From now a non-native ABI should use pwd_altroot() ability to tell
to the namei() its root directory to dynamically reroots lookups.

Differential Revision:	https://reviews.freebsd.org/D40093
MFC after:		2 month
2023-05-29 11:19:41 +03:00
Dmitry Chagin
c4299cec48 linux(4): Make linux_emul_path private
There is no need to refer to linux_emul_path from outside anymore.

MFC after:		2 month
2023-05-29 11:19:08 +03:00
Dmitry Chagin
a482fffc7e linprocfs: Rework according to the new ABI altroot facility
By 3d2fec7d the ABI prefix path added to the struct pwd.
Use it in the mounts, mountinfo filler functions.

Differential revision:	https://reviews.freebsd.org/D39438
MFC after:		2 month
2023-05-29 11:18:37 +03:00
Dmitry Chagin
d706d02edb sysentvec: Retire sv_imgact_try as unneeded anymore
The sysentvec sv_imgact_try was used by kern_exec() to allow
non-native ABI to fixup shell path according to ABI root directory.
Since the non-native ABI can now specify its root directory directly
to namei() via pwd_altroot() call this facility is not needed anymore.

Differential Revision:	https://reviews.freebsd.org/D40092
MFC after:		2 month
2023-05-29 11:18:11 +03:00
Dmitry Chagin
57578deac7 Brandinfo: Retire emul_path as unneeded anymore
The Barndinfo emul_path was used by the Elf image activator to fixup
interpreter file name according to ABI root directory. Since the
non-native ABI can now specify its root directory directly to namei()
via pwd_altroot() call this facility is not needed anymore.

Differential Revision:	https://reviews.freebsd.org/D40091
MFC after:		2 month
2023-05-29 11:17:28 +03:00
Dmitry Chagin
fd745e1db6 linux(4): Use pwd_altroot() to tell namei() about ABI root path
PR:			72920
Differential Revision:	https://reviews.freebsd.org/D40090
MFC after:		2 month
2023-05-29 11:16:46 +03:00
Dmitry Chagin
3d2fec7db8 namei: Add the abilty for the ABI to specify an alternate root path
For now a non-native ABI (i.e., Linux) uses the kern_alternate_path()
facility to dynamically reroot lookups. First, an attempt is made to
lookup the file in /compat/linux/original-path. If that fails, the
lookup is done in /original-path. Thats requires a bit of code in
every ABI syscall implementation where path name translation is needed.
Also our kern_alternate_path() does not properly lookups absolute symlinks
in second attempt, i.e., does not append /compat/linux part to the resolved
link.
The change is intended to avoid this by specifiyng the ABI root directory
for namei(), using one call to pwd_altroot() during exec-time into the ABI.
In that case namei() will dynamically reroot lookups as mentioned above.

PR:			72920
Reviewed by:		kib
Differential revision:	https://reviews.freebsd.org/D38933
MFC after:		2 month
2023-05-29 11:15:28 +03:00
Dmitry Chagin
723e25f128 avx_sig: Print statistics by interval enstead of by pressing ^T
Reviewed by:		kib
Differential Revision:	https://reviews.freebsd.org/D40311
2023-05-29 11:09:17 +03:00
Dmitry Chagin
0a09cfb3f7 avx_sig: Avoid libbsd dependency for modern Glibc
Due to arc4random functions are povided by Glibc 2.36.

Reviewed by:		kib
Differential Revision:	https://reviews.freebsd.org/D40310
2023-05-29 11:08:35 +03:00
Kirk McKusick
b796bfce48 Fix a bug in fsck_ffs(8) triggered by corrupted filesystems.
Check for valid block numbers while loading journal entries that
contain block numbers. If an invalid block number is found, fall
back to full fsck.

Reported-by:  Robert Morris
PR:           271383
MFC-after:    1 week
Sponsored-by: The FreeBSD Foundation
2023-05-28 15:23:37 -07:00
Kyle Evans
9ed4ec4ae3 stand: libefi: avoid a null pointer deref in eficom
We don't keep comc_port around anymore if the console's not present, but
some things might still try to set one of the environment variables we
hook.  In particular, one need not even set efi_com_port/efi_com_speed
in loader.conf; loader may do it itself and induce the crash if ConOut
depicts an available uart.

Probably reported by:	dch
OK for now:	imp
2023-05-28 13:54:50 -05:00
Rick Macklem
697727110b gssd: Improve failure message when running in a jail
If a jail is not correctly configured to run nfsd(8)
in the jail, gssd(8) cannot run.
This patch improves the failure message for this case.

MFC after:	2 weeks
2023-05-28 11:08:38 -07:00
Kyle Evans
e15da6b10a libc: locale: fix collation file size validation
At a minimum, we need enough for the colllation format version string +
locale definition version string and a full collate_info definition,
rather than just the first two and a pointer.

Sponsored by:	Klara, Inc.
2023-05-28 12:54:24 -05:00
Cy Schubert
402cee1f19 sqlite3: Vendor import of sqlite3 3.42.0
Release notes at https://www.sqlite.org/releaselog/3_42_0.html.

Obtained from:  https://www.sqlite.org/2023/sqlite-autoconf-3420000.tar.gz

Merge commit '92b2b066353ddd32e1d59f8c52c430d552d9a9a5' into sqlite3/main
2023-05-28 07:31:36 -07:00
Cy Schubert
92b2b06635 sqlite3: Vendor import of sqlite3 3.42.0
Release notes at https://www.sqlite.org/releaselog/3_42_0.html.

Obtained from:  https://www.sqlite.org/2023/sqlite-autoconf-3420000.tar.gz
2023-05-28 07:07:30 -07:00
Dmitry Chagin
78c2e58fa5 linux(4): Fix stack unwinding across signal frame on x86_64
Get rid of using register numbers which is undefined in libunwind
on x86_64.

Differential Revision:	https://reviews.freebsd.org/D40156
MFC after:		1 month
2023-05-28 17:07:28 +03:00
Dmitry Chagin
037b60fb0f linux(4): Preserve %rcx (return address) like a Linux do
Perhaps, this does not makes much sense as destroyng %rcx declared by
the x86_64 Linux syscall ABI. However,:
a) if we get a signal while we are in the kernel, we should restore
   tf_rcx when preparing machine context for signal handlers.
b) the Linux world is strange, someone can depend on %rcx value
   after syscall, something like go.

Differential Revision:	https://reviews.freebsd.org/D40155
MFC after:		1 month
2023-05-28 17:06:47 +03:00
Dmitry Chagin
185bd9fa30 linux(4): Simplify %r10 restoring on amd64
Restore %r10 at system call entry to avoid doing this multiply times.

Differential Revision:	https://reviews.freebsd.org/D40154
MFC after:		1 month
2023-05-28 17:06:23 +03:00
Dmitry Chagin
a463dd8108 linux(4): Add a comment explaining registers at syscall entry point on amd64
Differential Revision:	https://reviews.freebsd.org/D40153
MFC after:		1 month
2023-05-28 17:06:05 +03:00
Dmitry Chagin
a99b890ecd linux(4): Drop a weird comment from linux_set_syscall_retval on amd64
I agree, it would be great to avoid PCB_FULL_IRET, however we should
follow Linux system call ABI.

Reviewed by:		emaste
Differential Revision:	https://reviews.freebsd.org/D40152
MFC after:		1 month
2023-05-28 17:05:44 +03:00
Enji Cooper
27234ad699 Fix the build post-dcf5d5603b3af8
I didn't compile test the prior code before committing.

MFC after:	1 week
MFC with:	dcf5d5603b
2023-05-27 19:18:43 -07:00
Kirk McKusick
101a9ac071 Fix a bug in fsck_ffs(8) triggered by corrupted filesystems.
Check for valid file size before processing journal entries for it.
Done by extracting the file size check from pass1.c into chkfilesize()
then using it in the journal code in suj.c

Reported-by:  Robert Morris
PR:           271378
MFC-after:    1 week
Sponsored-by: The FreeBSD Foundation
2023-05-27 17:12:30 -07:00
Enji Cooper
dcf5d5603b Reduce ifdef soup by adding pre-3.0 compat support
This change creates a static inline function, BN_check_prime, for
pre-3.0 use which is implemented with the previous (1.1) compatible call
under the covers, `BN_is_prime_ex`.

The `nchecks` parameter value is maintained, even though it has no
noticable behavior change, given that the documentation clearly states
that at least 64 or 128 rounds are executed on the backend, depending on
how many bits there are in the given number being factored out.

MFC after:	1 week
Differential Revision:	 https://reviews.freebsd.org/D40305
2023-05-27 17:05:39 -07:00
Kirk McKusick
11ce203e05 Fix a bug in fsck_ffs(8) triggered by corrupted filesystems.
The last valid inode in the filesystem is maxino - 1, not maxino.
Thus validity checks should ino < maxino, not ino <= maxino.

Reported-by:  Robert Morris
PR:           271312
MFC-after:    1 week
Sponsored-by: The FreeBSD Foundation
2023-05-27 16:07:09 -07:00
Kirk McKusick
c79a141695 Updates to UFS/FFS superblock integrity checks when reading a superblock.
Verify that the summary information does not extend past the end
of the filesystem.

No legitimate superblocks should fail as a result of these changes.

Reported-by:  Robert Morris
PR:           271351
MFC-after:    1 week
Sponsored-by: The FreeBSD Foundation
2023-05-27 12:24:11 -07:00
Enji Cooper
537cd76643 factor: support OpenSSL 3
This change ports the BN APIs to an OpenSSL 3 compatible set of APIs.

This removes the need for requesting OpenSSL 1.1 compatible APIs.

MFC after:	1 week
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D40298
2023-05-27 11:11:44 -07:00
Enji Cooper
c60be9ea6b Add simple factor/primes regression tests
This will help ensure that the change following this
one to support OpenSSL 3 is sane.

MFC after:	1 week
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D40297
2023-05-27 11:11:44 -07:00
John Reimer
b498331b03 netgdb: Fix netgdb double ack, print proxy address
- Fixes netgdb's double ack
- Moving ack responsibility to debugnet, decision to ack made by netdump/netgdb.
- Finish responsibility moved to debugnet, new finish handler.
- netgdb now prints the address to connect to in case the user doesn't have
  access to the proxy machine.

Sponsored by:	Dell EMC
Reviewed By:	markj, bdrewery (earlier version)
Differential Revision:	https://reviews.freebsd.org/D40064
2023-05-27 09:34:17 -07:00
Dimitry Andric
1f571f8767 Apply libc++ fix for compiling <type_traits> with clang 16
Merge commit 0e7971154ecb from llvm-project (by Christopher Di Bella):

  [libcxx][NFC] utilises compiler builtins for unary transform type-traits

  Depends on D116203

  Reviewed By: #libc, philnik

  Differential Revision: https://reviews.llvm.org/D131732

Clang 16 got new builtins that are equivalent to hand-written parts of
<type_traits>. When building world with the devel/llvm16 package
installed and CROSS_TOOLCHAIN=llvm16 set, this would lead to -Werror
warnings about those builtins being overridden.

Reported by:	emaste
MFC after:	3 days
2023-05-27 18:19:37 +02:00
Joseph Mingrone
270d20ce91
libpcap: Update PACKAGE_STRING to 1.10.4
Reviewed by:	emaste
Fixes:		6f9cba8f8b (libpcap: Update to 1.10.3)
Fixes:		dd744a896b (libpcap: Update to 1.10.4)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40295
2023-05-27 12:38:38 -03:00
Alexander V. Chernikov
c90901245e netlink: update rta_multipath conditions in arp/ndp after 656a39c1a0 2023-05-27 13:25:16 +00:00
Alexander V. Chernikov
30376771fc netlink: fix build 2023-05-27 12:29:14 +00:00
Alexander V. Chernikov
7ee6b0f125 netlink: add snl(3) support for listing genetlink multicast groups
Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D40282
MFC after:	2 weeks
2023-05-27 11:13:14 +00:00
Alexander V. Chernikov
656a39c1a0 netlink: use newly-added snl(3) array parsing for handling multipath
routes.

MFC after:	2 weeks
2023-05-27 11:13:14 +00:00
Alexander V. Chernikov
5f19f790b3 netlink: add snl(3) support for parsing unknown-size arrays
Reviewed by:	bapt
Differential Review: https://reviews.freebsd.org/D40282
MFC after:	2 weeks
2023-05-27 11:13:14 +00:00
Alexander V. Chernikov
99ea21744b netlink: fix bulding with NOINET6 2023-05-27 10:46:25 +00:00
Alexander V. Chernikov
dfc15e761b netlink: call IPv6 hook after the ifaddr operation when ifp is brought
up.

This change fixes the case when the first address added to the interface
 is IPv6 GU address. Before the change, IPv6 LL addition was not
triggered.

PR: 271661
MFC after:	2 weeks
2023-05-27 10:38:32 +00:00
Peter Holm
750ae32b9e stress2: Initialize variable 2023-05-27 10:34:48 +02:00
Peter Holm
273a89bb14 stress2: Tune to get more slightly broken file systems 2023-05-27 10:31:44 +02:00
Peter Holm
acfb06062a stress2: Fix warnings 2023-05-27 10:31:00 +02:00
Alan Cox
5d1ee799de arm64 pmap: Eliminate an unused global variable
The global variable "pmap_last_pa" was copied from the amd64 pmap as a
part of commit c15085278c "arm64 pmap: implement per-superpage locks"
but it is neither used nor needed by the arm64 pmap.
2023-05-27 01:38:20 -05:00
Kirk McKusick
49943856eb Do not try to adjust a directory depth when its reconnection is declined.
MFC after:    1 week
Sponsored by: The FreeBSD Foundation
2023-05-26 22:55:11 -07:00
Kirk McKusick
03a8680202 Correct two bugs in fsck_ffs(8) triggered by corrupted filesystems.
Always create a directory inode structure when a directory inode is
found in Pass 1 as it is not known whether it will be saved or removed
in later passes. If it is to be saved the directory inode structure
is needed to track its status and fsck_ffs(8) will segment fault if
it does not exist.

Reported-by:  Robert Morris
PR:           271310
PR:           271354
MFC-after:    1 week
Sponsored-by: The FreeBSD Foundation
2023-05-26 22:43:21 -07:00
Enji Cooper
52b63df9b6 dumpon: provide diag info when PEM_read_RSA_PUBKEY fails
This change modifies dumpon to print out the last error from OpenSSL
when `PEM_read_RSA_PUBKEY` fails. This allows end-users to diagnose why
reading in RSA pubkey files fails so they can adjust the usage to meet
the needs of the command.

MFC after:	1 week
2023-05-26 18:05:04 -07:00
Mark Johnston
da8c3d2149 tests: Fix format strings
Reported by:	Jenkins
Fixes:		844942888f ("tests: Add a simple regression test for ptrace(PT_SC_REMOTE)")
2023-05-26 17:38:06 -04:00
Mark Johnston
ca4c785900 nexus: Consistently return a pointer in failure paths
No functional change intended.

MFC after:	1 week
2023-05-26 15:38:08 -04:00
Mark Johnston
44866dfb44 bitset: Remove BITSET_FOREACH_ADVANCE
__BITSET_FOREACH_ADVANCE is a helper macro for
__BITSET_FOREACH_IS(SET|CLR) and wasn't meant to be used directly by
consumers.

While here, fix some whitespace and move a comment back to where it
belongs.

Fixes:	5e04571cf3 ("sys/bitset.h: reduce visibility of BIT_* macros")
MFC after:	1 week
2023-05-26 15:38:08 -04:00
Mark Johnston
e96ed17746 top: Use a cpuset_t to represent a CPU mask
The code attempts to detect holes in the CPU ID space, but previously
this would only work for up to sizeof(long)*8 CPUs.

MFC after:	2 weeks
2023-05-26 15:38:08 -04:00
Mark Johnston
14c5cf3a16 makefs/zfs: Avoid generating a GUID of zero 2023-05-26 15:38:08 -04:00
Mark Johnston
844942888f tests: Add a simple regression test for ptrace(PT_SC_REMOTE)
MFC after:	1 week
2023-05-26 15:38:08 -04:00