FreeBSD/src 749b3b2tests/sys/file path_test.c

path_test: adjust test for open(O_PATH | O_CREAT)

Instead of failing, it must succeed now.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D48332
DeltaFile
+6-2tests/sys/file/path_test.c
+6-21 files

FreeBSD/src cc0d806sys/kern vfs_syscalls.c

open(2): allow O_PATH | O_CREAT

There is no reason to disallow creating the file opened for path.
More, it might be a useful feature together with O_EXCL.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D48332
DeltaFile
+1-1sys/kern/vfs_syscalls.c
+1-11 files

FreeBSD/src fd94571sys/netinet raw_ip.c

rawip: Take the inpcb lock when appropriate in rip_ctloutput()

Reviewed by:    glebius
MFC after:      1 week
Sponsored by:   Klara, Inc.
Sponsored by:   Stormshield
Differential Revision:  https://reviews.freebsd.org/D48344
DeltaFile
+4-2sys/netinet/raw_ip.c
+4-21 files

FreeBSD/src c945c9dsys/amd64/include vmm.h, sys/amd64/vmm vmm.c vmm_dev_machdep.c

amd64/vmm: Rename vm_get_vmspace() to vm_vmspace()

For consistency with other vm accessors.

No functional change intended.

Reviewed by:    corvink
Differential Revision:  https://reviews.freebsd.org/D48268
DeltaFile
+1-2sys/amd64/vmm/vmm.c
+1-1sys/amd64/include/vmm.h
+1-1sys/amd64/vmm/vmm_dev_machdep.c
+3-43 files

FreeBSD/src b09fe08sys/amd64/vmm vmm_mem.c vmm.c

amd64/vmm: Remove vmm_mem_init()

It is a no-op and doesn't exist on other platforms.  As part of some
work to deduplicate vmm code, just remove it.

No functional change intended.

Reviewed by:    corvink
Differential Revision:  https://reviews.freebsd.org/D48267
DeltaFile
+0-7sys/amd64/vmm/vmm_mem.c
+0-6sys/amd64/vmm/vmm.c
+0-1sys/amd64/vmm/vmm_mem.h
+0-143 files

FreeBSD/src 19cb383share/man/man4 vmm.4

vmm.4: Update to mention non-amd64 platforms

Most of the text here relates to PCI passthrough, which is still
amd64-only, but we should still document supported platforms.

While here, remove the comment that vmm.ko has to be loaded at boot-time
for passthrough, as devctl makes it possible to detach host drivers on
the fly.  I'm not aware of any other reason to require vmm.ko to be
loaded at boot.

Reviewed by:    br, andrew
Differential Revision:  https://reviews.freebsd.org/D48263
DeltaFile
+16-7share/man/man4/vmm.4
+16-71 files

FreeBSD/src 215c8b7sys/riscv/vmm vmm.c

riscv/vmm: Make vcpu sleep periods consistent with other platforms

There's no apparent reason for the difference here, so let's be
consistent to make merging easier.

Tested by:      br
DeltaFile
+2-3sys/riscv/vmm/vmm.c
+2-31 files

FreeBSD/src 080f68dsys/dev/mlx5/mlx5_accel mlx5_ipsec_fs.c ipsec.h, sys/dev/mlx5/mlx5_en mlx5_en_flow_table.c

mlx5_core: Add steering support for IPsec with IPv6

ipv6 flow tables were not connected to previous FS tables.
Created an additional table to serve as IPsec RX root.
This table has 2 rules for redirecting the received packets
to ipv4/ipv6 based on the IP family in the packet header.

Sponsored by:      NVidia networking
DeltaFile
+145-12sys/dev/mlx5/mlx5_accel/mlx5_ipsec_fs.c
+2-2sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c
+2-0sys/dev/mlx5/mlx5_accel/ipsec.h
+149-143 files

FreeBSD/src cfd8866share/man/man9 cdefs.9

cdefs.h: Add warning about defining __BSD_VISIBLE and friends

Undefined things happen if users define these macros, be more explicit
about documenting that.

Sponsored by:           Netflix
DeltaFile
+2-1share/man/man9/cdefs.9
+2-11 files

FreeBSD/src 6fc164cshare/man/man9 cdefs.9

cdefs.9: Note only one programming environment at a time

Only one programming environment at a time can be defined at a
time. Posix states that when defining _POSIX_C_SOURCE, the system
headers must define only the macros, variables, and functions that a
given standard level defines. Selecting a different macro along with
this is fundamentally incompatible with that.

Sponsored by:           Netflix
DeltaFile
+2-1share/man/man9/cdefs.9
+2-11 files

FreeBSD/src 02ebbc7lib/libc/string swab.c

swab: Fix implementation to support overlapping copies

A number of image processing packages assume that swab() can handle to
and from being the same. However, POSIX.1 states that overlapping
buffers produces undefined results. Our old implementation would produce
coherent results, but the recent change to the musl-inspired code does
not. Since there's complaints in the forums for these image processing
packages for musl and now FreeBSD, update the algorithm to just read a
word at a time and bswap16 the results. All FreeBSD's architecutres
support unaligned access in userland, and swab is not used in the kernel
(g_part_apm has its own copy), so opt for even simpler code that's
easier to understand. This makes the overlapping behavior match i386 again,
since its assembler routine for swab handles overlapping correctly.

PR: 283698
Sponsored by: Netflix
Reviewed by:    nwhitehorn
Differential Revision:  https://reviews.freebsd.org/D48259
DeltaFile
+10-7lib/libc/string/swab.c
+10-71 files

FreeBSD/src 378a2b1sys/netipsec key.c

netipsec: Pass the right mbuf up

Note that key_spdacquire() is dead code, as the SADB_X_SPDACQUIRE
message handler is not set.

PR:             243057
MFC after:      2 weeks
DeltaFile
+1-1sys/netipsec/key.c
+1-11 files

FreeBSD/src 872686blibexec/rc rc.conf, share/man/man5 rc.conf.5

rc: Document rtadvd_flags

PR:             283696
MFC after:      1 week
DeltaFile
+9-1share/man/man5/rc.conf.5
+1-0libexec/rc/rc.conf
+10-12 files

FreeBSD/src 5bf3ac7usr.sbin/bsdinstall/scripts zfsboot

bsdinstall: Fix a typo in a comment

PR:             283507
MFC after:      1 week
DeltaFile
+1-1usr.sbin/bsdinstall/scripts/zfsboot
+1-11 files

FreeBSD/src 1c933f4sys/kern uipc_usrreq.c

unix: Be consistent about error handling for unconnected sockets

SOCK_STREAM and SOCK_SEQPACKET sockets should get the same treatment
here.

PR:             176420
MFC after:      2 weeks
DeltaFile
+1-1sys/kern/uipc_usrreq.c
+1-11 files

FreeBSD/src 8c75c15sys/kern kern_jail.c

jail: Avoid a potential use-after-free when destroying jails

prison_deref() and prison_deref_kill() have to handle the case where
destruction of a jail will release the final reference on the jail's
parent, resulting in destruction of the parent jail.  They thus maintain
a list of jails whose references have gone away; the loop at the end of
prison_deref() then goes through the list and deallocates resources
associated with each jail.  In particular, if a jail's VNET is not the
same as that of its parent, this loop destroys the VNET.

Suppose prison_deref() removes the last reference on a jail, releasing a
reference to its parent and causing the jail to be placed in the
"freeprison" list.  Suppose then that the parent jail is destroyed
before the "freeprison" list is processed.  When destroying the
now-orphaned child jail, prison_deref() derefences its parent to see
whether the child jail's VNET needs to be freed, but if this race
occurs, this is a use-after-free.

Fix the problem by using PR_VNET to decide whether the jail's VNET is to

    [7 lines not shown]
DeltaFile
+17-5sys/kern/kern_jail.c
+17-51 files

FreeBSD/src 9743e9etests/sys/kern socket_splice.c

SO_SPLICE tests: Fix a comment typo

MFC after:      1 week
Sponsored by:   Klara, Inc.
DeltaFile
+1-1tests/sys/kern/socket_splice.c
+1-11 files

FreeBSD/src e8ec280sys/netinet/tcp_stacks rack.c

TCP RACK: fix TCP_RACK_PACING_BETA socket option

Bring back the code, which was accidentally removed. While there,
indent a comment correctly.

Reviewed by:            rrs
CID:                    1540026
Fixes:                  e18b97bd63a8 ("Update to bring the rack stack with all its fixes in.")
MFC after:              1 week
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D48340
DeltaFile
+22-8sys/netinet/tcp_stacks/rack.c
+22-81 files

FreeBSD/src 061727esys/netinet/tcp_stacks bbr.c

TCP BBR: remove dead code

No functional change intended.

Reviewed by:            rrs
CID:                    1523808
MFC after:              1 week
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D48338
DeltaFile
+0-8sys/netinet/tcp_stacks/bbr.c
+0-81 files

FreeBSD/src c28fefesys/netinet/tcp_stacks bbr.c

TCP BBR: remove dead code

bw is unsigned and not zero. So it cannot be smaller than 1.
No functional change intended.

Reviewed by:            rrs, cc
CID:                    1523791
MFC after:              1 week
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D48323
DeltaFile
+0-3sys/netinet/tcp_stacks/bbr.c
+0-31 files

FreeBSD/src bb9525fsys/netinet/tcp_stacks rack.c

TCP RACK: fix TCP fast open

Do not jump to a place in the code, which requires several variables
to be set (segsize, minseg, idle, len, sb_offset), which is not true.
To avoid using these variables, start the HPTS timer explicitly.
This fix only applies to the client side using TCP fast open.

Approved by:            rrs
CID:                    1523766
CID:                    1523770
CID:                    1523786
CID:                    1523801
CID:                    1523809
MFC after:              1 week
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D48322
DeltaFile
+5-4sys/netinet/tcp_stacks/rack.c
+5-41 files

FreeBSD/src f415b2etests/sys/fs/fusefs lseek.cc

fusefs: Coverity cleanup in the lseek tests

Always check the return value of open().

Reported by:    Coverity Scan
CID:            1471118 1471133 1471215 1471896 1471901 1472116 1473799
CID:            1473879 1473996 1555269 1558044
MFC after:      2 weeks
Sponsored by:   ConnectWise
DeltaFile
+11-0tests/sys/fs/fusefs/lseek.cc
+11-01 files

FreeBSD/src 58610d1. Makefile.inc1

build: Sort distributekernel METALOG when using -DNO_ROOT

The metalog is produced by install -M, which is not inherently sorted.
This results in non-deterministic file ordering in kernel.txz. Order the
files in kernel.txz to support reproducible builds.

PR:             283214
Reviewed by:    emaste

Signed-off-by: Pat Maddox <pat at patmaddox.com>
DeltaFile
+9-11Makefile.inc1
+9-111 files

FreeBSD/src c2153a5tests/sys/fs/fusefs allow_other.cc forget.cc

fusefs: minor cleanup in the tests

Delete some unused includes and member variables.

MFC after:      2 weeks
Sponsored by:   ConnectWise
DeltaFile
+0-3tests/sys/fs/fusefs/allow_other.cc
+0-1tests/sys/fs/fusefs/forget.cc
+0-1tests/sys/fs/fusefs/io.cc
+0-1tests/sys/fs/fusefs/notify.cc
+0-64 files

FreeBSD/src b5c1f7dsys/xdr xdr_mem.c xdr_mbuf.c

xdr: use C99 initializers for xdr_ops

No functional change.
DeltaFile
+18-18sys/xdr/xdr_mem.c
+8-8sys/xdr/xdr_mbuf.c
+26-262 files

FreeBSD/src 7f39f03lib/libc/xdr xdr_rec.c

libc/xdr: remove bogus lseek(2) for xdr streams

Doing some debugging I noticed that applications using rpc(3) would often
make lseek(2) on a totally bogus file descriptor, that looks more like a
pointer.  So, what happens here is that xdrrec type xdr doesn't keep a
track of how many bytes were sent/received on the stream and tries to
obtain this number via lseek(2).  Then it adds/subtracts the offset in the
internal buffer from the obtained number.  This code originates from the
original Sun RPC import in 1994.  However, it was not a working code even
if Solaris would support lseek(2) on a socket, because it was passing not
the file descriptor, but a pointer to opaque data from upper RPC layer.
It could be that previously (before import to FreeBSD) code was correct,
but the Solaris 8 documentation says that lseek(2) on socket isn't
supported [1].  Maybe supported on older Solaris?

Anyway, this lseek(2) never worked and xdr_getpos() would always fail on
xdrrec object, until 8f55a568f69c5 in 2008 it was slightly fixed to
tolerate failure of lseek(2) and return a correct value within the small
internal buffer for XDR_ENCODE mode and a an incorrect (negative to

    [15 lines not shown]
DeltaFile
+35-34lib/libc/xdr/xdr_rec.c
+35-341 files

FreeBSD/src 73ad5afsys/arm64/conf NOTES

arm64: Unbreak LINT build

Add the recently added options SOC_ROCKCHIP and device rk8xx.
While here add options SOC_ROCKCHIP_RK3568 and device rk808/rk817
which where never added.

Fixes:  48db612d8939 ("arm64: Add a new SOC_ROCKCHIP option")
Fixes:  ad1bf74705e4 ("arm64: rockchip: Add a new rk8xx device")
DeltaFile
+5-0sys/arm64/conf/NOTES
+5-01 files

FreeBSD/src a071c76. UPDATING

UPDATING: Document recent Rockchip options and device
DeltaFile
+6-0UPDATING
+6-01 files

FreeBSD/src ad1bf74sys/arm64/conf std.rockchip, sys/conf files.arm64

arm64: rockchip: Add a new rk8xx device

This device will select the base driver for Rockchip PMIC.
While here also add a new rk808 device which selects the PMIC used for RK3399

Reviewed by:    andrew
Differential Revision:  https://reviews.freebsd.org/D48287
DeltaFile
+5-5sys/conf/files.arm64
+2-0sys/arm64/conf/std.rockchip
+7-52 files

FreeBSD/src 48db612sys/arm64/conf std.rockchip, sys/conf files.arm64 options.arm64

arm64: Add a new SOC_ROCKCHIP option

A lot of drivers are shared between all rockchip SoCs, each time we add
suppot for a new SoC we need to add the options in the files.arm64 lines.
Add a new option SOC_ROCKCHIP that will help simplify this file.

Reviewed by:    andrew
Differential Revision:  https://reviews.freebsd.org/D48286
DeltaFile
+15-15sys/conf/files.arm64
+4-3sys/conf/options.arm64
+1-0sys/arm64/conf/std.rockchip
+20-183 files