]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 months agofusefs: fix invalid value for st_birthtime.tv_nsec
Alan Somers [Thu, 25 Jan 2024 15:19:37 +0000 (08:19 -0700)]
fusefs: fix invalid value for st_birthtime.tv_nsec

If a file system's on-disk format does not support st_birthtime, it
isn't clear what value it should return in stat(2).  Neither our man
page nor the OpenGroup specifies.  But our convention for UFS and
msdosfs is to return { .tv_sec = -1, .tv_nsec = 0 }.  fusefs is
different.  It returns { .tv_sec = -1, .tv_nsec = -1 }.  It's done that
ever since the initial import in SVN r241519.

Most software apparently handles this just fine.  It must, because we've
had no complaints.  But the Rust standard library will panic when
reading such a timestamp during std::fs::metadata, even if the caller
doesn't care about that particular value.  That's a separate bug, and
should be fixed.

Change our invalid value to match msdosfs and ufs, pacifying the Rust
standard library.

PR: 276602
Sponsored by: Axcient
Reviewed by: emaste
Approved by: re (cperciva)
Differential Revision: https://reviews.freebsd.org/D43590

(cherry picked from commit 65e25e4a614a99243e7419279b294e399991dfff)

3 months agoinpcb: Restore some NULL checks of credential pointers
Mark Johnston [Wed, 7 Feb 2024 14:43:25 +0000 (09:43 -0500)]
inpcb: Restore some NULL checks of credential pointers

At least one out-of-tree port (net-mgmt/ng_ipacct) depends on being able
to call in_pcblookup_local() with cred == NULL, so the MFC of commit
ac1750dd143e ("inpcb: Remove NULL checks of credential references")
broke compatibility.

Restore a subset of the NULL checks to avoid breaking the module in the
13.3 release.  This is a direct commit to stable/13.

PR: 276868
Approved by: re (cperciva)

(cherry picked from commit fe8df7ed1aae444a09361c080d52bfcb6aaae64f)

3 months ago13.3: update to BETA2
Colin Percival [Fri, 9 Feb 2024 00:00:43 +0000 (16:00 -0800)]
13.3: update to BETA2

Approved by:    re (implicit)
Sponsored by:   https://www.patreon.com/cperciva

3 months agokern: tty: fix ttyinq_read_uio assertion
Kyle Evans [Tue, 16 Jan 2024 02:55:58 +0000 (20:55 -0600)]
kern: tty: fix ttyinq_read_uio assertion

It's clear from later context that `rlen` was always expected to include
`flen`, as we'll trim `flen` bytes from the end of the read.  Relax our
initial assertion to only require the total size less trimmed bytes to
lie within the out buffer size.

While we're here, I note that if we have to read more than one block and
we're trimming from the end then we'll do the wrong thing and omit
`flen` bytes from every block, rather than just the end.  Add an
assertion to make sure we're not doing that, but the only caller that
specifies a non-zero `flen` today will only really be doing so if rlen
is entirely within a single buffer.

Approved by: re (cperciva)
Reviewed by: cy, imp

(cherry picked from commit 09a43b8790bdeb97fbecd3ea767c2f599eb4a4d3)
(cherry picked from commit 81ef0de636ff8ba0b8057ced593f2ab92597b1a6)

4 months agocontrib/tzdata: import tzdata 2024a
Philip Paeps [Fri, 2 Feb 2024 02:01:39 +0000 (10:01 +0800)]
contrib/tzdata: import tzdata 2024a

Changes: https://github.com/eggert/tz/blob/2024a/NEWS

(cherry picked from commit 2723c7ffb7f729a1d3f7c59e7db48b0edf3d30a6)
(cherry picked from commit f4256acec1c980b7d08e9e526be6d2a7c4751f0b)

Approved by: re (karels)

4 months ago13.3: create releng/13.3 branch
Colin Percival [Fri, 2 Feb 2024 00:05:47 +0000 (16:05 -0800)]
13.3: create releng/13.3 branch

Update from PRERELEASE to BETA1
Switch pkg(8) configuration to use the quarterly repository
Bump __FreeBSD_version

Approved by:    re (implicit)
Sponsored by:   https://www.patreon.com/cperciva

4 months agosys/mount.h: use __inline
Konstantin Belousov [Tue, 30 Jan 2024 22:14:25 +0000 (00:14 +0200)]
sys/mount.h: use __inline

(cherry picked from commit f76cb7bd08e02d868e640b3442b2bc45edf8f56a)

4 months agologin_cap.h: Remove LOGIN_DEFPRI
Olivier Certner [Thu, 25 Jan 2024 22:25:10 +0000 (23:25 +0100)]
login_cap.h: Remove LOGIN_DEFPRI

This is an implementation detail which is likely to become irrelevant in
the future, as we move to not resetting the priority if the
corresponding capability is not present in the configuration file
('/etc/login.conf').

GitHub's code search and Google show no use of this public constant, and
it doesn't exist in OpenBSD and NetBSD.

So, remove this definition and its sole use in-tree.

PR:                     276570 (exp-run)
Reviewed by:            emaste
Approved by:            emaste (mentor)
MFC after:              3 days
Sponsored by:           The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D43609

(cherry picked from commit c7e645269f1c7e9872a7ccf6b72f045c55a66793)

Approved by:            markj (mentor)

4 months agologin_cap.h: Remove LOGIN_DEFUMASK
Olivier Certner [Thu, 25 Jan 2024 22:10:40 +0000 (23:10 +0100)]
login_cap.h: Remove LOGIN_DEFUMASK

This public constant has not been used in-tree since 1997 (this was
noticed while working on previous commit "setusercontext(): umask: Set
it only once (in the common case)").

Since it was an implementation detail and GitHub's code search and
Google show no use of this symbol today, simply remove it.

PR:                     276570 (exp-run)
Reviewed by:            emaste, kib (earlier version, then part of D40344)
Approved by:            emaste (mentor)
MFC after:              3 days
Sponsored by:           The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D43608

(cherry picked from commit e3a396eb2a029e5dc9161469735aa3f7f16845d1)

Approved by:            markj (mentor)

4 months agosetusercontext(): Set priority from '~/.login_conf' as well
Olivier Certner [Tue, 30 May 2023 15:14:50 +0000 (17:14 +0200)]
setusercontext(): Set priority from '~/.login_conf' as well

Setting the process priority is done only when the current process'
effective UID corresponds to that for which context is to be set.
Consequently, setting priority is done with appropriate credentials and
will fail if the target user tries to raise it unduly via his
'~/.login_conf'.

PR:                     271751
Reviewed by:            kib, Andrew Gierth <andrew_tao173.riddles.org.uk>
Approved by:            emaste (mentor)
MFC after:              3 days
Relnotes:               yes
Sponsored by:           Kumacom SAS
Differential Revision:  https://reviews.freebsd.org/D40352

(cherry picked from commit f2a0277d3e51a6a839151eef17f466d0db2b7300)

Approved by:            markj (mentor)

4 months agologin.conf(5): Document priority's special value 'inherit'
Olivier Certner [Wed, 21 Jun 2023 08:39:47 +0000 (10:39 +0200)]
login.conf(5): Document priority's special value 'inherit'

Reviewed by:            emaste, yuripv (older version)
Approved by:            emaste (mentor)
MFC after:              3 days
Sponsored by:           Kumacom SAS
Differential Revision:  https://reviews.freebsd.org/D40691

(cherry picked from commit 33d4ce5496efe96bbaa7663e298876395b1db62c)

Approved by:            markj (mentor)

4 months agosetclasspriority(): New possible value 'inherit'
Olivier Certner [Wed, 21 Jun 2023 08:53:37 +0000 (10:53 +0200)]
setclasspriority(): New possible value 'inherit'

It indicates to the login.conf machinery (setusercontext() /
setclasscontext()) to leave priority alone, effectively inheriting it
from the parent process.

PR:                     271749
Reviewed by:            emaste, yuripv
Approved by:            emaste (mentor)
MFC after:              3 days
Relnotes:               yes
Sponsored by:           Kumacom SAS
Differential Revision:  https://reviews.freebsd.org/D40690

(cherry picked from commit d162d7e2ad327ceada4102c5d6779f9ecd809502)

Approved by:            markj (mentor)

4 months agosetusercontext(): Move priority setting in new setclasspriority()
Olivier Certner [Mon, 29 May 2023 17:09:36 +0000 (19:09 +0200)]
setusercontext(): Move priority setting in new setclasspriority()

In preparation for setting priorities from '~/.login_conf' and to ease
reading of setusercontext().

No functional change.

Reviewed by:            emaste
Approved by:            emaste (mentor)
MFC after:              3 days
Sponsored by:           Kumacom SAS
Differential Revision:  https://reviews.freebsd.org/D40350

(cherry picked from commit 7b94ec550ef6e7b75d608e125e9b78478197d4e7)

Approved by:            markj (mentor)

4 months agologin.conf(5): Document priority's default and possible values
Olivier Certner [Wed, 21 Jun 2023 08:39:15 +0000 (10:39 +0200)]
login.conf(5): Document priority's default and possible values

Priority is reset to 0 if not explicitly specified.

While here, be more explicit about what "Initial priority (nice) level"
means and document that it is possible to set real-time or idle class'
priorities with this capability.

Reviewed by:            emaste
Approved by:            emaste (mentor)
MFC after:              3 days
Sponsored by:           Kumacom SAS
Differential Revision:  https://reviews.freebsd.org/D40689

(cherry picked from commit aa96945e71b0f724e6ce673194d23f58d2d637d3)

Approved by:            markj (mentor)

4 months agosetusercontext(): Better error messages when priority is not set correctly
Olivier Certner [Mon, 29 May 2023 16:39:04 +0000 (18:39 +0200)]
setusercontext(): Better error messages when priority is not set correctly

Polish the syslog messages to contain readily useful information.

Behavior of capability 'priority' is inconsistent with what is done for
all other contexts: 'umask', 'cpumask', resource limits, etc., where an
absence of capability means to inherit the value.  It is currently
preserved for compatibility, but is subject to change on a future major
release.

Reviewed by:            emaste, kib (older version)
Approved by:            emaste (mentor)
MFC after:              3 days
Sponsored by:           Kumacom SAS
Differential Revision:  https://reviews.freebsd.org/D40349

(cherry picked from commit d988621b0c25209866ed5a98b1a8b20269935761)

Approved by:            markj (mentor)

4 months agologin.conf(5): Default values: Rename column, elaborate on absence of such
Olivier Certner [Mon, 29 May 2023 14:06:37 +0000 (16:06 +0200)]
login.conf(5): Default values: Rename column, elaborate on absence of such

Column "Notes" in fact only contains default values for capabilities, so
make this clear by renaming it to "Default".

Add a small introductory text mentioning it, and what an absence of
default value means (inheritance).

PR:                     271748
Reviewed by:            emaste
Approved by:            emaste (mentor)
MFC after:              3 days
Sponsored by:           Kumacom SAS
Differential Revision:  https://reviews.freebsd.org/D40347

(cherry picked from commit 92b2c4358f57ef84f161efd8370ba4832bd9261a)

Approved by:            markj (mentor)

4 months agosetlogincontext(): Comply to style(9)
Olivier Certner [Thu, 25 May 2023 14:29:22 +0000 (16:29 +0200)]
setlogincontext(): Comply to style(9)

Remove indentation by inverting the big 'if (lc)' and using 'return'.
Use explicit binary operators to produce booleans.

Reviewed by:            emaste, kib, dchagin
Approved by:            emaste (mentor)
MFC after:              3 days
Sponsored by:           Kumacom SAS
Differential Revision:  https://reviews.freebsd.org/D40346

(cherry picked from commit 771d5c93ab5a3fb1701d9706df2ce87d6a9da6f3)

Approved by:            markj (mentor)

4 months agologin.conf(5): Document umask's special value 'inherit'
Olivier Certner [Wed, 21 Jun 2023 08:42:44 +0000 (10:42 +0200)]
login.conf(5): Document umask's special value 'inherit'

Reviewed by:            emaste
Approved by:            emaste (mentor)
MFC after:              3 days
Sponsored by:           Kumacom SAS
Differential Revision:  https://reviews.freebsd.org/D40688

(cherry picked from commit ea9bd448102b938ccb8d4b484684a6ba2d934931)

Approved by:            markj (mentor)

4 months agosetclassumask(): Accept 'inherit' as a value
Olivier Certner [Tue, 20 Jun 2023 19:41:04 +0000 (21:41 +0200)]
setclassumask(): Accept 'inherit' as a value

'inherit' explicitly indicates that the umask should not be changed.

Reviewed by:            emaste
Approved by:            emaste (mentor)
MFC after:              3 days
Relnotes:               yes
Sponsored by:           Kumacom SAS
Differential Revision:  https://reviews.freebsd.org/D40687

(cherry picked from commit c328e6c6ccaa4cdf921c16d68a2f2c5992dd3b72)

Approved by:            markj (mentor)

4 months agosetusercontext(): Set umask in a separate function, setclassumask()
Olivier Certner [Tue, 20 Jun 2023 16:46:31 +0000 (18:46 +0200)]
setusercontext(): Set umask in a separate function, setclassumask()

Reviewed by:            emaste
Approved by:            emaste (mentor)
MFC after:              3 days
Sponsored by:           Kumacom SAS
Differential Revision:  https://reviews.freebsd.org/D40686

(cherry picked from commit 0dd1705f584947625892988afe59e4cedb5cdd09)

Approved by:            markj (mentor)

4 months agologin_cap(3): Document login_getcapenum()
Olivier Certner [Tue, 20 Jun 2023 20:09:57 +0000 (22:09 +0200)]
login_cap(3): Document login_getcapenum()

Reviewed by:            emaste
Approved by:            emaste (mentor)
MFC after:              3 days
Sponsored by:           Kumacom SAS
Differential Revision:  https://reviews.freebsd.org/D40685

(cherry picked from commit 97256feb7a65cccac51a03846c5308894a2cb445)

Approved by:            markj (mentor)

4 months agoNew login_getcapenum(): Allows to read named enum values
Olivier Certner [Tue, 20 Jun 2023 16:41:32 +0000 (18:41 +0200)]
New login_getcapenum(): Allows to read named enum values

Reviewed by:            emaste
Approved by:            emaste (mentor)
MFC after:              3 days
Sponsored by:           Kumacom SAS
Differential Revision:  https://reviews.freebsd.org/D40684

(cherry picked from commit 90e914cd5ac1c8ecbf1ea88e9a65e7fa866c17a9)

Approved by:            markj (mentor)

4 months agologin.conf(5): umask has no default value
Olivier Certner [Thu, 25 May 2023 12:41:03 +0000 (14:41 +0200)]
login.conf(5): umask has no default value

The umask is simply left unchanged if no explicit value is specified in
the login class capabilities database.

PR:                     271747
Reviewed by:            emaste
Approved by:            emaste (mentor)
MFC after:              3 days
Sponsored by:           Kumacom SAS
Differential Revision:  https://reviews.freebsd.org/D40345

(cherry picked from commit 0d1fe948d97d2d6e3708349b74cf438f9604a8d1)

Approved by:            markj (mentor)

4 months agosetusercontext(): umask: Set it only once (in the common case)
Olivier Certner [Thu, 25 May 2023 12:18:45 +0000 (14:18 +0200)]
setusercontext(): umask: Set it only once (in the common case)

Simplify the code and make it more coherent (umask was the only context
setting not modified by setlogincontext() directly).

Preserve the current behavior of not changing the umask if none is
specified in the login class capabilities database, but without the
superfluous umask() dance.  (The only exception to this is that
a special value no user is likely to input in the database now stands
for no specification.)

If some user has a 'umask' override in its '~/.login_conf', the umask
will still be set twice as before (as is the case for all other context
settings overriden in '~/.login_conf').

Log a warning in case of an invalid umask specification.

This change makes it apparent that the value of LOGIN_DEFUMASK doesn't
matter.  It will be removed in a subsequent commit.

PR:                     271747
Reviewed by:            emaste, kib (earlier version)
Approved by:            emaste
MFC after:              3 days
Sponsored by:           Kumacom SAS
Differential Revision:  https://reviews.freebsd.org/D40344

(cherry picked from commit e99c28e93bd4d04ff877459734e9ce06ad2335a7)

Approved by:            markj (mentor)

4 months agostand: Add 1440p to the list of known resolutions.
Dag-Erling Smørgrav [Tue, 23 Jan 2024 14:20:27 +0000 (15:20 +0100)]
stand: Add 1440p to the list of known resolutions.

MFC after: 1 week
Reviewed by: manu, kevans, imp
Differential Revision: https://reviews.freebsd.org/D43391

(cherry picked from commit 7edbf69b79c13debff251e6edfee1f57eeac3a6b)

4 months agoAdd kenv .Xr in kldload(8) and loader.conf(5)
Warner Losh [Thu, 21 Dec 2023 04:15:42 +0000 (21:15 -0700)]
Add kenv .Xr in kldload(8) and loader.conf(5)

Sponsored by: Netflix

(cherry picked from commit 64db9a0f82863d212ac0bcd49bc0254ccb9dd1ac)

4 months agoopen(2): describe *at behavior for dirfd opened without O_SEARCH
Konstantin Belousov [Mon, 29 Jan 2024 17:54:32 +0000 (19:54 +0200)]
open(2): describe *at behavior for dirfd opened without O_SEARCH

(cherry picked from commit a570fe4d0dd979ce099374259ffc45d56ae4e471)

4 months agompsutil: Clean up libutil deps
Mark Johnston [Wed, 24 Jan 2024 19:47:56 +0000 (14:47 -0500)]
mpsutil: Clean up libutil deps

mpsutil doesn't use libutil, so doesn't need to include libutil.h.  See
commit 76103694a051335bec1da318f9c6e3a676dc0145.

No functional change intended.

MFC after: 1 week

(cherry picked from commit d56ce5915c41517ccc7de2510daec200e100ef68)

4 months agojoin(1): Fix ordering in case of missing fields
Tijl Coosemans [Mon, 22 Jan 2024 10:35:31 +0000 (11:35 +0100)]
join(1): Fix ordering in case of missing fields

The comparison function had the ordering reversed causing join(1) to
miss some matching lines.

PR: 232405
Submitted by: Martijn van Duren <martijn@openbsd.org>

(cherry picked from commit 95bf75895ddcf17402b1f69dce26cb821c922476)

4 months agostable/13: bump __FreeBSD_version for kern_openatfp(9)
Konstantin Belousov [Wed, 31 Jan 2024 00:49:54 +0000 (02:49 +0200)]
stable/13: bump __FreeBSD_version for kern_openatfp(9)

Sponsored by: The FreeBSD Foundation

4 months agoAdd kern_openatfp(9)
Konstantin Belousov [Sat, 20 Jan 2024 20:34:46 +0000 (22:34 +0200)]
Add kern_openatfp(9)

(cherry picked from commit c662306e19ce60d0f5e5e32a22ddcd5c79a90849)

4 months agokern_openat(): minor style fixes
Konstantin Belousov [Sat, 20 Jan 2024 21:42:39 +0000 (23:42 +0200)]
kern_openat(): minor style fixes

(cherry picked from commit 3d59b93b207e5008ea0b79b38268243abf225546)

4 months agokern_openat(): rename fd argument to dirfd
Konstantin Belousov [Sat, 20 Jan 2024 21:41:12 +0000 (23:41 +0200)]
kern_openat(): rename fd argument to dirfd

(cherry picked from commit 2a284076ecb4d22928b78249070efa46153666ff)

4 months agoinet(3): clarify syntax accepted by inet_pton
Mike Karels [Sat, 27 Jan 2024 15:40:07 +0000 (09:40 -0600)]
inet(3): clarify syntax accepted by inet_pton

The section INTERNET ADDRESSES describes the acceptance of dotted
values with varying number of parts in multiple bases.  This applies
to inet_aton and inet_addr, but not to inet_pton.  Clarify this
section by listing the functions to which this applies.  Move the
description of what inet_pton accepts into this section from STANDARDS,
where it is easily missed.  Rename the section to clarify that it
applies only to IPv4.  (inet_pton also works with IPv6.)

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

(cherry picked from commit 9231c42127bf8e47588169ecc395f57cae0e15fb)

4 months agoarm64/RPI: enable powerd by default on arm64-aarch64-RPI images
Mike Karels [Fri, 5 Jan 2024 19:41:24 +0000 (13:41 -0600)]
arm64/RPI: enable powerd by default on arm64-aarch64-RPI images

Most 64-bit Raspberry Pi models have a variable processor clock
speed that defaults to a slow speed (e.g. 600 MHz for a nominal
1.5 GHz clock).  This results in everything running slowly unless
or until powerd is started, and FreeBSD is then thought to be slow.
Enable powerd by default in /etc/rc.conf on the arm64-aarch64-RPI
images.  Tested on Raspberry Pi 3B+ and 4B so far.

PR: 256836
Reviewed by: rgrimes
Differential Revision: https://reviews.freebsd.org/D43296

(cherry picked from commit 4347ef60501f2a55ad31f7532ad903b81f3af18f)

4 months agoAdd libllvm and liblldb source files to enable WITH_ASAN build
Dimitry Andric [Sat, 27 Jan 2024 21:51:08 +0000 (22:51 +0100)]
Add libllvm and liblldb source files to enable WITH_ASAN build

This is another part of fixing the WITH_ASAN build. Some additional
source files had to be added to libllvm and liblldb, since the ASan
instrumentation causes symbols in those files to be referenced.

Reported by: markj
PR: 276597
MFC after: 3 days

(cherry picked from commit 5c38ea60a04199dae2c6e5db82461e7275c7def6)

4 months agomsun: remove fabs from Symbol.map, and adjust comment
Dimitry Andric [Sat, 27 Jan 2024 21:24:38 +0000 (22:24 +0100)]
msun: remove fabs from Symbol.map, and adjust comment

We have s_fabs.c, but fabs(3) is already provided by libc due to
historical reasons, so it is not compiled into libm. When the linker
does not use --undefined-version, this leads to a complaint about the
symbol being nonexistent, so remove it from Symbol.map.

While here, adjust the comment about some functions being supplied by
libc: while it is true that all these are indeed in libc, libm still
includes its own versions of frexp(3), isnan(3), isnanf(3), and
isnanl(3).

Reported by: Steve Kargl <sgk@troutmask.apl.washington.edu>
MFC after: 3 days

(cherry picked from commit d04e03c19a8d7660ea36f62720eef9bc96b69889)

4 months agoMerge commit 16a1ef86cbc5 from llvm-project (by David CARLIER):
Dimitry Andric [Sat, 27 Jan 2024 21:48:58 +0000 (22:48 +0100)]
Merge commit 16a1ef86cbc5 from llvm-project (by David CARLIER):

  [compiler-rt] remove hexdump interception. (#79378)

  a freebsd dev member reported a symbol conflict and intercepting this
  had little value anyway.

This is one part of fixing the WITH_ASAN build. Some executables in the
base system define their own hexdump() symbol, which would otherwise
conflict with the ASan-intercepted one.

Reported by: markj
PR: 276597
MFC after: 3 days

(cherry picked from commit 31aedef26fc0613f5d61204c624451d57e716ed9)

4 months agokern: tty: recanonicalize the buffer on ICANON/VEOF/VEOL changes
Kyle Evans [Tue, 16 Jan 2024 02:55:59 +0000 (20:55 -0600)]
kern: tty: recanonicalize the buffer on ICANON/VEOF/VEOL changes

Before this change, we would canonicalize any partial input if the new
local mode is not ICANON, but that's about it.  If we were switching
from -ICANON -> ICANON, or if VEOF/VEOL changes, then our internal canon
accounting would be wrong.

The main consequence of this is that in ICANON mode, we would
potentially hang a read(2) longer if the new VEOF/VEOL appears later in
the buffer, and FIONREAD would be similarly wrong as a result.

Reviewed by: kib

(cherry picked from commit 522083ffbd1ab9b485861750e889d606dc75ed0a)
(cherry picked from commit 5738d741fb796c1f0a6b5c2157af7de58104ac97)

4 months agokern: pts: do not special case closed slave side
Kyle Evans [Tue, 16 Jan 2024 02:55:59 +0000 (20:55 -0600)]
kern: pts: do not special case closed slave side

This would previously return 1 if the slave side of the pts was closed
to force an application to read() from it and observe the EOF, but it's
not clear why and this is inconsistent both with how we handle devices
with similar mechanics (like pipes) and also with other kernels, such as
OpenBSD/NetBSD and Linux.

PR:             239604
Reviewed by: kib

(cherry picked from commit 30189156d325fbcc9d1997d791daedc9fa3bed20)

4 months agokern: tty: fix EOF handling for canonical reads
Kyle Evans [Tue, 16 Jan 2024 02:55:58 +0000 (20:55 -0600)]
kern: tty: fix EOF handling for canonical reads

If the read(2) buffer is one byte short of an EOF, then we'll end up
reading the line into the buffer, then re-entering and seeing an EOF at
the beginning of the inq, assuming it's a zero-length line.

Fix this corner-case by searching one more byte than we have available
for an EOF.  If we found it, then we'll trim it here; otherwise, we'll
limit our read to just the space we have in the out buffer and the next
read(2) will (potentially) read the remainder of the line.

Fix FIONREAD while we're here to match what an application can expect
read(2) to return -- scan for the first break character in the part of
the input that's been canonicalized, we'll never return more than that.

PR: 276220
Reviewed by: cy, imp (both previous version), kib

(cherry picked from commit d51dac5f1370bdca1ea20c6b48cdea463f6f5dda)

4 months agoamdsmn(4), amdtemp(4): add support for Zen 4
Akio Morita [Tue, 1 Aug 2023 20:32:12 +0000 (22:32 +0200)]
amdsmn(4), amdtemp(4): add support for Zen 4

Zen 4 support, tested on Ryzen 9 7900

Reviewed by: imp (previous version), mhorne
Approved by: mhorne
Obtained from: http://jyurai.ddo.jp/~amorita/diary/?date=20221102#p01
Differential Revision: https://reviews.freebsd.org/D41049

(cherry picked from commit 323a94afb6236bcec3a07721566aec6f2ea2b209)

4 months agobhyve: Avoid underflows when handling remote commands
Mark Johnston [Tue, 23 Jan 2024 16:40:40 +0000 (11:40 -0500)]
bhyve: Avoid underflows when handling remote commands

Reviewed by: corvink, jhb
MFC after: 1 week
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D43480

(cherry picked from commit cfa2c78aee859bfc6549951bb6a36085fdd374e8)

4 months agoperiodic: Make daily diff(1) output as small is possible
Michael Osipov [Fri, 24 Nov 2023 09:26:41 +0000 (10:26 +0100)]
periodic: Make daily diff(1) output as small is possible

Make, by default, daily diff(1) ignore whitespace changes and the unified output
a context of zero (0) lines. This reduces output of unrelated lines in e-mails
delivered to root.

PR: 270266
Approved by: jrm (mentor), karels
MFC after: 1 month
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D42762

(cherry picked from commit e2f6bafc3887c7752986526f3758525d24701fce)

4 months agoperiodic: Make daily diff(1) flags configurable with daily_diff_flags
Michael Osipov [Fri, 24 Nov 2023 09:26:41 +0000 (10:26 +0100)]
periodic: Make daily diff(1) flags configurable with daily_diff_flags

PR: 270266
Approved by: jrm (mentor), karels
MFC after: 1 month
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D42900

(cherry picked from commit 15e35d058cff847d1a7bc671fcf48b99f5d2f73b)

4 months agoperiodic: Make security diff(1) output as small is possible
Michael Osipov [Fri, 24 Nov 2023 09:26:41 +0000 (10:26 +0100)]
periodic: Make security diff(1) output as small is possible

Make, by default, security diff(1) produce a unified output with a context of
zero (0) lines. This reduces output of unrelated lines in e-mails delivered
to root.

PR: 270266
Approved by: jrm (mentor), karels
MFC after: 1 month
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D43071

(cherry picked from commit 3aa71ea7c231a4e60a7e1b9b677e379e17432fc8)

4 months agoreleng-gce: Advertise the availability of UEFI support in GCE images.
Xin LI [Sat, 27 Jan 2024 03:09:39 +0000 (19:09 -0800)]
releng-gce: Advertise the availability of UEFI support in GCE images.

The amd64 and arm64 images supported UEFI, mark it as so users can take
advantage of UEFI boot on GCE.  This is already done on FreeBSD
14.0-RELEASE but never codified into the release tools (and should).

PR: conf/276532
Reviewed by: lwhsu
Differential Revision: https://reviews.freebsd.org/D43557

(cherry picked from commit 72dd306e44bc531fa723f4cdb631cb63cc5f09cb)

4 months agowg: detach bpf upon destroy as well
Aaron LI [Mon, 22 Jan 2024 16:18:56 +0000 (10:18 -0600)]
wg: detach bpf upon destroy as well

bpfattach() is called in wg_clone_create(), but the bpfdetach() is
missing from wg_close_destroy().  Add the missing bpfdetach() to avoid
leaking both the associated bpf bits as well as the ifnet that bpf will
hold a reference to.

PR: 276526

(cherry picked from commit 43be2d7aaf25b719aec8f49aab110c0061f1edec)

4 months agoif_wg: fix access to noise_local->l_has_identity and l_private
Aaron LI [Wed, 17 Jan 2024 23:29:23 +0000 (23:29 +0000)]
if_wg: fix access to noise_local->l_has_identity and l_private

These members are protected by the identity lock, so rlock it in
noise_remote_alloc() and then assert that we have it held to some extent
in noise_precompute_ss().

PR: 276392

(cherry picked from commit 7a4d1d1df0b2e369adcb32aea9ef8c180f885751)

4 months agoif_wg: fix erroneous calculation in calculate_padding() for p_mtu == 0
Aaron LI [Wed, 17 Jan 2024 23:29:23 +0000 (23:29 +0000)]
if_wg: fix erroneous calculation in calculate_padding() for p_mtu == 0

In practice this is harmless; only keepalive packets may realistically have
p_mtu == 0, and they'll also have no payload so the math works out the same
either way.  Still, let's prefer technical accuracy and calculate the amount
of padding needed rather than the padded length...

PR: 276363

(cherry picked from commit b891f61ef538a4e9b4658b4b756635c8036a5788)

4 months agocondvar: Fix a user-after-free in _cv_wait() when ktrace is enabled
Mark Johnston [Mon, 15 Jan 2024 17:29:02 +0000 (12:29 -0500)]
condvar: Fix a user-after-free in _cv_wait() when ktrace is enabled

When a thread wakes up after sleeping on a CV, it must not dereference
the CV structure, as it may already have been freed.  At least ZFS
relies on this invariant, see commit
c636f94bd2ff15be5b904939872b4bce31456c18 for example.

Thus, when logging context-switch events, copy the wmesg into a stack
buffer while it is still safe to do so, and log that after waking up.

While here, move the initial ktrcsw() call later, after assertions and
the SCHEDULER_STOPPED_TD() condition are checked.

Reported by: syzkaller
Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D43450

(cherry picked from commit a5ef95cd228e43bcc459a5c8a9911e57888ba5fd)

4 months agocondvar: Clean up condvar.h a bit
Mark Johnston [Mon, 15 Jan 2024 17:27:11 +0000 (12:27 -0500)]
condvar: Clean up condvar.h a bit

- Remove a typedef that has been unused for a long time.
- Remove a LOCORE guard.  MI headers like condvar.h don't need such a
  guard in general.
- Move a forward declaration into the _KERNEL block.
- Add a types.h include to make the file self-contained.

Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D43449

(cherry picked from commit 61b0092be751b8241b65cc14e4167d431f1e5ad8)

4 months agorc.d/kdc: Support start of MIT krb5kdc
Cy Schubert [Sat, 20 Jan 2024 13:52:35 +0000 (05:52 -0800)]
rc.d/kdc: Support start of MIT krb5kdc

Some users wishing to use the MIT krb5kdc have discovered the
kdc script workaround applied to the MIT krb5 ports is insufficient.
Let's build into this rc script the smarts to determine whether
base or ports Hiemdal kdc is being invoked or the MIT krb5kdc.

While at it, remove kdc_start_precmd(). This will simplify a future
jail patch.

Suggested by: netchild
Original patch: netchild
Reviewed by: emaste, netchild
Differential Revision: https://reviews.freebsd.org/D43523

(cherry picked from commit 91f78c32befa08bf4010db7afd4407277a3e585f)

4 months agobhyve nvme: Add NQN value
Chuck Tuffli [Thu, 12 Oct 2023 22:04:17 +0000 (15:04 -0700)]
bhyve nvme: Add NQN value

Add a NVMe Qualified Name (NQN) to the Controller Data structure using
the "first format" (i.e., "... used by any organization that owns a
domain name" Section 7.9 NVM-Express 1.4c 2021.06.28 Ratified).

This avoids a Linux kernel warning about a missing or invalid NQN.

(cherry picked from commit 32557d16e2c3c24c04eccfafd895e1514dc65b35)

4 months agoFix issue with Linux guest XHCI tablet probing.
Peter Grehan [Sun, 14 Jan 2024 11:27:12 +0000 (21:27 +1000)]
Fix issue with Linux guest XHCI tablet probing.

The USB3 spec mandates that the device-descriptor max packet size
be 512 bytes, which requires a field size of 9 since it is a
power-of-2.

Linux kernels recently started validating this field, resulting in
the table not being probed and the cursor not working in bhyve VNC.

PR: 275760

(cherry picked from commit 0c243cd4a3671bf728f33378ac593c08d8367bc2)

4 months agohv_kbd: Fix build with EVDEV_SUPPORT kernel option disabled.
Vladimir Kondratyev [Thu, 22 Apr 2021 22:13:25 +0000 (01:13 +0300)]
hv_kbd: Fix build with EVDEV_SUPPORT kernel option disabled.

Reported by: olivier
PR: 268653

(cherry picked from commit 55eb41bb1fb69429330ea415fb463735ae08da64)

4 months agofsck_msdosfs: do not call checksize() if the cluster is bad
John F. Carr [Sat, 20 Jan 2024 23:18:18 +0000 (01:18 +0200)]
fsck_msdosfs: do not call checksize() if the cluster is bad

PR: 276464

(cherry picked from commit deeb1d34024b3f843d965cdf204c745165c9bac0)

4 months agopthread_attr_get_np(3): Revamp
Olivier Certner [Fri, 5 Jan 2024 13:14:48 +0000 (14:14 +0100)]
pthread_attr_get_np(3): Revamp

Fix and more thoroughly describe the attributes object lifecycle.

Also, correct the text about which attributes' values are reported.

Add the ENOMEM error.

While here, rephrase unclear passages, add references and fix the
example's style.

Reviewed by:            kib, emaste
Approved by:            emaste (mentor)
MFC after:              2 weeks
Sponsored by:           The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D43330

(cherry picked from commit 6211cd4be32dfdc51b5ac452d4ead98a36ec42a6)

Approved by:            markj (mentor)

4 months agopthread_attr_get_np(): Use malloc(), report ENOMEM, don't tamper on error
Olivier Certner [Thu, 4 Jan 2024 17:45:52 +0000 (18:45 +0100)]
pthread_attr_get_np(): Use malloc(), report ENOMEM, don't tamper on error

Similarly as in the previous commit, using calloc() instead of malloc()
is useless here in the regular case since the subsequent call to
cpuset_getaffinify() is going to completely fill the allocated memory.

However, there is an additional complication.  This function tries to
allocate memory to hold the cpuset if it previously wasn't, and does so
before the thread lock is acquired, which can fail on a bad thread ID.
In this case, it is necessary to deallocate the memory allocated in this
function so that the attributes object appears unmodified to the caller
when an error is returned.  Without this, a subsequent call to
pthread_attr_getaffinity_np() would expose uninitialized memory (not
a security problem per se, since it comes from the same process) instead
of returning a full mask as it would before the failing call to
pthread_attr_get_np().  So the caller would be able to notice a change
in the state of the attributes object even if pthread_attr_get_np()
reported failure, which would be quite surprising.  A similar problem
that could occur on failure of cpuset_setaffinity() has been fixed.

Finally, we shall always report memory allocation failure.  This already
goes for pthread_attr_init(), so, if for nothing else, just be
consistent.

Reviewed by:            emaste, kib
Approved by:            emaste (mentor)
MFC after:              2 weeks
Sponsored by:           The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D43329

(cherry picked from commit aadb4a1b3fd185d547087f6eafca6ce0b4df3291)

Approved by:            markj (mentor)

4 months agolibhtr: pthread_attr_setaffinity_np(): Replace calloc() with malloc()
Olivier Certner [Thu, 4 Jan 2024 15:20:50 +0000 (16:20 +0100)]
libhtr: pthread_attr_setaffinity_np(): Replace calloc() with malloc()

Using calloc() instead of malloc() is useless here since the allocated
memory is to be wholly crushed by the memcpy() call that follows.

Suggested by:           kib
Reviewed by:            emaste, kib
Approved by:            emaste (mentor)
MFC after:              2 weeks
Differential Revision:  https://reviews.freebsd.org/D43328

(cherry picked from commit 15bb0300eeca233827a6a13cd2ed883e0034979d)

Approved by:            markj (mentor)

4 months agolibthr: thr_attr.c: More style and clarity fixes
Olivier Certner [Thu, 4 Jan 2024 15:10:40 +0000 (16:10 +0100)]
libthr: thr_attr.c: More style and clarity fixes

The change of argument for sizeof() (from a type to an object) is to be
consistent with the change done for the malloc() code just above in the
preceding commit touching this file.

Consider bit flags as integers and test whether they are set with an
explicit comparison with 0.

Use an explicit flag value (PTHREAD_SCOPE_SYSTEM) in place of a variable
that has this value at point of substitution.

All other changes are straightforward.

Suggested by:           kib
Reviewed by:            kib
Approved by:            emaste (mentor)
MFC after:              2 weeks
Differential Revision:  https://reviews.freebsd.org/D43327

(cherry picked from commit 4d312aa051414ad77d3515f258230d01ad11d6dc)

Approved by:            markj (mentor)

4 months agotop: Avoid printing a blank line when the ZFS ARC is empty
Mark Johnston [Thu, 11 Jan 2024 14:58:31 +0000 (09:58 -0500)]
top: Avoid printing a blank line when the ZFS ARC is empty

PR: 275994
MFC after: 2 weeks

(cherry picked from commit 1f62718d8ba26d813d8c2e826ac5f4caee4c6730)

4 months agonet80211: Fix a typo in a source code comment
Gordon Bergling [Mon, 22 Jan 2024 20:54:36 +0000 (21:54 +0100)]
net80211: Fix a typo in a source code comment

- s/recevied/received/

(cherry picked from commit c1ada39783109c496fde853cc2fe32f31a8f7516)

4 months agoif_llatbl: Fix a typo in a KASSERT message
Gordon Bergling [Sat, 20 Jan 2024 20:00:22 +0000 (21:00 +0100)]
if_llatbl: Fix a typo in a KASSERT message

- s/entires/entries/

(cherry picked from commit b4c94968d1bd1ffdd43976b0315e2b6c2b620ee2)

4 months agometa2deps.py: Fix a typo in a source code comment
Gordon Bergling [Mon, 22 Jan 2024 21:00:36 +0000 (22:00 +0100)]
meta2deps.py: Fix a typo in a source code comment

- s/follwing/following/

(cherry picked from commit ad92f3d9d0b56ee723271152cec9174f74e17cb9)

4 months agonetinet6: Fix two typos in source code comments
Gordon Bergling [Mon, 22 Jan 2024 20:48:34 +0000 (21:48 +0100)]
netinet6: Fix two typos in source code comments

- s/adddress/address/

(cherry picked from commit 496432f192165b8700da4b0ab8ebdd253002e265)

4 months agofusefs(5): Fix a typo in a SDT probe
Gordon Bergling [Sat, 20 Jan 2024 16:24:22 +0000 (17:24 +0100)]
fusefs(5): Fix a typo in a SDT probe

- s/userpace/userspace/

(cherry picked from commit 6f0da017c973f40c1bc70552c922c500a0a8c858)

4 months agonetpfil: Fix a typo in a source code comment
Gordon Bergling [Mon, 22 Jan 2024 20:50:57 +0000 (21:50 +0100)]
netpfil: Fix a typo in a source code comment

- s/strucutre/structure/

(cherry picked from commit cde9ec6a451d22ad65fbe602dc57135177c0a865)

4 months agoaic7xxx: Fix a typo in a kernel message
Gordon Bergling [Sat, 20 Jan 2024 21:01:10 +0000 (22:01 +0100)]
aic7xxx: Fix a typo in a kernel message

- s/recevied/received/

(cherry picked from commit 54e047b13baaa5eb613e98991f807e7b6f893f78)

4 months agobce(4): Fix a typo in a kernel message
Gordon Bergling [Sat, 20 Jan 2024 19:10:21 +0000 (20:10 +0100)]
bce(4): Fix a typo in a kernel message

- s/adddress/address/

(cherry picked from commit e1c0d368d630cce01691e1967ada9f36d6b8c751)

4 months agobootpd(8): Fix a typo in a source code comment
Gordon Bergling [Mon, 22 Jan 2024 20:46:31 +0000 (21:46 +0100)]
bootpd(8): Fix a typo in a source code comment

- s/adddress/address/

(cherry picked from commit d04df664776b436f712051520d48f84be93ab269)

4 months agousb: Fix a typo in a source code comment
Gordon Bergling [Mon, 22 Jan 2024 20:57:06 +0000 (21:57 +0100)]
usb: Fix a typo in a source code comment

- s/recevied/received/

(cherry picked from commit d743711016298046ca77c5661bab41739396a180)

4 months agovmd(4): Fix typos in source code comments
Gordon Bergling [Mon, 22 Jan 2024 20:55:33 +0000 (21:55 +0100)]
vmd(4): Fix typos in source code comments

- s/harwdare/hardware/

(cherry picked from commit b2c48aa4d19268610191a0b7d7b76d01d28b0a13)

4 months agotcp_fastopen: Fix a typo in a source code comment
Gordon Bergling [Mon, 22 Jan 2024 20:49:47 +0000 (21:49 +0100)]
tcp_fastopen: Fix a typo in a source code comment

- s/posession/possession/

(cherry picked from commit 9b035689f15fc4aec96f9c18c6c86bd615faed2f)

4 months agoaic7xxx: Fix two typos in source code comments
Gordon Bergling [Mon, 22 Jan 2024 20:47:23 +0000 (21:47 +0100)]
aic7xxx: Fix two typos in source code comments

- s/recevied/received/

(cherry picked from commit b971c51a4d9498c26079fd8229f7af6ef1585020)

4 months agortsock: Fix a typo in a source code comment
Gordon Bergling [Mon, 22 Jan 2024 20:53:21 +0000 (21:53 +0100)]
rtsock: Fix a typo in a source code comment

- s/adddress/address/

(cherry picked from commit ab6d773dbf926e4f92e37b67a85c3290cfb90723)

4 months agovirtio(4): Fix a typo in a source code comment
Gordon Bergling [Mon, 22 Jan 2024 20:59:06 +0000 (21:59 +0100)]
virtio(4): Fix a typo in a source code comment

- s/recevied/received/

(cherry picked from commit 97a4045aaf36079f54ee05a8cb314b8a90f20af8)

4 months agogjournal(8): Fix a typo in a sysctl description
Gordon Bergling [Sat, 20 Jan 2024 19:58:08 +0000 (20:58 +0100)]
gjournal(8): Fix a typo in a sysctl description

- s/entires/entries/

(cherry picked from commit 3fb6adb07915b6759892c937fe4ae8a07ed1a029)

4 months agonetlink(4): Fix a typo in a source code comment
Gordon Bergling [Mon, 22 Jan 2024 20:52:16 +0000 (21:52 +0100)]
netlink(4): Fix a typo in a source code comment

- s/permament/permanent/

(cherry picked from commit c90f1ed104606f5a691ea2defc5711ca9d28fcc7)

4 months agomsdosfs_remount_ro(): correct vfs_unbusy() loop
Konstantin Belousov [Fri, 19 Jan 2024 23:50:48 +0000 (01:50 +0200)]
msdosfs_remount_ro(): correct vfs_unbusy() loop

PR: 276408

(cherry picked from commit 4b3ffc5918b9968ea6ddee6f6cdf3538072e5ef4)

4 months agomsdosfs_integrity_error(): plug possible busy leak
Konstantin Belousov [Thu, 18 Jan 2024 15:35:56 +0000 (17:35 +0200)]
msdosfs_integrity_error(): plug possible busy leak

(cherry picked from commit 13ccb04589e2c5c840e19b407a59e44cb70ac28e)

4 months agomsdosfs_rename(): implement several XXXs about downgrading to ro
Konstantin Belousov [Wed, 17 Jan 2024 23:05:55 +0000 (01:05 +0200)]
msdosfs_rename(): implement several XXXs about downgrading to ro

(cherry picked from commit 661db9b390b4a40418d838876b58d2186d72aabf)

4 months agomsdosfs_rename(): handle errors from msdosfs_lookup_ino()
Konstantin Belousov [Wed, 17 Jan 2024 22:55:05 +0000 (00:55 +0200)]
msdosfs_rename(): handle errors from msdosfs_lookup_ino()

PR: 276408

(cherry picked from commit be0df84849ff3e8fb5ec65176ffde88dbefdc434)

4 months agosysctl vm.objects/vm.swap_objects: do not fill vnode info if jailed
Konstantin Belousov [Sat, 13 Jan 2024 01:46:04 +0000 (03:46 +0200)]
sysctl vm.objects/vm.swap_objects: do not fill vnode info if jailed

(cherry picked from commit 38f5f2a4af5daeec7f13d39cad1ff4dc90da52d8)

4 months agoperiodic: Fix periodic reports when log files are not compressed.
Yoshihiro Takahashi [Wed, 10 Jan 2024 11:48:56 +0000 (20:48 +0900)]
periodic: Fix periodic reports when log files are not compressed.

The modern zcat(1) is capable of handling compressed and uncompressed
text files, so we can simply use zcat command.

PR: 253168
Reviewed by: delphij
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D43357

(cherry picked from commit 1fa4ddcc6de6a0c46416f719a5b7efa1169f51ce)

4 months ago_umtx_op.2: Fix a typo in the manual page
Gordon Bergling [Sat, 20 Jan 2024 16:26:34 +0000 (17:26 +0100)]
_umtx_op.2: Fix a typo in the manual page

- s/interpeted/interpreted/

(cherry picked from commit b2ec175fcaac90fc6a1caf066656eaa092f32611)

4 months agoatse(4): Fix a typo in a source code comment
Gordon Bergling [Sat, 20 Jan 2024 16:35:51 +0000 (17:35 +0100)]
atse(4): Fix a typo in a source code comment

- s/addresss/address/

(cherry picked from commit 2b1e4e5be3047411df5e4d5442aa7de6489a0309)

4 months agonet: Fix two typos in source code comments
Gordon Bergling [Sat, 20 Jan 2024 16:28:12 +0000 (17:28 +0100)]
net: Fix two typos in source code comments

- s/strucutres/structures/

(cherry picked from commit a2fcd3af5c8ad43e8d2c7b89f7bbe3edf2f22e2a)

4 months agonetgraph: Fix two typos in source code comments
Gordon Bergling [Sat, 20 Jan 2024 16:22:28 +0000 (17:22 +0100)]
netgraph: Fix two typos in source code comments

- s/bascially/basically/
- s/simpliest/simplest/

(cherry picked from commit 7037ebe63dd1a2ff2a818359c58ca24b6d44388a)

4 months agonetpfil: Fix two typos in source code comments
Gordon Bergling [Sat, 20 Jan 2024 16:30:57 +0000 (17:30 +0100)]
netpfil: Fix two typos in source code comments

- s/withing/within/

(cherry picked from commit 938918a9f478e94fbe65ba84510e4755024560be)

4 months agovmware: Fix a typo in a source code comment
Gordon Bergling [Sat, 20 Jan 2024 16:33:27 +0000 (17:33 +0100)]
vmware: Fix a typo in a source code comment

- s/withing/within/

(cherry picked from commit 623848af604116aa33bc8a66d2ac45b4cbaccfd8)

4 months agousb: Fix two typos in source code comments
Gordon Bergling [Sat, 20 Jan 2024 16:32:20 +0000 (17:32 +0100)]
usb: Fix two typos in source code comments

- s/bascially/basically/
- s/assistence/assistance/

(cherry picked from commit f5e3329a5a480aa1b2904106b2fdfd999439455b)

4 months agociss(4): Fix a typo in a source code comment
Gordon Bergling [Sat, 20 Jan 2024 16:34:25 +0000 (17:34 +0100)]
ciss(4): Fix a typo in a source code comment

- s/strucutre/structure/

(cherry picked from commit ced92d000a9435745ca2891734e6e37ab1c5e873)

4 months agotcp_hpts: Fix a typo of a function name in a comment
Gordon Bergling [Sat, 20 Jan 2024 16:29:28 +0000 (17:29 +0100)]
tcp_hpts: Fix a typo of a function name in a comment

- s/tcp_ouput/tcp_output/

(cherry picked from commit ef0ac0a1ad6750291b881203030384b7f7241efb)

4 months agoPCI_IOV_INIT.9: Fix a typo in the manual page
Gordon Bergling [Sat, 20 Jan 2024 19:20:32 +0000 (20:20 +0100)]
PCI_IOV_INIT.9: Fix a typo in the manual page

- s/infrastucture/infrastructure/

(cherry picked from commit bce295fcbe533d46d2f600168403c7968599b86b)

4 months agodevfs(5): Fix a typo in a source code comment
Gordon Bergling [Sat, 20 Jan 2024 16:25:45 +0000 (17:25 +0100)]
devfs(5): Fix a typo in a source code comment

- s/interpeted/interpreted/

(cherry picked from commit 7cf293536ebacc92150be12e0be928500e670610)

4 months agosigfastblock.2: Fix a typo in the manual page
Gordon Bergling [Sat, 20 Jan 2024 18:54:33 +0000 (19:54 +0100)]
sigfastblock.2: Fix a typo in the manual page

- s/successfull/successful/

(cherry picked from commit a70008e95b907336bddbcc2aa9d567df6e3a41b6)

4 months agopkru.3: Fix a typo in the manual page
Gordon Bergling [Sat, 20 Jan 2024 18:55:08 +0000 (19:55 +0100)]
pkru.3: Fix a typo in the manual page

- s/successfull/successful/

(cherry picked from commit 8593b5b2addf91987f81ebac0d8b2e51207e4793)

4 months agoinpcb: Allow SO_REUSEPORT_LB to be used in jails
Mark Johnston [Wed, 2 Nov 2022 17:08:07 +0000 (13:08 -0400)]
inpcb: Allow SO_REUSEPORT_LB to be used in jails

Currently SO_REUSEPORT_LB silently does nothing when set by a jailed
process.  It is trivial to support this option in VNET jails, but it's
also useful in traditional jails.

This patch enables LB groups in jails with the following semantics:
- all PCBs in a group must belong to the same jail,
- PCB lookup prefers jailed groups to non-jailed groups

This is a straightforward extension of the semantics used for individual
listening sockets.  One pre-existing quirk of the lbgroup implementation
is that non-jailed lbgroups are searched before jailed listening
sockets; that is preserved with this change.

Discussed with: glebius
MFC after: 1 month
Sponsored by: Modirum MDPay
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D37029

(cherry picked from commit d93ec8cb1324d04d7cae19fb7fa98ade2ff33c80)

4 months agoinpcb: Remove a PCB from its LB group upon a subsequent error
Mark Johnston [Wed, 2 Nov 2022 17:05:14 +0000 (13:05 -0400)]
inpcb: Remove a PCB from its LB group upon a subsequent error

If a memory allocation failure causes bind to fail, we should take the
inpcb back out of its LB group since it's not prepared to handle
connections.

Reviewed by: glebius
MFC after: 2 weeks
Sponsored by: Modirum MDPay
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D37027

(cherry picked from commit a152dd863418638c3eb08b5c101b10b82f8072f5)