Commit graph

288189 commits

Author SHA1 Message Date
Ed Maste
dbf34bbb18 cat: fix cap_rights_init usage
Capability rights passed to cap_rights_* are not simple bitmaks and
cannot be ORed together in general (although it will work for certain
subsets of rights).

PR:		277057
Reported by:	asomers, markj

(cherry picked from commit 05f530f4d2)
2024-03-22 09:30:32 -04:00
Mariusz Zaborski
5f527dbe41 cat: add CAP_SEEK capability
The copy_file_range might require that.

Reviewed by:	emaste, theraven, kib, markj
Differential Revision:	https://reviews.freebsd.org/D41967

(cherry picked from commit 64c6327738)
2024-03-22 09:30:32 -04:00
Ed Maste
b5ae8f2171 ccdconfig: remove obsolete references to BSD disklabels
ccd(4) previoulsy had knowledge of BSD disklabels, and relied on their
use on the underlying disks, but this hasn't been the case since 2003
(commit 0f76d6d822).

Remove disklabel references from the man page.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43574

(cherry picked from commit a3ed434a69)
2024-03-22 09:30:31 -04:00
Ed Maste
269bc49fba style.lua.9: remove mention of $FreeBSD$
Also restore a comment line in an example which previously started with
-- $FreeBSD$ but was removed in 6ef644f588.  The example shows the of
a module require statement block following the license header.

(cherry picked from commit f1bd7311fb)
2024-03-22 09:30:31 -04:00
Christopher Davidson
144abdaa2b wlan(4) - remove an(4) reference
Fixes: 663b174b5b ("an: Remove driver")
Pull request: https://github.com/freebsd/freebsd-src/pull/1120

(cherry picked from commit bbd29c4394)
2024-03-22 09:30:31 -04:00
Ed Maste
466e0dc5ce random(9): bump removal to FreeBSD 15.0
It has not yet been removed, and still has some in-tree consumers.

PR:		277655
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit f50322c1dc)
2024-03-22 09:30:31 -04:00
Ed Maste
ed70dd5bf5 iwm.4: add iwlwifi cross-reference
iwlwifi(4) supports a superset of the devices supported by iwm(4).  The
latter may be retired in the future (if there is no reason to prefer it
for the set of devices supported by both).

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 9dd5023e95)
2024-03-22 09:30:31 -04:00
Ed Maste
1bc20e8af1 mount: document atime option
atime is enabled by default, but may be specified explicitly so that any
future change in the default would not have an effect on a given mount.

Reviewed by:	olce, rgrimes
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43580

(cherry picked from commit 54d31cfb27)
2024-03-22 09:30:30 -04:00
Ed Maste
c3c75c142c open: make non-POSIX errno value more apparent
In the errno list, add an explicit note and reference to the note in the
STANDARDS section.

When O_NOFOLLOW is specified and the target is a symbolic link FreeBSD
sets errno to a value different than that specified by POSIX.  Commit
295159dfa3 added a note to this effect, but I missed it when reading
through the list of errno values.

PR:		214633
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43618

(cherry picked from commit ea6a6b63e1)
2024-03-22 09:30:30 -04:00
rilysh
0416bffd51 CONTRIBUTING.md: fix typo from commmit to commit
Signed-off-by: rilysh <nightquick@proton.me>
Pull-request: https://github.com/freebsd/freebsd-src/pull/960
(cherry picked from commit 5f71f9636e)
2024-03-22 09:30:30 -04:00
Ed Maste
67e6b8354a CONTRIBUTING.md: add author identity info
We do not want @users.noreply.github.com addresses.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41918

(cherry picked from commit febba4622b)
2024-03-22 09:11:15 -04:00
Dag-Erling Smørgrav
f25f14a939 libbe: Fix some markup issues.
MFC after:	3 days
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D44407

(cherry picked from commit ad99fea904)
2024-03-22 09:07:03 +01:00
Dag-Erling Smørgrav
d5d2452bf5 bectl: Simplify command aliases.
MFC after:	3 days
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D44406

(cherry picked from commit a46217ce7d)
2024-03-22 09:07:03 +01:00
Dag-Erling Smørgrav
98a9731683 bectl: Use geopt() and drop mention of -?.
MFC after:	3 days
PR:		272260
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D44405

(cherry picked from commit e819534f15)
2024-03-22 09:07:03 +01:00
Gordon Bergling
8f13a2c525 OpenBSM: Remove $FreeSBD$ tags from the configuration files
In e61dc6cac4 the configuration
files were taken off the vendor branch to help mergemaster
comparing them.

Since mergemaster will be deprecated and $FreeBSD$ tags aren't
used anymore, remove them.

While here, sync audit_filter with upstream commit 5e6da76 (typo).

Reviewed by:	imp
Approved by:	imp
Differential Revision:	https://reviews.freebsd.org/D44318

(cherry picked from commit 6a6ec90681)
2024-03-21 06:51:30 +01:00
Xin LI
984caafec1 zlib: use more memory for a small deflate speedup.
The LIT_MEM option uses slightly more memory (for base gzip(1),
about 16kiB; according to the author, about 6% for default deflate
settings) for a small speedup.

The performance gain is more noticeable for input data with higher
entropy and less significant for data that is highly compressible,
such as source code and logs.

(cherry picked from commit aea57ebcb1)
2024-03-20 20:49:04 -07:00
Konstantin Belousov
87c7f74ff4 netinet/tcp_var.h: always define IS_FASTOPEN() for kernel compilation env
(cherry picked from commit 220ee18f19)
2024-03-20 02:53:28 +02:00
Cy Schubert
a322c2cd19 sqlite3: Vendor import of sqlite3 3.45.1
Release notes at https://www.sqlite.org/releaselog/3_45_1.html.

Obtained from:  https://www.sqlite.org/2024/sqlite-autoconf-3450100.tar.gz

Merge commit '1e59a00476c9801952e7319719fcdb095a0cd007' into main

(cherry picked from commit 937a005585)
2024-03-19 09:12:46 -07:00
Eugene Grosbein
947d9b0231 MFC: diskinfo(8): introduce new option -l
In modes -p or -s, add an option -l to start each line
with a device name separated with a tab. Update the manual page.
Add an example to list names with corresponding serial numbers:

diskinfo -ls /dev/da?

(cherry picked from commit e333110d1d)
2024-03-19 13:54:18 +07:00
Eugene Grosbein
c7f1512739 MFC: mkimg(1): process non-seekable output gracefully
mkimg may make severe load only to fail in the end
if output is non-seekable pipe, socket or FIFO
unless output format is raw disk image.

Check it out and fail early. Make it clear in the manual.

(cherry picked from commit 7f0dc6e2cd)
2024-03-19 13:51:13 +07:00
Marek Zarychta
d45714ade3 netlink: fix route protocol constant values to match Linux
Although these particular constants aren't supported, the incorrect
values break bird 2.15 operation.

PR:		277618
Reported by:	Ondrej Zajicek <santiago@crfreenet.org>

(cherry picked from commit 16f8d88294)
2024-03-18 09:14:45 -07:00
Kyle Evans
97bfe58ddc crunchgen: slap a dependency on the generated makefile for .lo
crunchgen generates a foo.lo for each binary it will end up crunching
into the final product.  While they have a dependency on the libs that
are used to link them, nothing will force relinking if the set of libs
needed to link them is changed.  Because of this, incremental builds may
not be possible if one builds a version of, e.g., rescue/ with a broken
set of libs specified for a project -- a subsequent fix won't be rolled
in cleanly, it will require purging the rescue/ objdir.

This is a bit crude, but the foo.mk we generate doesn't actually get
regenerated all that often in practice, so a spurious relink for the
vast majority of crunched objects won't actually happen all that often.

Reviewed by:	bapt, emaste, imp

(cherry picked from commit 6e2cfb24ee)
2024-03-18 10:52:59 -05:00
Kyle Evans
efb74e16dd libsysdecode: add a decoder for pollfd events
We'll use this in another change to read pollfd arrays coming from a
successful poll(2) operation.

Reviewed by:	bapt, jhb

(cherry picked from commit bd23e71f91)
2024-03-18 10:52:58 -05:00
Kyle Evans
160788caa3 ktrace: log genio events on failed write
Visibility into the contents of the buffer when a write(2) has failed
can be immensely useful in debugging IPC issues -- pushing this to
discuss the idea, or maybe an alternative where we can set a flag like
KTRFAC_ERRIO to enable it.

When a genio event is potentially raised after an error, currently we'll
just free the uio and return.  However, such data can be useful when
debugging communication between processes to, e.g., understand what the
remote side should have grabbed before closing a pipe.  Tap out the
entire buffer on failure rather than simply discarding it.

Reviewed by:	kib, markj

(cherry picked from commit 47ad4f2d45)
2024-03-18 10:52:58 -05:00
Kyle Evans
b983d4f63c kdump: decode pollfd struct arrays coming from poll(2)
We'll handle these just as we do kevents, one per line with subsequent
lines indented sufficiently to distinguish them from the upcoming
return value.

Sample, with indentation stripped and revents changed to '...' in the
first one to keep the line length down:

CALL  poll(0x820610560,0x3,0)
STRU  struct pollfd[] = { { fd=0, events=0x1<POLLIN>, revents=0x11<...>
 { fd=1, events=0x4<POLLOUT>, revents=0x4<POLLOUT>}
 { fd=-1, events=0x4<POLLOUT>, revents=0} }
RET   poll 2

Reviewed by:	bapt, jhb

(cherry picked from commit 02c57f7b48)
2024-03-18 10:52:58 -05:00
Kyle Evans
416547ba79 kern: poll: tap out the pollfd array on successful return
We do this in kern_poll() to include freebsd32 but exclude the linux
compat layer.  The ABI should be the same, but the POLL constants are
probably different or should be assumed so.

Reviewed by:	bapt, jhb

(cherry picked from commit b5d2165b90)
2024-03-18 10:52:57 -05:00
Kyle Evans
a7b90458a2 rtld: add some dlopen tests
dlopen_basic just tests that libthr.so can be dlopen()ed, which will
just serve as a sanity check that "libthr.so" is a thing that can be
dlopened in case we get a weird failure in dlopen_recursing.

dlopen_recursing tests a regression reported after the libsys split,
where some dlopen() may cause infinite recursion and a resulting crash.
This case is inspired by bdrewery's description of what seemed to be
causing his issue.

The corresponding fix landed in commit
968a18975a ("rtld: ignore load_filtees() calls if we already [...]")

Reviewed by:	kib

(cherry picked from commit c5796f1572)
2024-03-18 10:52:57 -05:00
Baptiste Daroussin
104328e630 timerfd_create: accept CLOCK_UPTIME/CLOCK_BOOTTIME
This is a common use case when using timerfd_create to actually use
it with CLOCK_BOOTTIME on linux which is CLOCK_UPTIME for us.

Note that currently on freebsd CLOCK_BOOTTIME is CLOCK_UPTIME, but the
semantic is supposed to be different, this has to be fixed later.

Tested with the fnott notification software

Reviewed by:	des, imp
Differential Revision:	https://reviews.freebsd.org/D44253

(cherry picked from commit cf742faa39)
(cherry picked from commit 0ecf0b26a7)
2024-03-18 15:39:52 +01:00
Baptiste Daroussin
122f46bd92 pci_vendors: update to 2024.02.02
(cherry picked from commit cce3a70a77)
2024-03-18 15:35:31 +01:00
Baptiste Daroussin
20062c378b kbdmap: fix typo preventing kbdmap to work under vt
(cherry picked from commit 0f4e803733)
2024-03-18 15:34:49 +01:00
Baptiste Daroussin
741ca92491 kbdmap: remove debug
(cherry picked from commit f14ea00c8f)
2024-03-18 15:34:47 +01:00
Martin Matuska
2165931f74 zfs: fix NULL assertion in dbuf.c
When porting from OpenZFS master 86e115e to OpenZFS 2.2.x 9c40ae0
an assertion in dbuf.c was converted improperly.

This is a direct commit to stable/14.

OpenZFS PR: 16005
Differential Revision: https://reviews.freebsd.org/D44404
2024-03-18 14:43:58 +01:00
Dag-Erling Smørgrav
c3f4736f04 ping: Fix protocol selection with NOINET6 kernel.
A missing else caused the correct resolver hint (AF_INET) to be
overwritten with AF_UNSPEC when the kernel supports IPv4 but not
IPv6.

MFC after:	3 days
PR:		277592
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D44304

(cherry picked from commit b53ae8a833)
2024-03-17 14:38:12 +00:00
Andriy Gapon
0cb72c25b0 psci: split off psci_reboot from psci_shutdown
Priority of psci_reboot set so that it is run after shutdown_panic is
executed.  This is to provide uniform experience with other platforms.

(cherry picked from commit 0f354b2b58)
2024-03-16 17:14:41 +02:00
Andriy Gapon
721b91d171 syscon_power: do reboot after shutdown_panic is executed
A syscon_power instance can handle either poweroff or reboot, but not
both.  If the instance handles reboot then set its priority to be after
shutdown_panic.

This is to provide uniform experience with other platforms.

(cherry picked from commit 5f7312a0d7)
2024-03-16 17:14:09 +02:00
Andriy Gapon
bf11fee6a5 ata_da: add quirk to disable NCQ TRIM for Samsung 860/870 SSDs
NCQ TRIM for Samsung 860/870 SSDs results in data corruption on systems
with some SATA controllers.

This can be easily reproduced using ZFS which uses TRIM and is able to
detect block content changes.

Linux bug report for this issue:
 https://bugzilla.kernel.org/show_bug.cgi?id=201693

Since at present we can not limit a quirk based on the contorller / SIM,
apply the quirk in all cases.

Reviewed by:	imp

(cherry picked from commit c01af41c3c)
2024-03-16 17:13:27 +02:00
Andriy Gapon
50aa223234 scsi_da: add 4K quirks for Samsung SSD 860 and 870
Although the actual flash page size is either 8K or 16K for those
devices (according to different sources of various reliability), they
seem to be optimized for the "industry-standard" emulated 4K block size.

To do: consolidate very similar Samsung SSD entries for 830 - 870
models.

(cherry picked from commit b7dce5b8e9)
2024-03-16 17:12:53 +02:00
Andriy Gapon
1269b00203 rk8xx_poweroff: enable power-cycling on support hardware
Previously, the function would return early if RB_POWERCYCLE was
specified without RB_POWEROFF.  Those flags are exclusive at the moment,
that is, they are never set together.

Søren Schmidt (sos) uses a similar but extended patch locally.

(cherry picked from commit 8b408fc6f2)
(cherry picked from commit a044cf60bd)
2024-03-16 17:11:50 +02:00
Andriy Gapon
98ee1305b6 ugen: fix USB_IFACE_DRIVER_ACTIVE after detaching a driver
Previosuly, USB_IFACE_DRIVER_ACTIVE would report that the driver is
active even after it detached.  That's because a device(9) still
remains.

So, add device_is_alive(9) check for more accurate reporting.

Reviewed by:	markj

(cherry picked from commit 8f374fa528)
2024-03-16 17:11:37 +02:00
Gordon Bergling
406f9fd0a7 md5.1: Fix the GNU mode example when using a digest file
The last example in the manpage md5(1) wants to demonstrate
GNU mode (md5sum), but uses BSD mode (md5) instead.

In GNU mode, the -c option does not compare against a hash string
passed as parameter. Instead, it expects a digest file,
as created under the name digest for /boot/loader.conf in
the example above.

PR:	276560
Reviewed by:	mhorne, des
Differential Revision:	https://reviews.freebsd.org/D44098

(cherry picked from commit f3343fe4a6)
2024-03-15 10:12:48 +01:00
R. Christian McDonald
9a2b466595 route: introduce add interface route test cases
As a followup to D41330 and D41436, this patch introduces two new tests
for sbin/route: interface_route_v[46].

These tests fail without D41330.

Reviewed by:	kp
Approved by:	kp (mentor)
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit ca7edd0d2c)
2024-03-14 17:52:50 +08:00
Jose Luis Duran
b2cb054dac netlink: Add tests when adding an interface route
Add tests for adding a route using an interface only (without an IP
address).

Reviewed by:	rcm
Approved by:	kp (mentor)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D41436

(cherry picked from commit 1db64f8936)
2024-03-14 16:27:54 +08:00
KUROSAWA Takahiro
7a4a122f97 netlink: fix adding an interface route
route add <host> -iface <netif>" for a netif without an IPv4/IPv6
address fails with EINVAL. Need to use a link-level ifaddr for gw if
an ifaddr for dst is not found as the rtsock-based implementation does.

PR:		275341
Reported by:	Sean Cody <sean@tinfoilhat.ca>
Reviewed by:	rcm
Tested by:	rcm
Approved by:	kp (mentor)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D41330

(cherry picked from commit f818559774)
2024-03-14 16:27:42 +08:00
Konstantin Belousov
47ee352ffd mount_nullfs(8): fix typo
(cherry picked from commit bdf1587a49)
2024-03-13 02:30:41 +02:00
Konstantin Belousov
37ab169e38 nullfs_mount(): fix whitespace
(cherry picked from commit 4e8d264b00)
2024-03-13 02:30:41 +02:00
Konstantin Belousov
ea8d7263d9 mount_nullfs(8): document -o cache and vfs.nullfs.cache_vnodes
(cherry picked from commit 4a2a69c447)
2024-03-13 02:30:41 +02:00
Konstantin Belousov
adcb01c08e nullfs: add -o cache
(cherry picked from commit 8921216dbe)
2024-03-13 02:30:41 +02:00
Konstantin Belousov
a79bb016d9 nullfs_mount(): remove unneeded cast
(cherry picked from commit 0724293331)
2024-03-13 02:30:41 +02:00
Seigo Tanimura
3ba93b50d6 nullfs: Add the vfs.nullfs.cache_nodes sysctl to control nocache default
(cherry picked from commit c849eb8f19)
2024-03-13 02:30:40 +02:00
Konstantin Belousov
91c1c36102 libthr: remove explicit sys/cdefs.h includes
(cherry picked from commit f8bbbce458)
2024-03-13 02:30:40 +02:00