]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 months agoif_tun: check device name
Konstantin Belousov [Tue, 12 Dec 2023 00:13:59 +0000 (02:13 +0200)]
if_tun: check device name

PR: 266999

(cherry picked from commit 0365e5fc905b425313a0a2d89f0d8e2566924df2)

6 months agosshd: do not resolve refused client hostname
Gleb Smirnoff [Thu, 20 Jul 2023 21:56:20 +0000 (14:56 -0700)]
sshd: do not resolve refused client hostname

This is a compromise between POLA and practical reasoning.  We don't
want to block the main server loop in an attempt to resolve.  But we
need to keep the format of the logged message as is, for sake of
sshguard and other scripts.  So let's print just the IP address twice,
this is what libwrap's refuse() would do if it failed to resolve.

Reviewed by: philip
PR: 269456
Differential revision: https://reviews.freebsd.org/D40069

(cherry picked from commit 9ff45b8ed847f9cb7e1cd401278c7f6b30fe8225)

6 months agosshd: remove unneeded initialization of libwrap logging severities
Gleb Smirnoff [Thu, 20 Jul 2023 21:56:20 +0000 (14:56 -0700)]
sshd: remove unneeded initialization of libwrap logging severities

This part of ca573c9a177 proved to be unnecessary.  As the removed
comment says, we set them merely for logging syntax errors, as we log
refusals ourselves.  However, inside the libwrap the parser logs any
syntax errors with tcpd_warn() which has hardcoded LOG_WARNING inside.

Reviewed by: philip, emaste
Differential revision: https://reviews.freebsd.org/D40068

(cherry picked from commit 90f10db8a99659d1baea7b2609d9256c331f61ae)

6 months agoImplement "strict key exchange" in ssh and sshd.
Gordon Tetlow [Mon, 18 Dec 2023 16:22:22 +0000 (08:22 -0800)]
Implement "strict key exchange" in ssh and sshd.

This adds a protocol extension to improve the integrity of the SSH
transport protocol, particular in and around the initial key exchange
(KEX) phase.

Full details of the extension are in the PROTOCOL file.

OpenBSD-Commit-ID: 2a66ac962f0a630d7945fee54004ed9e9c439f14

Approved by: so (implicit)
Obtained from: https://anongit.mindrot.org/openssh.git/patch/?id=1edb00c58f8a6875fad6a497aa2bacf37f9e6cd5
Security: CVE-2023-48795

(cherry picked from commit 92f58c69a14c0afe910145f177c0e8aeaf9c7da4)

6 months agonfscl: Fix comment for commit 6aded1e6b2e5
Rick Macklem [Mon, 4 Dec 2023 00:12:14 +0000 (16:12 -0800)]
nfscl: Fix comment for commit 6aded1e6b2e5

Commit 6aded1e6b2e5 fixed a rare case when handling an NFSv4
Rename reply when delegations are in use.  This patch fixes the
associated comment.

(cherry picked from commit 0a958aa16fed1978879d64e3b225f1d232cc5a98)

6 months agonfscl: Fix processing of a rare Rename reply case
Rick Macklem [Sun, 3 Dec 2023 23:31:01 +0000 (15:31 -0800)]
nfscl: Fix processing of a rare Rename reply case

When delegations are enabled (they are not by default in
the FreeBSD NFSv4 server), rename will check for and return
delegations.  If the second of these DelegReturn operations
were to fail (they rarely do), then the code would not retry
the rename with returning delegations, as it is intended to do.

The patch fixes the problem, since the DelegReturn reply status
is the second iteration of the loop and not the first iteration.

As noted, this bug would have rarely manifested a problem, since
DelegReturn operations do not normally fail.

(cherry picked from commit 6aded1e6b2e5549120031032e1c7f8b002882327)

6 months agoiostat.8: Better wording for some use cases
Gordon Bergling [Sun, 26 Nov 2023 18:30:58 +0000 (19:30 +0100)]
iostat.8: Better wording for some use cases

The iostat(8) manual page should be more specific when using
options. Also extented the BUGS section.

PR: 153012
Reviewed by: bcr
Differential Revision: https://reviews.freebsd.org/D42633

(cherry picked from commit 502e8f44fcc18bfc6dadca56801d66cbce4c07ec)

6 months agoIncrease UFS/FFS maximum link count from 32767 to 65530.
Kirk McKusick [Sun, 3 Dec 2023 20:36:42 +0000 (12:36 -0800)]
Increase UFS/FFS maximum link count from 32767 to 65530.

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

(cherry picked from commit 35a301555bff2ac27a727c10641b7efb3f162988)

6 months agostrfmon.c: Use the restrict keyword directly
Konstantin Belousov [Sat, 9 Dec 2023 01:21:02 +0000 (03:21 +0200)]
strfmon.c: Use the restrict keyword directly

(cherry picked from commit 86e2bcbf47fb4c8dbd799f2f21c0ed338b2e8f1b)

6 months agostrfmon: style fixes
Jose Luis Duran [Thu, 30 Nov 2023 23:28:21 +0000 (23:28 +0000)]
strfmon: style fixes

(cherry picked from commit 56a0d5444d6f39302f3476b61c1b81ed39abe589)

6 months agostrfmon: Silence scan-build warning
Jose Luis Duran [Thu, 30 Nov 2023 23:30:50 +0000 (23:30 +0000)]
strfmon: Silence scan-build warning

(cherry picked from commit 6abee52e0d79f68fd725de748d7027ca8eef2294)

6 months agostrfmon.3: Cleanup example code
Jose Luis Duran [Fri, 1 Dec 2023 06:50:24 +0000 (06:50 +0000)]
strfmon.3: Cleanup example code

(cherry picked from commit 2a163c3649e59dd616e057994ec02092362f0ae7)

6 months agorc.conf: correct $ntp_leapfile_sources
Philip Paeps [Thu, 7 Dec 2023 05:48:13 +0000 (13:48 +0800)]
rc.conf: correct $ntp_leapfile_sources

IETF is no longer serving leap-seconds.list.  Point at IANA instead.

This fixes "service ntpd fetch".

(cherry picked from commit b1c95af45488bef649e9a84890e2414ff80b3a00)

6 months agogit hooks: add "Fixes" trailer to commit message template
Ed Maste [Sat, 20 Feb 2021 18:49:31 +0000 (13:49 -0500)]
git hooks: add "Fixes" trailer to commit message template

A number of projects use "Fixes: <hash>" to identify a commit that is
fixed by a given change.  Adopt that convention.

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

(cherry picked from commit aa8ae5fe17eb380b0f30f1641f17a0b3d83a68c3)

6 months agogit hooks: add "Tested by" to commit message template
Ed Maste [Tue, 2 Feb 2021 18:36:45 +0000 (13:36 -0500)]
git hooks: add "Tested by" to commit message template

Reported by: mjg
Reviewed by: imp
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 9d0f1092cf90c8bf161cb946584f703a9998f8cd)

6 months agortld: add a test for RTLD_DEEPBIND
Kyle Evans [Fri, 1 Dec 2023 01:26:09 +0000 (19:26 -0600)]
rtld: add a test for RTLD_DEEPBIND

This tests that with RTLD_DEEPBIND, symbols are looked up in all of the
object's needed objects before the global object.

ATF_REQUIRE_INTEQ was added after stable/13 branched, so we shim it out
here.

PR: 275393
Reviewed by: kib
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.

(cherry picked from commit d9c543b6b0cabea6e6679d70b4e701018e7eab80)

6 months agolockf: switch to strtonum() for parsing timeout
Kyle Evans [Sun, 26 Nov 2023 04:27:11 +0000 (22:27 -0600)]
lockf: switch to strtonum() for parsing timeout

Convert waitsec to a long long to be able to hold the full domain of
alarm(3) timeout on all platforms, and let strtonum(3) handle the input
validation.  strtonum(3) also happens to provide a neater interface for
error handling, and it already includes our pre-existing empty input
check.

Sponsored by: Klara, Inc.

(cherry picked from commit e4967d4d48b0a7d873e4f778c0a6e560e09d4dc3)

6 months agolockf: allow locking file descriptors
Kyle Evans [Wed, 22 Nov 2023 07:46:14 +0000 (01:46 -0600)]
lockf: allow locking file descriptors

This is most useful inside a shell script, allowing one to lock just
portions of a script rather than having to wrap the entire script in a
lock.

PR: 262738
Reviewed by: 0mp, allanjude (both previous versions)
Co-authored-by: Daniel O'Connor <darius@dons.net.au>
Sponsored by: Klara, Inc.

(cherry picked from commit 09a7fe0a5523d53ff6c26ddef9a947f293e18c22)

6 months agolockf: add some tests
Kyle Evans [Wed, 22 Nov 2023 05:09:11 +0000 (23:09 -0600)]
lockf: add some tests

Provide basic coverage for the existing options, nothing deeper (e.g.,
pipe closing behavior) is tested in this set.

Reviewed by: allanjude
Feedback from: des
Sponsored by: Klara, Inc.

(cherry picked from commit 296a5a4db1fc8203f5f6aa8f68321e6ab4652b56)

6 months agolockf: don't hold stdin/stdout/stderr open
Alexander Melkov [Wed, 22 Nov 2023 04:46:28 +0000 (22:46 -0600)]
lockf: don't hold stdin/stdout/stderr open

None of these are essential in the lockf monitor (parent post-fork), so
close them to maintain the illusion that lockf hasn't been inserted into
the pipeline.  This ensures that the correct effects happen on other
programs in the pipeline if the locked command closes or redirects these
elsewhere.

The original patch used -s to close stdout/stderr rather than closing
them unconditionally, but it's not clear that we really care that much.
kevans dropped that part when taking the patch, patch is otherwise by
listed author.

PR: 112379
Reviewed by: 0mp, allanjude (both earlier version), kevans
Feedback from: des
Sponsored by: Klara, Inc.

(cherry picked from commit 18425c19cae08cbe41801845457ed67285806688)

6 months agolockf: hide unavailable error with -n -s
Kyle Evans [Wed, 22 Nov 2023 04:41:36 +0000 (22:41 -0600)]
lockf: hide unavailable error with -n -s

The error message is expected, allow -s to suppress just that one since
it would loosely fall under the definition of "failure to acquire the
lock" described in the manpage for the -s option.

Reviewed by: 0mp, allanjude
Feedback from: des
Sponsored by: Klara, Inc.

(cherry picked from commit 3041e6950d07f0d11c9f91fefbf3c273cbbe4407)

6 months agolockf: correct omission in the usage statement
Kyle Evans [Wed, 22 Nov 2023 04:45:42 +0000 (22:45 -0600)]
lockf: correct omission in the usage statement

The -w flag was added without being noted in the usage statement; fix
that now.

While we're here, re-sort the getopt() string.

Reviewed by: 0mp, allanjude, des
Sponsored by: Klara, Inc.

(cherry picked from commit 35095fd23f071d03633312b91a5b460eaf811efa)

6 months agoarm64: lop off another 24MB of KVA for early device mappings
Kyle Evans [Thu, 23 Nov 2023 16:21:33 +0000 (10:21 -0600)]
arm64: lop off another 24MB of KVA for early device mappings

This grows the block enough to fit a 4K 32-bit depth framebuffer; some
firmware would present smaller GOP modes to be able to boot with a
smaller framebuffer on these devices, but the Windows Devkit firmware
is simply not that nice.  Instead, it offers exactly one GOP mode that
matches the current resolution of the attached display, so with limited
control over resolution on most of my displays it'd be nice if we could
Just Work(TM) at 4K.

andrew notes that he has some ideas for removing PMAP_MAPDEV_EARLY_SIZE
entirely, so this limitation could end up removed altogether in the
future.

Reviewed by: andrew, emaste

(cherry picked from commit a3ceeef26bc880b86f4e181bddd9924a2b5e0691)

6 months agolocaledef: add newlines to error messages
Kyle Evans [Sat, 2 Sep 2023 06:24:34 +0000 (01:24 -0500)]
localedef: add newlines to error messages

These won't be added elsewhere, so add a little bit of room to make
these messages a little easier to read.  The existing set is a mixed
bag, there are somewhere in the ballpark of 45, 46 printfs to stderr and
19 of those had newlines.

Reviewed by: yuripv
Sponsored by: Klara, Inc.

(cherry picked from commit 3141e51d2e38fa7b9e6d81477dfa860d087c514d)

6 months agolocaledef: expand the default charmap
Kyle Evans [Sat, 2 Sep 2023 06:13:02 +0000 (01:13 -0500)]
localedef: expand the default charmap

POSIX defines a number of other control characters as well as
alternative aliases for some that should be provided in the default set,
so let's go ahead and add those.

Reviewed by: bapt, yuripv
Sponsored by: Klara, Inc.

(cherry picked from commit 3a7ffe206ce7e4741fae26432f6d6e5159207f45)

6 months agolocaledef: correct definition of right-parenthesis in default charmap
Kyle Evans [Sat, 2 Sep 2023 05:56:31 +0000 (00:56 -0500)]
localedef: correct definition of right-parenthesis in default charmap

It turns out that right parentheses do exist and are different than
left parentheses, so let's switch to that.

Sponsored by: Klara, Inc.

(cherry picked from commit 07bc20e4740d09f554c3787bb1940fc503300822)

6 months agosort: Only build FreeBSD-specific ALTMON_x stuff when ATLMON_1 is defined
Warner Losh [Thu, 7 Dec 2023 20:27:07 +0000 (13:27 -0700)]
sort: Only build FreeBSD-specific ALTMON_x stuff when ATLMON_1 is defined

On MacOS, we bootstrap sort. Since ALTMON_* are not defined there, the
build blows up. Since we don't need this feature for the FreeBSD build
process, and since we won't use it unless we actually install the NL
files that have this data in it, just #ifdef it out for now. In the
extremely unlikely event that the FreeBSD bootstrap/build process grows
this dependency, we can evaluate the best solution then (which most
likely is going to be not depend on the local's month names).

Fixes: 3d44dce90a69 (MacOS builds and github CI)
Sponsored by: Netflix
Reviewed by: jrtc27, jlduran@gmail.com, markj
Differential Revision: https://reviews.freebsd.org/D42868

(cherry picked from commit bd234c0d4c8256db7e5a1fdda9ef311c9e0080e4)

6 months agosort: test against all month formats in month-sort
Christos Margiolis [Fri, 1 Dec 2023 00:30:10 +0000 (02:30 +0200)]
sort: test against all month formats in month-sort

The CLDR specification [1] defines three possible month formats:

- Abbreviation (e.g Jan, Ιαν)
- Full (e.g January, Ιανουαρίου)
- Standalone (e.g January, Ιανουάριος)

Many languages use different case endings depending on whether the month
is referenced as a standalone word (nominative case), or in date context
(genitive, partitive, etc.). sort(1)'s -M option currently sorts months
by testing input against only the abbrevation format, which is
essentially a substring of the full format. While this works fine for
languages like English, where there are no cases, for languages where
there is a different case ending between the abbreviation/full and
standalone formats, it is not sufficient.

For example, in Greek, "May" can take the following forms:

Abbreviation: Μαΐ (genitive case)
Full: Μαΐου (genitive case)
Standalone: Μάιος (nominative case)

If we use the standalone format in Greek, sort(1) will not able to match
"Μαΐ" to "Μάιος" and the sort will fail.

This change makes sort(1) test against all three formats. It also works
when the input contains mixed formats.

[1] https://cldr.unicode.org/translation/date-time/date-time-patterns

Reviewed by: markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D42847

(cherry picked from commit 3d44dce90a6946e2ef2ab30ffbf8e2930acf888b)

6 months agoAdd IBM TS1170 density codes and specs.
Kenneth D. Merry [Tue, 31 Oct 2023 19:20:36 +0000 (15:20 -0400)]
Add IBM TS1170 density codes and specs.

These were obtained from a drive, but they agree with the IBM
documentation.

The bpi/bpmm values are the same as TS1160, but the number of
tracks is much larger (18944 tracks vs 8704 for TS1160).  The tapes
are also longer, 1337m total.  (According to the MAM on a sample JF
tape.  I don't have a JE tape handy to compare.)  The end result
is a 50TB raw capacity (150TB compressed) for TS1170 with a JF
cartridge vs 20TB raw capacity (60TB compressed) for TS1160 with
a JE cartridge.

lib/libmt/mtlib.c:
Add the TS1170 density codes to the denstiy table in libmt.

usr.bin/mt/mt.1:
Add the TS1170 density codes and specs to the density table
in the mt(1) man page.  As usual for TS drives, there is an
encrypted and non-encrypted density code (0x79 and 0x59
respectively).

Sponsored by: Spectra Logic

(cherry picked from commit 83823d063ab57db8d3954c1530d036f1ccdceb41)

6 months agosysvipc: Fix 32-bit compat on !i386
Brooks Davis [Fri, 1 Dec 2023 20:48:29 +0000 (20:48 +0000)]
sysvipc: Fix 32-bit compat on !i386

The various time fields are time_t's which are only 32-bit on i386.

Fixing the old versions is probably of little use, but it's more correct
and in theory there could be powerpc binaries from 6.x.

PR: 240035
Fixes: fbb273bc05bef Properly support for FreeBSD 4 32bit System V shared memory.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D42870

(cherry picked from commit 957f014dc076a7f74ed0c8c8699e6f39b55785e7)

6 months agotty: Avoid a kernel memory discloure via kern.ttys
Mark Johnston [Mon, 11 Dec 2023 14:19:09 +0000 (09:19 -0500)]
tty: Avoid a kernel memory discloure via kern.ttys

Four pad bytes at the end of each xtty structure were not being cleared
before being copied out.  Fix this by clearing the whole structure
before populating fields.

MFC after: 3 days
Reported by: KMSAN

(cherry picked from commit 3c0fb026b2fc998fa9bea8aed76e96c58671aee3)

6 months agovnet: (read) lock the vnet list while iterating it
Kristof Provost [Tue, 5 Dec 2023 19:08:11 +0000 (20:08 +0100)]
vnet: (read) lock the vnet list while iterating it

Ensure that the vnet list cannot be modified while we're running through
it.

Reviewed by: mjg (previous version), zlei (previous version)
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D42927

(cherry picked from commit bd7b2f95019e9715150c34736279805de0818d09)

6 months agobsdinstall: Encode dists to valid variable names in checksum script
Jessica Clarke [Wed, 6 Dec 2023 21:37:32 +0000 (21:37 +0000)]
bsdinstall: Encode dists to valid variable names in checksum script

Currently we just strip the .txz of the dist name (and add a status_
prefix) to get the shell variable name for its status, but this doesn't
give a valid result for dists like base-dbg, kernel-dbg and lib32-dbg,
or even kernel.KERNCONF (or, combining the two, kernel.KERNCONF-dbg). As
a result, four things go wrong for such dists:

1. If there is a dot and/or a dash in the name, writing to the variable
   fails and spits an error out on stderr to the log
3. If there is a dot in the name before any dash, the syntax is always
   invalid, reading the variable fails, spits an error out on stderr to
   the log, the result is the empty string and that is interpreted as
   being 0%
2. If there is a dash in the name before any dot, and there is a dist
   whose name is the substring up to that first dash, and it has already
   had its status written to, reading the variable instead reads that
   dist's variable and so the status of that dist is displayed instead
3. If there is a dash in the name before any dot, and either there is
   not a dist whose name is the substring up to that first dash or there
   is such a dist but it has not already had its status written to,
   reading the varaible instead results in the substring after the first
   dash, including any additional string expansion syntax that follows
   (i.e. ${status_kernel-dbg:--11}, the expression used to read the
   variable, is interpreted as reading status_kernel with a default
   value of "dbg:--11")

For example, in a default install with base, kernel, kernel-dbg and
lib32, the following sequence of displays happens:

1. base is In Progress, kernel is Pending, kernel-dbg is 0% (what shows
   for the garbage input "dbg:--11") and lib32 is Pending
2. base is Passed, kernel is In Progress, kernel-dbg is In Progress
   (since kernel has now had its status written to) and lib32 is
   Pending
3. base is Passed, kernel is Passed, kernel-dbg is Passed (again, since
   that is the status of kernel, despite that kernel-dbg is being
   verified at this point) and lib32 is Pending
4. base is Passed, kernel is Passed, kernel-dbg is Passed and lib32 is
   In Progress

Fix this with a crude encoding scheme. More special characters can
easily be added if needed in future.

Note that, prior to bsddialog being used (and thus for branches this is
MFC'ed to where dialog is still used), the same problem existed but
displayed slightly differently due to a combination of different default
values and different behaviour for unintended inputs.

Fixes: b70047d41362 ("Add generation of an installation manifest containing SHA256 checksums as ...")
MFC after: 1 week

(cherry picked from commit 47d669f10ea3eb92a3783376549728b42c9e22b9)

6 months agotail: Fix heap overflow in -F case.
Dag-Erling Smørgrav [Wed, 29 Nov 2023 21:48:50 +0000 (22:48 +0100)]
tail: Fix heap overflow in -F case.

The number of events we track can vary over time, but we only allocate
enough space for the exact number of events we are tracking when we
first begin, resulting in a trivially reproducable heap overflow.  Fix
this by allocating enough space for the greatest possible number of
events (two per file) and clean up the code a bit.

Also add a test case which triggers the aforementioned heap overflow,
although we don't currently have a way to detect it.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: allanjude, markj
Differential Revision: https://reviews.freebsd.org/D42839

(cherry picked from commit 621f45532c5887c96b708ce232c52878d0053325)

tail: Clean up error messages.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D42842

(cherry picked from commit b70e57be2cfe83ec9f410e2f317ea38aaac61a98)

6 months agotail.1: Lint with mandoc(1)
Mateusz Piotrowski [Tue, 28 Nov 2023 16:10:12 +0000 (17:10 +0100)]
tail.1: Lint with mandoc(1)

MFC after: 3 days
Sponsored by: Klara, Inc.

(cherry picked from commit 51c27021b2818cc626500d7723dc82291e3eecaa)

6 months agotail: Verify correct behavior when input does not end in a newline.
Dag-Erling Smørgrav [Thu, 16 Mar 2023 15:36:49 +0000 (15:36 +0000)]
tail: Verify correct behavior when input does not end in a newline.

Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D39116

(cherry picked from commit fa3af3ce5010740f28faed22e0a1e819491f26b4)

6 months agotail: Retry kevent if the system call was interrupted
Warner Losh [Sun, 19 Feb 2023 03:04:29 +0000 (20:04 -0700)]
tail: Retry kevent if the system call was interrupted

kevent returns EINTR when I suspend / resume. This causes tail -f
and tail -F to exit with interrupt system call. Ignore this error
and try kevent again.

Sponsored by: Netflix

(cherry picked from commit ef6f20ce47613db7cc615b45f4b6fa1eb99ae0ba)

6 months agoImprove usability of head(1) and tail(1):
Xin LI [Wed, 13 Jul 2022 04:14:25 +0000 (21:14 -0700)]
Improve usability of head(1) and tail(1):

 - Consistently support -q (quiet) and -v (verbose)
 - Allow specifying numbers with SI prefixes supported by expand_number(3)
 - Remove 2^31 limit on lines for head(1)

MFC after: 2 weeks
Reviewed by: lwhsu, pauamma, gbe
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D35720

(cherry picked from commit 643ac419fafba89f5adda0e0ea75b538727453fb)

6 months agobitstring: Support large bit strings.
Dag-Erling Smørgrav [Wed, 22 Nov 2023 22:30:03 +0000 (23:30 +0100)]
bitstring: Support large bit strings.

Replace int with either size_t or ssize_t (depending on context) in
order to support bit strings up to SSIZE_MAX bits in length.  Since
some of the arguments that need to change type are pointers, we must
resort to light preprocessor trickery to avoid breaking existing code.

MFC after: 3 weeks
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D42698

(cherry picked from commit c56f45f2a9da7d989b79fd6c34b63100609ff9ae)

6 months agohesiod: Modernize.
Dag-Erling Smørgrav [Wed, 18 Oct 2023 14:05:37 +0000 (16:05 +0200)]
hesiod: Modernize.

Reviewed by: zlei
Differential Revision: https://reviews.freebsd.org/D42190

(cherry picked from commit 64fc8a936c868345a8f687fe2797474c5fcf35cb)

6 months agoping: Simplify protocol selection.
Dag-Erling Smørgrav [Tue, 10 Oct 2023 22:47:46 +0000 (00:47 +0200)]
ping: Simplify protocol selection.

* Interrupt the option loop as soon as we have an indication of which
  protocol is intended.
* If we end up having to perform a DNS lookup, loop over the entire
  result looking for either IPv4 or IPv6 addresses.

Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Reviewed by: rscheff, kevans, allanjude
Differential Revision: https://reviews.freebsd.org/D42137

(cherry picked from commit 7fd2c91a291bd518e012b438d6ca6fdd04d39dbf)

ping: Consistently use EX_NOHOST for DNS failures.

Traditionally, ping returned exit code EX_NOHOST if a DNS lookup failed.
That is still the case for the legacy code in the new merged ping, but
not for IPv6 targets, nor when a DNS lookup is performed in order to
determine which version of the tool to invoke.

While here, also make sure that the error message is consistent.

Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D42159

(cherry picked from commit c4ffb80ef18f6b581dc28c14bc579e0e7c73438c)

ping: Add missing ATF boilerplate.

Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D42161

(cherry picked from commit fc7143b48341fb16ef5b2262c7cd5b5c47056112)

6 months agolibfetch, fetch: Stop recommending the use of ca_root_nss.
Dag-Erling Smørgrav [Sun, 8 Oct 2023 04:35:15 +0000 (06:35 +0200)]
libfetch, fetch: Stop recommending the use of ca_root_nss.

MFC after: 3 days
Reviewed by: kevans, emaste
Differential Revision: https://reviews.freebsd.org/D42119

(cherry picked from commit 2821a7498f65d357c68166e1978b491abef1ca4a)

6 months agodaemon: Disable stdio buffering.
Dag-Erling Smørgrav [Fri, 6 Oct 2023 16:44:52 +0000 (18:44 +0200)]
daemon: Disable stdio buffering.

The daemon utility already does its own buffering and retransmits its
child's output line by line.  There's no need for stdio to add its own
buffering on top of this.

MFC after: 1 week
Sponsored by: Modirum MDPay
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D42111

(cherry picked from commit cec8e6ba64ccab7fb0d9fa531ebad9228233334d)

6 months agodaemon: EINTR from kevent(2) is not a fatal error
Kyle Evans [Fri, 5 May 2023 15:12:13 +0000 (10:12 -0500)]
daemon: EINTR from kevent(2) is not a fatal error

Simply resume waiting for events rather than exiting if we took a signal
here.

This at least fixes running programs under daemon(8) in the face of
suspend/resume, which I suspect hits us with a spurious EINTR rather
than a signal anyways.

Reported and tested by: manu
Fixes: 8935a3993219b ("daemon: use kqueue for all events")

(cherry picked from commit 494e7dfdbe6ecfe572228ed39f5c794954da068c)

6 months agodaemon: use kqueue for all events
Ihor Antonov [Fri, 14 Apr 2023 05:10:29 +0000 (00:10 -0500)]
daemon: use kqueue for all events

Refactor daemon to use kqueue/kevent instead of signals.

This changes allows to simplify the code in several ways:
- the execution flow is now linear, no async events.
- several variables became redundant and got removed.
- all event handling is now concentrated inside of the event loop, which
  makes code reading and comprehension easier.
- new kqueuex(2) call is used for CLOEXEC, but maintained closing the
  kq fd prior to execve() to ease later MFC

No UX/API changes are intended.

Reviewed by: kevans
Pull Request: https://github.com/freebsd/freebsd-src/pull/701

(cherry picked from commit 8935a3993219be76c7ea03e9ad4509657d08af6c)

6 months agogrowfs: make exit codes more consistent
Mina Galić [Thu, 5 Oct 2023 18:24:53 +0000 (20:24 +0200)]
growfs: make exit codes more consistent

We have overused err(1), so it's hard to distinguish when an error is
very, very serious, and when it's just a user-error, or even harmless.

This patch changes the current behaviour to distinguish between the
following three:

1 for usage errors
2 for recoverable errors
3 or higher for unrecoverable errors

Reviewed by: jilles, pauamma_gundo.com, des
Differential Revision: https://reviews.freebsd.org/D27161

(cherry picked from commit 70a0fb43f91cfe3d08db7cb443d9690f8bff065e)

6 months agoUpdate tzcode to 2023c.
Dag-Erling Smørgrav [Wed, 26 Apr 2023 09:46:18 +0000 (11:46 +0200)]
Update tzcode to 2023c.

MFC after:      3 weeks
Sponsored by:   Klara, Inc.
Reviewed by:    philip
Differential Revision:  https://reviews.freebsd.org/D39712

(cherry picked from commit 75411d157232ee3b4789b92c9205453e7d59a3d2)

6 months agonss_tacplus: Provide dummy setpwent(), getpwent_r(), endpwent().
Dag-Erling Smørgrav [Thu, 31 Aug 2023 07:49:41 +0000 (07:49 +0000)]
nss_tacplus: Provide dummy setpwent(), getpwent_r(), endpwent().

These aren't really needed, since TACACS+ does not support enumeration, but providing placeholders keeps nsdispatch() from complaining that they're missing.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D41658

(cherry picked from commit 56b74a2d856c4d65a4b5c72d1352067b6b469d3b)

6 months agonss_tacplus: Support setting the login class.
Dag-Erling Smørgrav [Tue, 13 Jun 2023 16:06:27 +0000 (16:06 +0000)]
nss_tacplus: Support setting the login class.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: thj
Differential Revision: https://reviews.freebsd.org/D40376

(cherry picked from commit 246aec9a3ce305272f35e6416910024f602a03c1)

6 months agoFix prebuild race between libpam and libtacplus.
Dag-Erling Smørgrav [Wed, 21 Jun 2023 20:58:54 +0000 (20:58 +0000)]
Fix prebuild race between libpam and libtacplus.

Fixes: 21850106fdda
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans, emaste
Differential Revision: https://reviews.freebsd.org/D40702

(cherry picked from commit bd9049eeff458fc7ee256a891ba285519c6ce550)

6 months agolibtacplus: Allow additional AV pairs to be configured.
Dag-Erling Smørgrav [Tue, 13 Jun 2023 16:04:22 +0000 (16:04 +0000)]
libtacplus: Allow additional AV pairs to be configured.

* Replace hand-rolled input tokenizer with openpam_readlinev() which supports line continuations and has better quoting and escaping.
* Simplify string handling by merging struct clnt_str and struct srvr_str into just struct tac_str.
* Each server entry in the configuration file can now have up to 255 AV pairs which will be appended to the ones returned by the server in response to a successful authorization request.

This allows nss_tacplus(8) to be used with servers which do not provide identity information beyond confirming the existence of the user.

This adds a dependency on libpam, however libtacplus is currently only used by pam_tacplus(8) (which is already always used with libpam) and the very recently added nss_tacplus(8) (which is extremely niche).  In the longer term it might be a good idea to split this out into a separate library.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: pauamma_gundo.com, markj
Differential Revision: https://reviews.freebsd.org/D40285
Relnotes: yes

(cherry picked from commit 21850106fdda5269bc881f0e62839dff3d9edf47)

6 months agoAdd nss_tacplus, a TACACS+ NSS module.
Dag-Erling Smørgrav [Mon, 22 May 2023 10:00:48 +0000 (10:00 +0000)]
Add nss_tacplus, a TACACS+ NSS module.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D40133

(cherry picked from commit 6c5cdba1bafe77428b7721e49cc2b944885ec71a)

6 months agotaclib: 0 (not set) is a valid auth type in authorization requests.
Dag-Erling Smørgrav [Mon, 22 May 2023 10:00:42 +0000 (10:00 +0000)]
taclib: 0 (not set) is a valid auth type in authorization requests.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: rew
Differential Revision: https://reviews.freebsd.org/D40132

(cherry picked from commit 951beab15d397942b5306aae292cd16564abe9f9)

6 months agonfsclient: Propagate copyin() errors from nfsm_uiombuf()
Mark Johnston [Tue, 12 Dec 2023 01:04:56 +0000 (20:04 -0500)]
nfsclient: Propagate copyin() errors from nfsm_uiombuf()

Approved by: so
Security: SA-23:18.nfsclient
Reviewed by: rmacklem
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 6fa843f6e647a1a1e0e42af1e7abc9e903699f31)

6 months agobsd-family-tree: add FreeBSD 14
Sergey A. Osokin [Thu, 7 Dec 2023 14:26:12 +0000 (09:26 -0500)]
bsd-family-tree: add FreeBSD 14

(cherry picked from commit 25f37779bdeba6856f92d0bc94f74582566fcb0f)

6 months agobsd-family-tree: add OpenBSD 7.4
Sergey A. Osokin [Mon, 16 Oct 2023 20:19:12 +0000 (16:19 -0400)]
bsd-family-tree: add OpenBSD 7.4

(cherry picked from commit 8c630381b43cc4d83c99305df3f732b0583ff8f2)

6 months agobsd-family-tree: add macOS 14
Sergey A. Osokin [Thu, 28 Sep 2023 21:42:08 +0000 (17:42 -0400)]
bsd-family-tree: add macOS 14

(cherry picked from commit 992ec09f37837a3f7d131bc70a66d6e41b814e9b)

6 months agoOpenZFS: Ensure that zfs_getattr() initializes the va_rdev field
Mark Johnston [Thu, 7 Dec 2023 16:20:11 +0000 (11:20 -0500)]
OpenZFS: Ensure that zfs_getattr() initializes the va_rdev field

Otherwise the field is left uninitialized, leading to a possible kernel
memory disclosure to userspace or to the network.  Use the same
initialization value we use in zfsctl_common_getattr().

Reported-by: KMSAN
Sponsored-by: The FreeBSD Foundation
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ed Maste <emaste@FreeBSD.org>
Signed-off-by: Mark Johnston <markj@FreeBSD.org>
(cherry picked from commit 11656234b560c401dec6a16e1bf048b20fd31aac)

6 months agoMFC: xz 5.4.5
Xin LI [Fri, 12 May 2023 22:49:34 +0000 (15:49 -0700)]
MFC: xz 5.4.5

(cherry picked from commit ca6a6373bdaed010d6cbfb27f7249ae96009409d)
(cherry picked from commit 1f3ced26d4946ff2e24472432a275efb9ba1f2ca)
(cherry picked from commit b333cd44de6db4d3182add2f80870c7a96d570d9)

6 months agopf tests: test that we validate sequence numbers on TCP RST
Kristof Provost [Wed, 29 Nov 2023 12:51:39 +0000 (13:51 +0100)]
pf tests: test that we validate sequence numbers on TCP RST

MFC after: 3 days
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 4c84c69ba308b7758d07dc8845b13922ed667e02)

6 months agouma: Micro-optimize memory trashing
Alexander Motin [Thu, 9 Nov 2023 18:07:46 +0000 (13:07 -0500)]
uma: Micro-optimize memory trashing

Use u_long for memory accesses instead of uint32_t.  On my tests on
amd64 this by ~30% reduces time spent in those functions thanks to
bigger 64bit accesses.  i386 still uses 32bit accesses.

MFC after: 1 month

(cherry picked from commit 7c566d6cfc7bfb913bad89d87386fa21dce8c2e6)

7 months agoDocument library types in the intro(3) manual page
Gordon Bergling [Thu, 16 Nov 2023 09:48:09 +0000 (10:48 +0100)]
Document library types in the intro(3) manual page

Add a paragraph about library types to the intro(3)
manual page. Document library types, locations
and versioning.

Reviewed by: emaste, jilles, mhorne, pauamma_gundo.com
Obtained from: OpenBSD (partial)
Differential Revision: https://reviews.freebsd.org/D36594

(cherry picked from commit 54611b7cc69cee34e7bcdc2324a9159e7543a125)

7 months agoRTLD_DEEPBIND: make lookup not just symbolic, but walk all refobj' DAGs
Konstantin Belousov [Wed, 29 Nov 2023 18:30:59 +0000 (20:30 +0200)]
RTLD_DEEPBIND: make lookup not just symbolic, but walk all refobj' DAGs

PR: 275393

(cherry picked from commit 9daf6cd0f46416d9c6eb0411ea6042cd42b8a9bc)

7 months agobusdma: emit a warning for use of filters
Mitchell Horne [Mon, 4 Dec 2023 15:46:48 +0000 (11:46 -0400)]
busdma: emit a warning for use of filters

Filter functions are deprecated, and unused in the tree. If either of
the filter or filterarg arguments to bus_dma_tag_create() are non-NULL,
print a warning.

This is a direct commit to stable/13.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D42897

7 months agopf: fix mem leaks upon vnet destroy
Igor Ostapenko [Wed, 29 Nov 2023 12:35:41 +0000 (13:35 +0100)]
pf: fix mem leaks upon vnet destroy

Add missing cleanup actions:
- remove user defined anchor rulesets
- remove user defined ether anchor rulesets
- remove tables linked to user defined anchors
- deal with wildcard anchor peculiarities to get them removed correctly

PR: 274310
Reviewed by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42747

(cherry picked from commit 0626d30e41cba64b41667314c3a4f7611f0eb685)

7 months agoperiodic/daily/480.leapfile-ntpd: only attempt to refresh leap-seconds.list
Xin LI [Sun, 3 Dec 2023 07:00:32 +0000 (23:00 -0800)]
periodic/daily/480.leapfile-ntpd: only attempt to refresh leap-seconds.list
when ntpd is enabled.

The leap-seconds.list is used exclusively by ntpd, therefore, do not bother
to perform the fetch when ntpd is not enabled.

PR: conf/275419
Reviewed by: cy, michaelo, imp
Differential Revision: https://reviews.freebsd.org/D42875

(cherry picked from commit 3b3195f6767b39eb33b3523134ef988931c9c86d)

7 months agousbdevs: add quirk for WD MyPassport Ultra External HDD
Eugene Grosbein [Sun, 3 Dec 2023 16:48:34 +0000 (23:48 +0700)]
usbdevs: add quirk for WD MyPassport Ultra External HDD

WD MyPassport Ultra External HDD needs quirk
UQ_MSC_NO_TEST_UNIT_READY to attach.

(cherry picked from commit 970d73856b626a68597de19d37b68c376e2c0491)

7 months agorelease/Makefile.vm: Rework emulator-portinstall
Colin Percival [Sun, 3 Dec 2023 21:39:30 +0000 (13:39 -0800)]
release/Makefile.vm: Rework emulator-portinstall

The emulator-portinstall target now unconditionally ensures that qemu
is installed; but is only invoked if needed (aka. when cross building
VM images).

MFC After: 3 days
MFC With: 97bd53ef4d20 ("Fix duplicate rc.conf files")

(cherry picked from commit 7d0ee5ebd052d35e323f2d303e467c2cf305ca39)

7 months agoMakefile.vm: Fix duplicate rc.conf files
Colin Percival [Mon, 27 Nov 2023 21:29:05 +0000 (13:29 -0800)]
Makefile.vm: Fix duplicate rc.conf files

Two bugs in Makefile.vm resulted in disk images being "built" multiple
times, resulting in lines added to /etc/rc.conf being duplicated:

1. The vm-image target reused the same "staging tree" directory for all
of its builds (multiple disk image types and multiple filesystem types).

2. The cw-type-flavour-fs target depends on emulator-portinstall, which
did not have a 'touch ${.TARGET}' and thus re-ran every time -- and
caused the cw-type-flavour-fs target to be re-run.  This was triggered
by release builds running `make cloudware-release` (creating the disk
images) followed by `make ec2amis` (which re-created the disk images
prior to uploading them).

MFC After: 1 week
Sponsored by: https://www.patreon.com/cperciva

(cherry picked from commit 97bd53ef4d20b7d15e0b0976e885af9438f5637e)

7 months agopf: remove incorrect fragmentation check
Kristof Provost [Wed, 29 Nov 2023 18:06:31 +0000 (19:06 +0100)]
pf: remove incorrect fragmentation check

We do not need to check PFDESC_IP_REAS while tracking TCP state.
Moreover, this check incorrectly considers no-data packets (e.g. RST) to
be in-window when this flag is not set.

Sponsored by: Rubicon Communications, LLC ("Netgate")
Approved by: so
Security: FreeBSD-SA-23:17.pf

(cherry picked from commit 6284d5f76d6bd2d97fe287c5adabf59c79688eda)

7 months agovmstat: fix column names broken in c168508655720
Maxim Sobolev [Tue, 5 Dec 2023 01:39:21 +0000 (17:39 -0800)]
vmstat: fix column names broken in c168508655720

Loss of the trailing space in the multi-line format string has
resulted in column name being emitted as "FAILSLEEP", instead of
two columns "FAIL" and "SLEEP".

(cherry picked from commit 62d47a4db4579315d7b89002d7de696b44ae1415)

7 months agonullfs: do not allow bypass on copy_file_range()
Konstantin Belousov [Sat, 18 Nov 2023 09:23:22 +0000 (11:23 +0200)]
nullfs: do not allow bypass on copy_file_range()

(cherry picked from commit 326836a1ebc6ce9b28c8f2bc1d177a444fba8ea6)

7 months agovn_copy_file_range(): provide ENOSYS fallback to vn_generic_copy_file_range()
Konstantin Belousov [Sat, 18 Nov 2023 08:59:19 +0000 (10:59 +0200)]
vn_copy_file_range(): provide ENOSYS fallback to vn_generic_copy_file_range()

(cherry picked from commit c5405d1c850765d04f74067ebb71f57e9a26b8ea)

7 months agovn_copy_file_range(): find write vnodes on which to call the VOP
Konstantin Belousov [Sat, 18 Nov 2023 08:57:44 +0000 (10:57 +0200)]
vn_copy_file_range(): find write vnodes on which to call the VOP

(cherry picked from commit a9bc8637690ce29496650a41d3c25e225ed22e3d)

7 months agoVFS: add VOP_GETLOWVNODE()
Konstantin Belousov [Sat, 18 Nov 2023 08:55:48 +0000 (10:55 +0200)]
VFS: add VOP_GETLOWVNODE()

(cherry picked from commit 4cbe4c48a7e574ec1bb919351d7a57d252b00b62)

7 months agoEVFILT_TIMER: intialize stop timer list in type-stable proc init, instead of fork
Konstantin Belousov [Tue, 28 Nov 2023 15:42:49 +0000 (17:42 +0200)]
EVFILT_TIMER: intialize stop timer list in type-stable proc init, instead of fork

(cherry picked from commit 171f0832c5b15f2f66d2fe59967348a42814b0c1)

7 months agoEVFILT_SIGNAL: do not use target process pointer on detach
Konstantin Belousov [Tue, 28 Nov 2023 12:51:54 +0000 (14:51 +0200)]
EVFILT_SIGNAL: do not use target process pointer on detach

PR: 275286

(cherry picked from commit ed410b78edc53e17b5a3e93ace2adbeb3a734ae9)

7 months agoSpacing and alignment cleanups.
Kirk McKusick [Fri, 17 Nov 2023 22:39:13 +0000 (14:39 -0800)]
Spacing and alignment cleanups.

No functional change.

(cherry picked from commit bde3cdf18d9881abfbe45337020e996dbeabca76)

7 months agoOpenZFS: Fix ZFS so that snapshots under .zfs/snapshot are NFS visible
rmacklem [Tue, 28 Nov 2023 00:31:03 +0000 (16:31 -0800)]
OpenZFS: Fix ZFS so that snapshots under .zfs/snapshot are NFS visible

Call vfs_exjail_clone() for mounts created under .zfs/snapshot
to fill in the mnt_exjail field for the mount.  If this is not
done, the snapshots under .zfs/snapshot with not be accessible
over NFS.

This version has the argument name in vfs.h fixed to match that
of the name in spl_vfs.c, although it really does not matter.

External-issue: https://reviews.freebsd.org/D42672
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Rick Macklem <rmacklem@uoguelph.ca>
Closes #15563

(cherry picked from commit 522414da3b283dada175161e49ea7f3fe46436ff)

7 months agopfctl: use libpfctl instead of DIOCGETRULES directly
Kristof Provost [Fri, 24 Nov 2023 23:43:48 +0000 (00:43 +0100)]
pfctl: use libpfctl instead of DIOCGETRULES directly

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 47a0b59379c3bec547e7c829eb12de8276227dff)

7 months agopkgbase: set the prefix of debug files and macros to /usr/src
Baptiste Daroussin [Mon, 13 Nov 2023 17:18:58 +0000 (18:18 +0100)]
pkgbase: set the prefix of debug files and macros to /usr/src

When the macro PACKAGE_BUILDING is set, then consider we are building package
for pkgbase, this has already been used in Makefile.inc1 and reuse the
PACKAGE_BUILDING macros already used for that purpose in the ports tree

In the future this should be tied to REPRODUCIBLE_BUILD

MFC After: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D42569

(cherry picked from commit 030af1b62d7b9a86f5ecdceff5a1fa23e9570be1)

7 months agopkgbase: create package with SRCRELDATE not OSRELDATE as OSVERSION
Baptiste Daroussin [Tue, 14 Nov 2023 07:41:47 +0000 (08:41 +0100)]
pkgbase: create package with SRCRELDATE not OSRELDATE as OSVERSION

In 188fe88ec50eac7c10e1d8350bf1180f8c16e463 OSVERSION has been set
to OSRELDATE which is the RELDATE of the building OS while we wanted
to use SRCRELDATE which is the RELDATE of the target system

(cherry picked from commit 051d69d6f8b51dc1d7bba58af99be76185312222)

7 months agopkgbase: force OSVERSION
Baptiste Daroussin [Fri, 3 Nov 2023 08:29:23 +0000 (09:29 +0100)]
pkgbase: force OSVERSION

This is used to the package annotation helping pkg to know about
backward compatibility is set to the version of the packages not
the version of the host building the packages

(cherry picked from commit 188fe88ec50eac7c10e1d8350bf1180f8c16e463)

7 months agopkgbase: set a default set of kernel for when PACKAGE_BUILDING=1
Baptiste Daroussin [Thu, 2 Nov 2023 13:20:11 +0000 (14:20 +0100)]
pkgbase: set a default set of kernel for when PACKAGE_BUILDING=1

PACKAGE_BUILDING is already known in the ports tree as a variable
use to defined when the packages is being actually built in an
automation process, reuse that variable to define the default set
of kernel we plan to build for the default pkgbase.

Reviewed by: manu, jrtc27
Accepted by: manu
MFC After: 1 week
Differential Revision: https://reviews.freebsd.org/D42444

(cherry picked from commit df6e7e11c5f660cbd5381819718e3c947325fa2e)

7 months agopkgbase: compress packages with zstandard
Baptiste Daroussin [Thu, 26 Oct 2023 20:34:00 +0000 (22:34 +0200)]
pkgbase: compress packages with zstandard

MFC After: 3 days
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D42375

(cherry picked from commit 820fbcf25bb2c7f1c570c0d408b2ab7d05bd771c)

7 months agopci_vendors: update to 2023-09-22
Baptiste Daroussin [Fri, 3 Nov 2023 16:32:35 +0000 (17:32 +0100)]
pci_vendors: update to 2023-09-22

(cherry picked from commit dbffadd8c28e3ab7dc8b5d38e3c5d7f96a5ad62d)

7 months agopci_vendors: update to 2023-08-12
Baptiste Daroussin [Wed, 6 Sep 2023 12:22:11 +0000 (14:22 +0200)]
pci_vendors: update to 2023-08-12

(cherry picked from commit bf986d52458aaefa4d3a1d4668449cbb5c991afe)

7 months agopci_vendors: update to 2023-06-19
Baptiste Daroussin [Wed, 5 Jul 2023 06:30:42 +0000 (08:30 +0200)]
pci_vendors: update to 2023-06-19

(cherry picked from commit 3743f3d020bbb8899af68fc5e01086113468fd2c)

7 months agonvi: import version 2.2.1
Baptiste Daroussin [Wed, 27 Sep 2023 16:01:58 +0000 (18:01 +0200)]
nvi: import version 2.2.1

(cherry picked from commit 0fcececbac9880b092aeb56a41a16f1ec8ac1ae6)

7 months agocompiler-rt: remove unnecessary include
Dimitry Andric [Tue, 28 Nov 2023 18:17:36 +0000 (19:17 +0100)]
compiler-rt: remove unnecessary include

This is to sync the code with upstream, see:
See https://github.com/llvm/llvm-project/pull/73439#discussion_r1406644942

Fixes: 4c9a0adad182
MFC after: 3 days

(cherry picked from commit d2033021a73db7b8d910c1ffc52f4d1d0def7162)

7 months agorc.conf(5): add <service>_umask to run the service using this value
Eugene Grosbein [Sun, 28 Aug 2022 05:45:23 +0000 (12:45 +0700)]
rc.conf(5): add <service>_umask to run the service using this value

None of tools working with login classes change umask(1)
and we had no ways to specify non-default umask for a service
not touching its startup script. This change makes in possible.

Some file-sharing services that create new files may benefit from it.

Differential: https://reviews.freebsd.org/D36309

(cherry picked from commit 160a2f2cdda806e104c0d3194bfb84b208ad1ae8)

7 months agorc: add ${name}_setup script support
Franco Fichtner [Mon, 15 Aug 2022 14:41:31 +0000 (16:41 +0200)]
rc: add ${name}_setup script support

Run a service-based setup script before running the start command.
Useful for automatic configuration file generation.

Reviewed by: https://reviews.freebsd.org/D36006

7 months agoDo not install kernel and modules with executable access bit set
Konstantin Belousov [Sat, 25 Nov 2023 13:30:06 +0000 (15:30 +0200)]
Do not install kernel and modules with executable access bit set

(cherry picked from commit a9758e46473babc03bfe06edfec35e0c71fa7780)

7 months agoSet installed kernel and driver files access modes using KMODMODE var
Konstantin Belousov [Sat, 25 Nov 2023 13:28:34 +0000 (15:28 +0200)]
Set installed kernel and driver files access modes using KMODMODE var

(cherry picked from commit d3849ec3c9e700956a8a1d03f7755d586934f225)

7 months agozfs: merge openzfs/zfs@d99134be8 (zfs-2.1-release) into stable/13
Martin Matuska [Sat, 2 Dec 2023 00:11:25 +0000 (01:11 +0100)]
zfs: merge openzfs/zfs@d99134be8 (zfs-2.1-release) into stable/13

OpenZFS release 2.1.14

Notable upstream pull request merges:
 #15395 1ca531971 Zpool can start allocating from metaslab before TRIMs
                  have completed
 #15571 77b0c6f04 dnode_is_dirty: check dnode and its data for dirtiness

Obtained from: OpenZFS
OpenZFS tag: zfs-2.1.14
OpenZFS commit: d99134be83753266b5f7a79738aeab5b08db1e35

7 months agoparam.h: Bump __FreeBSD_version to 1302509 for commit 7aaf39f6b3b0
Rick Macklem [Sat, 2 Dec 2023 00:00:06 +0000 (16:00 -0800)]
param.h: Bump __FreeBSD_version to 1302509 for commit 7aaf39f6b3b0

Commit 7aaf39f6b3b0 a new VFS function called vfs_exjail_clone(),
which will be used by the ZFS module.  Bump the version for
this change.

7 months agotail.1: Add an example for +n 1
Mateusz Piotrowski [Tue, 28 Nov 2023 16:52:11 +0000 (17:52 +0100)]
tail.1: Add an example for +n 1

MFC after: 3 days
Sponsored by: Klara, Inc.

(cherry picked from commit 9f20787fe89e2a912a9e5dd2d3da56087722e8c2)

7 months agoFix /root permissions after 'make installworld'
Thomas Eberhardt [Thu, 16 Nov 2023 09:59:38 +0000 (10:59 +0100)]
Fix /root permissions after 'make installworld'

According to /etc/mtree/BSD.root.dist /root should have
0750 permissions, but the build target 'make installworld'
changes these to 0755.

This is caused by the installation of the configuration
files of sh(1) and csh(1).

Correct this by specifying the correct default /root permissions.

PR: 273342
Reviewed by: jilles
Approved by: jilles
MFC after: 2 weeks
Differential Revision:https://reviews.freebsd.org/D42395

(cherry picked from commit a6ed8c9593031abf6fa73661be55c226caa362d6)

7 months agoaio_read.2: correct the description of aio_buf
Alan Somers [Wed, 15 Nov 2023 17:31:24 +0000 (10:31 -0700)]
aio_read.2: correct the description of aio_buf

Looks like a copypasta from aio_write.2.

[skip ci]

Reported by: Paul Floyd <pjfloyd@wanadoo.fr>
Sponsored by: Axcient
Reviewed by: jilles (manpages)
Differential Revision: https://reviews.freebsd.org/D42621

(cherry picked from commit 04cfe6c12ccc75624dc87ab8f44c4852b16f0c4f)

7 months agolibc/libc/rpc: refactor some global variables
Alan Somers [Thu, 9 Nov 2023 22:58:56 +0000 (15:58 -0700)]
libc/libc/rpc: refactor some global variables

* Combine dg_fd_locks and dg_cv into one array.
* Similarly for vc_fd_locks and vc_cv
* Turn some macros into inline functions

This is a mostly cosmetic change to make refactoring these strutures in
a future commit easier.

Sponsored by: Axcient
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D42597

(cherry picked from commit a5c2f4e939430f0048136c39fb9fa6093d401905)

lib/libc/rpc: switch the per-fd structs in clnt_{dg,vc}.c to RB Trees

This saves oodles of memory, especially when "ulimit -n" is large.  It
also prevents a buffer overflow if getrlimit should fail.

Also replace per-fd condvars with mutexes to simplify the code.

PR: 274968
Sponsored by: Axcient
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D42597

(cherry picked from commit 24938f9311c9c9acc1ce747f4e6a088c2dbc967d)