FreeBSD/src c3d2b68sys/kern kern_prot.c kern_jail.c

kern: RACCT: Keep process credentials alive via references

In system calls changing process credentials, on RACCT, calls to
racct_proc_ucred_changed() must be issued on the new credentials.
Currently, this is done after the new credentials have been installed on
the process via proc_set_cred() or proc_set_cred_enforce_proc_lim(),
which modifies 'p_ucred'.  Only the process lock guarantees that the new
credentials pointed to by 'p_ucred' cannot themselves be concurrently
modified, which would cause their 'struct ucred' to potentially lose its
last reference from the process before the call to
racct_proc_ucred_changed(), which needs one.

For better code understandability and to avoid errors in future
modifications, stop relying on proc_set_cred*() storing the passed
'struct ucred' in the process 'p_ucred' and on the process lock to avoid
the reference taken by proc_set_cred*() to vanish.  Instead, ensure that
a reference is held when racct_proc_ucred_changed() is called.

As racct_proc_ucred_changed() is actually passed explicit pointers to

    [24 lines not shown]
DeltaFile
+39-15sys/kern/kern_prot.c
+7-2sys/kern/kern_jail.c
+6-1sys/kern/kern_loginclass.c
+4-2sys/kern/kern_racct.c
+56-204 files

FreeBSD/src d05ab93sys/kern kern_prot.c

setpgid(): Fix space before TAB in herald comment

No functional change.

With this tiny change, all the file becomes whitespace-clean.

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
DeltaFile
+1-1sys/kern/kern_prot.c
+1-11 files

FreeBSD/src 5d46d11sys/kern kern_prot.c

proc_set_cred(): Allow 'newcred' to have multiple references

This is an extension needed by next commit, where some additional
reference is kept on the credentials to be set on a process in order to
keep these credentials alive even after the process lock is released (an
intervening reset of process credentials could release the reference
that the process holds).

Only 'cr_users' is incremented, as the reference (counted in 'cr_ref')
comes from the caller, who passes it to the process.

Reviewed by:    kib, markj
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D53636
DeltaFile
+3-5sys/kern/kern_prot.c
+3-51 files

FreeBSD/src 8febbb2cddl/contrib/opensolaris/cmd/dtrace dtrace.1

dtrace.1: Fix mdoc macros around -x

There should be no space between -x's "arg" and "=value".

MFC after:      3 days

(cherry picked from commit 753cef701dbea03627c1fe11dd5556e74df415b2)
DeltaFile
+1-1cddl/contrib/opensolaris/cmd/dtrace/dtrace.1
+1-11 files

FreeBSD/src 6fad1ffcddl/contrib/opensolaris/cmd/dtrace dtrace.1

dtrace.1: Fix mdoc macros around -x

There should be no space between -x's "arg" and "=value".

MFC after:      3 days

(cherry picked from commit 753cef701dbea03627c1fe11dd5556e74df415b2)
DeltaFile
+1-1cddl/contrib/opensolaris/cmd/dtrace/dtrace.1
+1-11 files

FreeBSD/src 92a91c9cddl/contrib/opensolaris/cmd/dtrace dtrace.1

dtrace.1: Fix mdoc macros around -x

There should be no space between -x's "arg" and "=value".

MFC after:      3 days

(cherry picked from commit 753cef701dbea03627c1fe11dd5556e74df415b2)
DeltaFile
+1-1cddl/contrib/opensolaris/cmd/dtrace/dtrace.1
+1-11 files

FreeBSD/src 773f6ceshare/man/man7 ports.7

ports.7: Add /var/db/ports to FILES

PR:             272426
MFC after:      3 days
Co-authored-by: Piotr Smyrak <ps.ports at smyrak.com>

(cherry picked from commit b8ff8a11c0d1d1f1b3bd1e60fae9c05ada7b28c5)
DeltaFile
+5-1share/man/man7/ports.7
+5-11 files

FreeBSD/src 956938cshare/man/man7 ports.7

ports.7: Add /var/db/ports to FILES

PR:             272426
MFC after:      3 days
Co-authored-by: Piotr Smyrak <ps.ports at smyrak.com>

(cherry picked from commit b8ff8a11c0d1d1f1b3bd1e60fae9c05ada7b28c5)
DeltaFile
+5-1share/man/man7/ports.7
+5-11 files

FreeBSD/src 9033af8share/man/man7 ports.7

ports.7: Add /var/db/ports to FILES

PR:             272426
MFC after:      3 days
Co-authored-by: Piotr Smyrak <ps.ports at smyrak.com>

(cherry picked from commit b8ff8a11c0d1d1f1b3bd1e60fae9c05ada7b28c5)
DeltaFile
+5-1share/man/man7/ports.7
+5-11 files

FreeBSD/src 39acb7fshare/man/man4 geom_zero.4 zero.4

geom_zero.4: Document

PR:     250593
Reviewed by:    bcr, ziaee
Thanks to:      imp, markj
MFC after:      1 week
Fixes:  3843eba85d98 Add unmapped BIO support to GEOM ZERO
Fixes:  24e1fdcd1a69 Allow to specify the byte which will be used for filling read buffer
Fixes:  565bc101112c Add a very simple and small GEOM class - ZERO
DeltaFile
+174-0share/man/man4/geom_zero.4
+2-1share/man/man4/zero.4
+2-0share/man/man4/Makefile
+178-13 files

FreeBSD/src b3b279btests/sys/netinet Makefile

multicast tests: Run in VNET jails

The tests themselves create identically named jails, resulting in
spurious failures when the tests are run in parallel.

MFC after:      1 week
DeltaFile
+2-0tests/sys/netinet/Makefile
+2-01 files

FreeBSD/src 8b92a6abin/rm rm.c

rm(1): remove whiteouts when forcibly removing directories

Commit 2ed053cde5 changed UFS' VOP_RMDIR() behavior to no longer
ignore whiteouts when determining whether a directory is empty,
unless explicitly requested by the caller.  However, this also
necessitates a change to rm(1) to avoid breaking the expected
behavior when forcibly removing directory hierarchies via `rm -fr`.
I neglected to make this follow-on change despite discussing it
in the review for the breaking commit (D45987).

Finally address the breakage by making `rm -fr` imply FTS_WHITEOUT
when rm(1) reads directory contents via fts_read(3).  While here,
also fix a logic error which produces a spurious 'No error' warning
message on stdout for each deleted whiteout.

Reported by:    csjp
Reviewed by:    csjp, kib, olce
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D53640
DeltaFile
+2-2bin/rm/rm.c
+2-21 files

FreeBSD/src ef75e3csys/kern subr_syscall.c

kern/subr_syscalls.c: declare 'traced' local variables boolean

(cherry picked from commit a6a9d97708ec18bf307b01141d84aabd01289159)
DeltaFile
+5-5sys/kern/subr_syscall.c
+5-51 files

FreeBSD/src fe5f456share/man/man9 atomic.9

atomic.9: provide fine details about CAS memory model MD semantic

(cherry picked from commit 269b1c238806c7fb8835a0510b224c466ca3efa0)
DeltaFile
+27-0share/man/man9/atomic.9
+27-01 files

FreeBSD/src ed278aashare/man/man9 atomic.9

atomic.9: fix description of acquire and release

(cherry picked from commit f26382dd72dfc710a8cc7159364a8166e22a4254)
DeltaFile
+17-10share/man/man9/atomic.9
+17-101 files

FreeBSD/src 074fc34share/man/man9 atomic.9

atomic.9: provide fine details about CAS memory model MD semantic

(cherry picked from commit 269b1c238806c7fb8835a0510b224c466ca3efa0)
DeltaFile
+27-0share/man/man9/atomic.9
+27-01 files

FreeBSD/src 7a93788sys/kern kern_jail.c

kern_jail_set(): do not double-free opts

(cherry picked from commit 3f5f52216f7e583aeb5580b13ba0f87e29d1ee43)
DeltaFile
+5-2sys/kern/kern_jail.c
+5-21 files

FreeBSD/src e02ff30sys/netipsec ipsec_offload.c

ipsec_offload: do not leak drv_spi unr

(cherry picked from commit 4accefc998e731581549163cf1a582948b2ad0de)
DeltaFile
+6-7sys/netipsec/ipsec_offload.c
+6-71 files

FreeBSD/src 21b0a62share/man/man9 atomic.9

atomic.9: fix description of acquire and release

(cherry picked from commit f26382dd72dfc710a8cc7159364a8166e22a4254)
DeltaFile
+17-10share/man/man9/atomic.9
+17-101 files

FreeBSD/src 03d1341sys/arm/ti/cpsw if_cpsw.c

arm/ti: Fix typo in a KASSERT message

- s/patcket/packet/

(cherry picked from commit 862024c00f3126220ac425f9ec1f3d4286064688)
DeltaFile
+1-1sys/arm/ti/cpsw/if_cpsw.c
+1-11 files

FreeBSD/src ebcc90asys/geom geom_vfs.c

geom(4): Fix typo in a kernel message

- s/supressing/suppressing/

(cherry picked from commit 57b78a557b3ce07b1589c9c21debe97d45599391)
DeltaFile
+1-1sys/geom/geom_vfs.c
+1-11 files

FreeBSD/src 7751fc7sys/dev/usb/wlan if_upgt.c if_zyd.c

usb(4): Fix typos in upgt(4) and zyd(4)

- s/frequence/frequency/
- s/finsihed/finished/

(cherry picked from commit 679976d8162004f879a1a0d5ca0c5d2ade5fa1bd)
DeltaFile
+3-3sys/dev/usb/wlan/if_upgt.c
+1-1sys/dev/usb/wlan/if_zyd.c
+4-42 files

FreeBSD/src e4cbe5asys/dev/ale if_ale.c

ale(4): Fix typo in a kernel message

- s/sequnce/sequence/

(cherry picked from commit a675f3bb63774a63f668749c6c3c8dfbb6be1cd6)
DeltaFile
+1-1sys/dev/ale/if_ale.c
+1-11 files

FreeBSD/src f6a74b4sys/arm64/nvidia/tegra210 max77620_regulators.c

tegra210: Fix typo in a kernel message

- s/volatge/voltage/

(cherry picked from commit 6a02851a0e346cbff074dab87807c9ee9d1e8d94)
DeltaFile
+2-2sys/arm64/nvidia/tegra210/max77620_regulators.c
+2-21 files

FreeBSD/src 7e6e3e6sys/dev/acpica acpi_pcib_acpi.c

acpi(4): Fix typo in a panic message

- s/depenedent/dependent/

(cherry picked from commit f51fb91d616d49e91f3c2c706263a38b98176911)
DeltaFile
+1-1sys/dev/acpica/acpi_pcib_acpi.c
+1-11 files

FreeBSD/src afb9a1fsys/security/audit bsm_errno.c

audit(4): Fix a typo in an kernel error message

- s/Authenticateion/Authentication/

(cherry picked from commit 63af953e09ccd11f2f5b4d83b10cc231f691de46)
DeltaFile
+1-1sys/security/audit/bsm_errno.c
+1-11 files

FreeBSD/src fae5366sys/arm/mv mv_cp110_icu.c

arm/mv: Fix typo in a kernel error message

- s/Unkown/Unknown/

(cherry picked from commit b074d146969d3097c1e144623360b36083d74927)
DeltaFile
+1-1sys/arm/mv/mv_cp110_icu.c
+1-11 files

FreeBSD/src bf20456sys/dev/virtio/gpu virtio_gpu.c, sys/dev/virtio/scmi virtio_scmi.c

virtio(4): Fix a couple of typos in kernel messages

- s/reponse/response/
- s/Cannnot/Cannot/

(cherry picked from commit e9058e1444d8e5831a237934ca2316e22fc55f36)
DeltaFile
+5-5sys/dev/virtio/gpu/virtio_gpu.c
+1-1sys/dev/virtio/scmi/virtio_scmi.c
+6-62 files

FreeBSD/src 38b3f63sys/dev/ocs_fc ocs_els.c ocs_gendump.c

ocs_fc(4): Fix a couple of typos in kernel messages

- s/unexpectd/unexpected/
- s/Unexected/Unexpected/
- s/niether/neither/
- s/sucessfully/successfully/
- s/Inavlid/Invalid/
- s/toplogy/topology/

(cherry picked from commit aa0cd9e5b4d21b11097e1c21a3c0eb23525c15c3)
DeltaFile
+2-2sys/dev/ocs_fc/ocs_els.c
+2-2sys/dev/ocs_fc/ocs_gendump.c
+2-2sys/dev/ocs_fc/ocs_xport.c
+1-1sys/dev/ocs_fc/ocs_device.c
+1-1sys/dev/ocs_fc/ocs_ioctl.c
+1-1sys/dev/ocs_fc/ocs_scsi.c
+9-96 files

FreeBSD/src d0585afsys/dev/hyperv/netvsc if_hn.c, sys/dev/hyperv/storvsc hv_storvsc_drv_freebsd.c

hyper-v: Fix a couple of typos in kernel messages

- s/tranparent/transparent/
- s/Unknow/Unknown/
- s/qury/query/

(cherry picked from commit 1ef6fef9d5c82a106ba8e42c1e087f9b5d1dfec6)
DeltaFile
+3-3sys/dev/hyperv/netvsc/if_hn.c
+1-1sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
+1-1sys/dev/hyperv/utilities/hv_kvp.c
+5-53 files