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]
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
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
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)
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)
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)
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)
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)
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)
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
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
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
hyper-v: Fix a couple of typos in kernel messages
- s/tranparent/transparent/
- s/Unknow/Unknown/
- s/qury/query/
(cherry picked from commit 1ef6fef9d5c82a106ba8e42c1e087f9b5d1dfec6)