Commit graph

24511 commits

Author SHA1 Message Date
Jose Luis Duran
f9e98800af
libopencsd: Remove extra slashes
Remove extra slashes that end up in the metalog.  These double slashes
can produce an invalid specification file if there are subdirectories
down the hierarchy when sorted.

For example, consider the following metalog excerpt:

    ./base/aaa type=dir
    ./base//aaa/bbb type=dir

If sorted, would turn out:

    ./base//aaa/bbb type=dir
    ./base/aaa type=dir

Apparently missing the ./base/aaa directory in the specification.

Luckily here are no subdirectories.

Reviewed by:	imp, emaste
Approved by:	emaste (mentor)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48779

(cherry picked from commit bccaf0262dcab84be49c42cc6b7a81c279c44b62)
2025-02-12 01:33:35 +00:00
Jose Luis Duran
ac74f9a654
csu tests: Remove extra slash
Remove an extra slash that ends up in the metalog.  This double slash
can produce an invalid specification file if there are subdirectories
down the hierarchy when sorted.

For example, consider the following metalog excerpt:

    ./base/aaa type=dir
    ./base//aaa/bbb type=dir

If sorted, would turn out:

    ./base//aaa/bbb type=dir
    ./base/aaa type=dir

Apparently missing the ./base/aaa directory in the specification.

Luckily here are no subdirectories.

Reviewed by:	imp, emaste
Approved by:	emaste (mentor)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48778

(cherry picked from commit 841856570e7b623c4f1283939936ffa005d2fcf4)
2025-02-12 01:33:15 +00:00
Bjoern A. Zeeb
9bb63440a2 lib80211: regdomain: add the two other 160MHz bands
ETSI had one 160Mhz band in regdomain but the other two were missing.
Add them.  I am always confused that the bands use the center frequency
of the 20Mhz edge channels rather than the actual edges so it seems we
are only configuring 140Mhz instead of 160Mhz.

We will have to go through the entire regdomain file one
day and make sure to verify all the power levels.

Sponsored by:	The FreeSBD Foundation
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D48356

(cherry picked from commit a3a308f0f29b14d522c56dd88231e27fdf206104)
2025-02-10 14:52:12 +00:00
Mark Johnston
028323d616 setfib.2: Note that the number of FIBs can be adjusted after boot
Reviewed by:	zlei, imp
MFC after:	2 weeks
Sponsored by:	Klara, Inc.
Sponsored by:	Stormshield
Differential Revision:	https://reviews.freebsd.org/D48545

(cherry picked from commit 010ee8215f5c899e23250828402af5b7bb354328)
2025-02-07 14:46:53 +00:00
Kirk McKusick
5572827428 Defer the January 19, 2038 date limit in UFS1 filesystems to February 7, 2106
Standardize the definition of a UFS dinode

Differential Revision: https://reviews.freebsd.org/D48472

(cherry picked from commit 1111a44301da39d7b7459c784230e1405e8980f8)
(cherry picked from commit aa90fbed151de512ab6e59f75df009533a15751f)
(cherry picked from commit 256389eaf158acaf67f0530764be8af68edee78c)
(cherry picked from commit 6cd973d903c8f214d84daf91eb75047631bf1618)
(cherry picked from commit e1ebda4458bbaf7d85fb803e20f3afc5441f24d9)
2025-02-06 11:25:09 -08:00
Konstantin Belousov
40fb3c401e crtend: accurately check for the start of .ctors
(cherry picked from commit 21502f9a926c7e0c24ce230bb029fde4bf570a14)
2025-02-04 02:28:37 +02:00
Konstantin Belousov
07324ed409 crtbegin: accurately check for the end of .dtors
(cherry picked from commit 6ee34bca48a9e0867d46b24a78855e225d46ddda)
2025-02-04 02:28:37 +02:00
Konstantin Belousov
af699d9666 csu: add the "Retain" flag to notes sections flag
(cherry picked from commit 6700e2d963ff0475cc5cd444e92ce40855643084)
2025-01-30 11:12:05 +02:00
Konstantin Belousov
1a085ee973 pthread_create(): style
(cherry picked from commit 02703de8bcae3b45e6d96e8467d5fa512d62cc3d)
2025-01-21 02:24:55 +02:00
Konstantin Belousov
e2268518df libpthread_init(): ensure curthread == NULL until set explicitly
(cherry picked from commit 676be27133fa3296f3d9083732d8837a3eaa5ea4)
2025-01-21 02:24:55 +02:00
Konstantin Belousov
2050430609 libthr: switch thread and sleepq memory allocator to crt from libc malloc
(cherry picked from commit 9a2ae72421cd75c741984f63b8c9ee89346a188d)
2025-01-21 02:24:55 +02:00
Konstantin Belousov
d6a896c3c8 pthread_mutex_trylock(): init libthr if needed
(cherry picked from commit 9718f18471f700b271eb898c764e02b7fcd3766f)
2025-01-21 02:24:55 +02:00
Konstantin Belousov
0961e16b36 libthr: use atomic_add_int() instead of atomic_fetchadd_int()
(cherry picked from commit 4804cb433dbec2555695dc2bf391f286f2172621)
2025-01-21 02:24:55 +02:00
Alan Somers
3dc01440a0 Fix lib/libc/nss/getgr_test with large numbers of groups
These tests create a linked list with one entry for every group on the
running system.  On a system with about 30,000 groups, the test took 69
seconds to run, and crashed Kyua with the below error:

kyua: E: string or blob too big (sqlite op: sqlite3_bind_blob) (sqlite db: /root/.kyua/store/results.usr_tests.20241231-203317-570235.db).

Fix the test by limiting it to operating on the first 1024 groups.
Apply the same change to getpw_test and getserv_test too, which are
vulnerable to the same problem.

Sponsored by:	ConnectWise
Reviewed by:	markj
Differential Revision: https://reviews.freebsd.org/D48275

(cherry picked from commit d11904b350214943dedb64c7121d4602799d7afd)
2025-01-20 09:54:45 -07:00
Ed Maste
e2cbfa1f50 munmap.2: Remove EINVAL for negative len
len is unsigned (it is size_t), so cannot be negative.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit fab411c4fd5224e3dd44e0eb288d60b27480e2d1)
2025-01-20 09:25:14 -05:00
Ed Maste
61c5090935 munmap.2: Unaligned addresses do not return error
We previously claimed that non-page-aligned addresses would return
EINVAL, but the address is in fact rounded down to the page boundary.

Reported by:	Harald Eilertsen <haraldei@anduin.net>
Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
Fixes: dabee6fecc ("kern_descrip.c: add fdshare()/fdcopy()")
Differential Revision: https://reviews.freebsd.org/D48465

(cherry picked from commit 9e36aaf0c24cf158e83c69c1d2312c000c3c36f3)
2025-01-20 09:25:14 -05:00
Dimitry Andric
dc3f24ea8a Merge llvm-project release/19.x llvmorg-19.1.7-0-gcd708029e0b2
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/19.x llvmorg-19.1.7-0-gcd708029e0b2,
a.k.a. 19.1.7 release.

PR:		280562
MFC after:	3 days

(cherry picked from commit 6c05f3a74f30934ee60919cc97e16ec69b542b06)
2025-01-19 12:05:53 +01:00
Olivier Certner
76d0aed164
libprocstat: ZFS support: Makefile: Tidy up a bit
Regroup assignments tweaking preprocessor defines/undefs, and separately
those about include directories.

Re-order include directories a bit more logically, and remove redundant
ones.

Separate logical groups by blank lines.

Build artifacts have been verified to stay the same when produced with
an external LLVM 18 toolchain.

MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D48070

(cherry picked from commit 618c97b87b7124cdfb10d2f33a213c3302c8a98b)
2025-01-16 19:07:02 +01:00
Xin LI
e6de39be80 MFC: libmagic: Unbreak for older FreeBSD releases.
PR:		bin/273736
Reported by:	philip

(cherry picked from commit 7f8f120439b77e60a1070d87f4dc6cb9a43d0335)
2025-01-12 20:24:19 -08:00
Kyle Evans
c876932bba lib: hook libder up to the build
libder will be used in upcoming ECC support in the pkg(7) bootstrap to
read DER-encoded keys and signatures.

(cherry picked from commit f59bb61e1eb4d1e4fc3c60cc14779d0668267cb2)
2025-01-10 20:48:22 -06:00
Baptiste Daroussin
58734b1879 libusb: fix hotplug sigbus
When a hotplug callback has been registered, and the program using
libusb is calling libusb_exit then the thread handler is set to
NO_THREAD which result in the variable controlling the loop the be set
to 0, it does a last pass through device available without having done
a scan, which result in a sigbus after it tried to unregister all the
devices.

directly break the loop instead and cleanup the list of devices

this fixes the tests with LGPLed libusb's hotplugtest program

MFC After:	3 days
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D48298

(cherry picked from commit ba5834b8e11fd002a663d083a464e397e76cb3a9)
2025-01-07 10:02:57 +01:00
Dimitry Andric
589cf0f3e2 Revert "Export additional __aeabi_ symbols from arm's libgcc_s"
This reverts commit caab831338f4eeaa7455e981478be9fd414b7969, because
some new unresolved issues came up in bug 271087:

  Some programs depend on these symbols, when they are compiled for armv6
  or armv7. Closes #1560 (slightly changed due to sorting of the symbols).

PR:		271087
Reported by:	mmel
MFC after:	immediately

(cherry picked from commit b662ca1d6cd82044c6cb79075e1830b97594bef3)
2025-01-04 19:13:25 +01:00
Konstantin Belousov
85671cefd9 check_cancel: when in_sigsuspend, send SIGCANCEL unconditionally
PR:	283101

(cherry picked from commit 9f78c837d94f73f1485e2ce012a8e64197dae9d5)
2025-01-04 05:57:24 +02:00
Konstantin Belousov
2f645d539c pthread_setcancelstate(3): make it async-signal-safe
(cherry picked from commit 030f48f78f96e0cdb30c960e1a11e5ae01d0eee8)
2025-01-04 05:57:24 +02:00
Konstantin Belousov
20f173fdc7 thr_cancel.c: use testcancel() instead of manually expanding it
(cherry picked from commit a944e6d5c0c27c2a533486062497a40d8f0ae543)
2025-01-04 05:57:24 +02:00
Konstantin Belousov
60b5e18c53 libthr: move dlerror_msg into zeroed part of struct thread
(cherry picked from commit 86f6ff9ff00e2ba4d4cd5b7a94d57b1c3f85ff98)
2025-01-04 05:57:24 +02:00
Konstantin Belousov
06a8084a14 thr_sig.c: style
(cherry picked from commit e32308efa215868d98036c30f73c98ebf67e03d4)
2025-01-04 05:57:24 +02:00
Konstantin Belousov
d51ecba718 thr_cancel.c: style
(cherry picked from commit 3282e368e00460de500e5cfcf1c33b597199aaf8)
2025-01-04 05:57:24 +02:00
Dimitry Andric
f27d1ec0f5 Export additional __aeabi_ symbols from arm's libgcc_s
Some programs depend on these symbols, when they are compiled for armv6
or armv7. Closes #1560 (slightly changed due to sorting of the symbols).

PR:		271087
Reported by:	fuz
Submitted by:	jfc@mit.edu
MFC after:	1 week

(cherry picked from commit caab831338f4eeaa7455e981478be9fd414b7969)
2025-01-04 02:01:46 +01:00
Graham Percival
334e641d38 fgets.3: document gets_s() __STDC_WANT_LIB_EXT1__
This matches the man page for qsort_s().

PR:		281828
Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Sponsored by:	Tarsnap Backup Inc.

(cherry picked from commit d0a3fd34a05794bc5cbf48709001a78e9f85169a)
2024-12-27 10:48:27 -05:00
John Baldwin
66cb373c8f procctl.2: Editing pass
- Add some missing .Pp macros after the end of literal blocks and some
  lists to ensure there is a blank line before the following text.

- Use an indent of Ds for nested lists to reduce excessive indentation and
  make the bodies of the nested list items easier to read.

- Various and sundry rewordings and clarifications.

Reviewed by:	kib, emaste
Differential Revision:	https://reviews.freebsd.org/D47782

(cherry picked from commit 8277c790179304159c2e4dcb1d99552518d5be8e)
2024-12-27 10:43:26 -05:00
Graham Percival
9a15a1fef9 manuals: Misc macro typos
These were reported by `mandoc -T lint` as
    ERROR: skipping unknown macro
When these pages were rendered with `man`, the "unknown macro" meant
that the entire line was omitted from the output.

Obvious typos in:
lib/libsys/swapon.2
lib/libsys/procctl.2
share/man/man9/firmware.9

lib/libcasper/services/cap_net/cap_net.3: 'mode' describes a function
    argument.

lib/libsys/statfs.2: there's no .Tm command ("trademark?"), and
    .Tn ("tradename") is deprecated, so remove the macro entirely.

usr.sbin/mfiutil/mfiutil.8: man was interpreting '/dev/' as a macro
    (which it didn't recognize).

share/man/man4/qat.4: same issue as above, but with '0'.  In this case,
    given the context of the previous line, rewriting as "Value '0'"
    seemed more appropriate.

usr.sbin/mlx5tool/mlx5tool.8: typo in .Xr

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Sponsored by:	Tarsnap Backup Inc.
Reviewed by:	concussious, imp
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1417

(cherry picked from commit 2878d99dfcfbdd7a415a7f31cf95fbd53fc8e581)
2024-12-27 10:40:05 -05:00
Xin LI
78ab4c182b MFC: MFV: expat 2.6.4.
(cherry picked from commit 908f215e80fa482aa953c39afa6bb516f561fc00)
2024-12-21 23:45:34 -08:00
Enji Cooper
8c7e4d11fe MFC: Update the expat version referenced in libbsdxml.3
This change updates the version of expat referenced from 2.6.0 to 2.6.3,
correcting documentation post-ffd294a1f4c23863c3e515d16dce31d5509bcb01.

Bump .Dd for the change.

MFC with:	ffd294a1f4c23863c3e515d16dce31d5509bcb01
Differential Revision:	https://reviews.freebsd.org/D46865

(cherry picked from commit ba23ab2168ffabc2c5e647a1a37ab9a8fb482bb8)
2024-12-21 23:43:59 -08:00
Xin LI
71c92e6b94 MFC: MFV: file 5.46.
(cherry picked from commit ae316d1d1cffd71ab7751f94e10118777a88e027)
2024-12-21 23:37:20 -08:00
Xin LI
edf0691b19 MFC: MFV: xz 5.6.3
(cherry picked from commit 26743408e9ff53ac0e041407c359ed3c17c15596)
2024-12-21 23:32:54 -08:00
Xin LI
679e924056 MFC: MFV: xz 5.6.2.
(cherry picked from commit 3b35e7ee8de9b0260149a2b77e87a2b9c7a36244)
2024-12-21 23:32:38 -08:00
Xin LI
97cf82ebe0 Revise qsort(3) reflect POSIX.1-2024 update.
Reviewed by:	emaste, trasz
Differential Revision: https://reviews.freebsd.org/D47262

(cherry picked from commit 3df1abdfd9c309efbdc7884d6b6f6fe25efcb397)
2024-12-21 23:30:52 -08:00
Dag-Erling Smørgrav
259dcedc4a strptime: Fix day-of-week calculation.
The day-of-week calculation used the raw year value without adjusting
for TM_YEAR_BASE, so it was off by one for 300 years out of every 400;
it just happened to be correct for 1901 through 2000.  It also used a
loop where a simple addition would have sufficed.

While here, simplify our version of Gauss's algorithm, and document
that we assume the Gregorian calendar.

MFC after:	1 week
PR:		282916
Reviewed by:	imp, allanjude, philip
Differential Revision:	https://reviews.freebsd.org/D47977

(cherry picked from commit 4285e024baa80f81d13cdcc016fdf0721fe57862)
2024-12-16 10:37:08 +00:00
Maxim Konovalov
7620bade4c login.conf.5: remove a stray quote
PR:	282858
(cherry picked from commit d6917af2b9da76ac1df1977b2a3c09fb9d45db11)
2024-12-13 19:13:53 +00:00
Martin Matuska
2ec8b69480 zfs: merge openzfs/zfs@e269af1b3 (zfs-2.2-release) into stable/14
OpenZFS release 2.2.7

Notable upstream pull request merges:
 #15457 022bf8637 Increase L2ARC write rate and headroom
 #15527 1ba5b2ef8 freebsd: remove __FBSDID macro use
 #15792 9e7af55e8 Add custom debug printing for your asserts
 #15793 a1ea40af8 libzfs: use zfs_strerror() in place of strerror()
 #16181 -multiple zdb/ztest: improve and harmonise crash output
 #16208 e5e4957a5 Allow block cloning to be interrupted by a signal
 #16210 ba4e582a6 FreeBSD: Add const qualifier to members of struct
                  opensolaris_utsname
 #16225 a6198f34b Simplify issig()
 #16335 25ec9a903 zdb: fix BRT dump
 #16364 cf80a803d zvol: ensure device minors are properly cleaned up
 #16404 384b53be8 FreeBSD: Add missing memory reclamation accounting
 #16492 -multiple Split "shared" userspace & kernel code into separate files
 #16496 f1694496a zfs_file: rename zfs_file_fallocate to zfs_file_deallocate
 #16511 bc0d89bfc Fix an uninitialized data access
 #16529 2dc8529d9 Fix handling of DNS names with '-' in them for sharenfs
 #16539 30ea44296 zfs_log: add flex array fields to log record structs
 #16546 098789216 Evicting too many bytes from MFU metadata
 #16551 54278533a Reduce and handle EAGAIN errors on AIO label reads
 #16554 84ad1d536 FreeBSD: restore zfs_znode_update_vfs()
 #16565 21c40e6d9 FreeBSD: Sync taskq_cancel_id() returns with Linux
 #16567 48482bb2f Properly release key in spa_keystore_dsl_key_hold_dd()
 #16584 e8f4592a1 Avoid computing strlen() inside loops
 #16605 acc8a3186 ARC: Cache arc_c value during arc_evict()
 #16650 fc60e0c6e freebsd: Use compiler.h from FreeBSD's base's linuxkpi
 #16667 b32b35cea zdb: show bp in uberblock dump
 #16684 1f5e1b919 Pack dmu_buf_impl_t by 16 bytes
 #16688 73b3e8ace Fix gcc uninitialized warning in FreeBSD zio_crypt.c
 #16690 727506c94 On the first vdev open ignore impossible ashift hints
 #16692 d83cd5307 zdb: add extra -T flag to show histograms of BRT refcounts
 #16693 82ab837a0 Fix gcc unused value warning in FreeBSD simd.h
 #16740 2bba6e3c5 BRT: Don't call brt_pending_remove() on holes/embedded
 #16801 299da6ace Fix race in libzfs_run_process_impl

Obtained from:	OpenZFS
OpenZFS commit: e269af1b3c
OpenZFS tag:	zfs-2.2.7
2024-12-12 13:22:56 +01:00
Dimitry Andric
4db4ed3680 Merge llvm-project release/19.x llvmorg-19.1.5-0-gab4b5a2db582
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/19.x llvmorg-19.1.5-0-gab4b5a2db582,
a.k.a. 19.1.5 release.

PR:		280562
MFC after:	3 days

(cherry picked from commit 71ac745d76c3ba442e753daff1870893f272b29d)
2024-12-11 09:16:53 +01:00
Ed Maste
f2c09b4f32 cap_rights_is_empty: add MLINK
Fixes: a7100ae23aca ("capsicum: introduce cap_rights_is_empty Function")
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 3505e0d6675b332c154e01110456d767e222c5d6)
2024-12-06 10:50:31 -05:00
shodanshok
299da6ace3 Fix race in libzfs_run_process_impl
When replacing a disk, a child process is forked to run a script called
zfs_prepare_disk (which can be useful for disk firmware update or health
check). The parent than calls waitpid and checks the child error/status
code.

However, the _reap_children thread (created from zed_exec_process to
manage zedlets) also waits for all children with the same PGID and can
stole the signal, causing the replace operation to be aborted.

As waitpid returns -1, the parent incorrectly assume that the child
process had an error or was killed. This, in turn, leaves the newly
added disk in REMOVED or UNAVAIL status rather than completing the
replace process.

This patch changes the PGID of the child process execuing the
prepare script, shielding it from the _reap_children thread.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by:  Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Gionatan Danti <g.danti@assyoma.it>
Closes #16801
2024-12-04 14:12:39 -08:00
Ed Maste
25caac4d45 sched_getcpu: Add man page
Moved from libsys to libc for stable/14.

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47556

(cherry picked from commit 36887e04947fedfebb9b648fadd0dd6cc03142ea)
2024-12-04 13:32:58 -05:00
Mark Johnston
da44138dc2 unix: Add support for atomically setting the socket mode
With this patch, it is possible to call fchmod() on a unix socket prior
to binding it to the filesystem namespace, so that the mode is set
atomically.  Without this, one has to call chmod() after bind(), leaving
a window where threads can connect to the socket with the default mode.
After bind(), fchmod() reverts to failing with EINVAL.

This interface is copied from Linux.

The behaviour of fstat() is unmodified, i.e., it continues to return the
mode as set by soo_stat().

PR:		282393
Reviewed by:	kib
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D47361

(cherry picked from commit bfd03046d18776ea70785ca1ef36dfc60822de3b)
2024-12-03 01:03:26 +00:00
Konstantin Belousov
9fb5c02356 fileno(3): set errno when returning -1
PR:	283014

(cherry picked from commit 7cd756ff4fe7e65a9a3f588904998bf6f4b37623)
2024-12-03 02:39:22 +02:00
Konstantin Belousov
fb0014d04e stdio(3): correct summary information for fileno(3)
(cherry picked from commit 35ac34a23bc0e54eb2a2314b906c6e7769dee7f0)
2024-12-03 02:39:22 +02:00
Dimitry Andric
f7fa6bf9e7 Merge llvm-project release/19.x llvmorg-19.1.4-0-gaadaa00de76e
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/19.x llvmorg-19.1.4-0-gaadaa00de76e,
a.k.a. 19.1.4 release.

PR:		280562
MFC after:	1 month

(cherry picked from commit 415efcecd8b80f68e76376ef2b854cb6f5c84b5a)
2024-12-01 12:17:17 +01:00
Dimitry Andric
2105db3863 Merge llvm-project release/19.x llvmorg-19.1.3-0-gab51eccf88f5
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/19.x llvmorg-19.1.3-0-gab51eccf88f5,
a.k.a. 19.1.3 release.

PR:		280562
MFC after:	1 month

(cherry picked from commit d686ce931cab72612a9e1ada9fe99d65e11a32a3)
2024-12-01 12:17:17 +01:00