nullfs: add nounixbypass mount option
The option, when set, disables bypassing the unix socket vnode down
to the lower mp, effectively preventing connection to nullfs unix
socket from being acceptable from the lower mp (and vice versa).
This is done by providing a vop vector that stops bypass for unp-related
VOPs. I believe that VFS_VOP_VECTOR_REGISTER() does the right thing
there regardless of the order of initialization.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D52983
nullfs_mount: use symbols instead of string literals for cache mount options
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D52983
nullfs: add a helper for testing if vnode belongs to a nullfs mount
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D52983
fs/nullfs/null.h: put first definition after headers include
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D52983
umass.4: Modernize driver loading instructions
+ consolidate kernel configuration in SYNOPSIS
+ explain driver autoloading in DESCRIPTION
+ s/port/interface/ because of internal USBs
+ fix flow of remaining example
MFC after: 1 day
nfsuserd: Fix OOB access on membership of too many groups, take 2
Forgot to reset 'ngroup' after one of the calls to getgrouplist() in the
previous commit with same title (referenced also below).
MFC after: 1 hour
Fixes: e6c623c86ab4 ("Add support for the "-manage-gids" option to the nfsuserd daemon.")
Fixes: bb339adfb2a2 ("nfsuserd: Fix OOB access on membership of too many groups")
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 75eb6846269bb9bec1eaf4f0ad93d7525715b550)
initgroups.3: Clarify that ENOMEM is a possible value for 'errno'
The current phrasing could be interpreted as meaning that initgroups(3)
could return ENOMEM instead of -1, which it actually did until I fixed
it in commit 0b018cfd81d8 ("initgroups(3): Fix return value on
allocation failure").
While here, mention setgroups(2) as a system call rather than a library
function.
MFC with: 0b018cfd81d8 ("initgroups(3): Fix return value on allocation failure")
Sponsored by: The FreeBSD Foundation
(cherry picked from commit c36a44e1cdab1c67a98132676818f473cc4e5c03)
nfsuserd: Fix OOB access on membership of too many groups
getgrouplist() sets the variable containing the allocated length in
input to the full effective group list length, not the number of slots
that were actually filled in case the passed array is too small to
contain it.
While here, on this condition, improve the error message by outputting
the corresponding user name.
MFC after: 1 hour
Fixes: e6c623c86ab4 ("Add support for the "-manage-gids" option to the nfsuserd daemon.")
Sponsored by: The FreeBSD Foundation
(cherry picked from commit bb339adfb2a26c5bb71cd4275dff80f615534ab6)
getgrouplist.3: Insist on the value returned in 'ngroups'; Minor changes
Emphasize the peculiar treatment of 'ngroups', through which the
effective group list's size is returned, even if the passed allocated
size is not big enough, in which case the output 'groups' array is
completely filled with the effective group list's first elements.
Use the precise POSIX term for the group associated to the user in the
password database ("initial numerical group ID"), consistently with what
was done in initgroups.3.
Use "length" instead of "size" to refer to the number of elements of an
array (in contrast with its actual size in bytes).
Perform some minor simplifications on top of the last rework.
MFC after: 1 hour
Sponsored by: The FreeBSD Foundation
(cherry picked from commit f5544556754ec6b33c1d13c7648a354fef645b2f)
ctld: Defer initialization of NVMeoF associations
Wait until all of the configuration has been parsed before creating
associations for NVMe portals. This ensures that any options
specified in a transport group are honored when creating associations.
To enable this, add a new virtual method portal::prepare invoked when
applying a configuration prior to opening a socket (or reusing an
existing socket) for a portal.
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D52844
sockstat: show path state column only when useful
Showing the path state column is only useful, if there is at least one
SCTP endpoint shown, which is not in the state CLOSED or LISTEN.
Don't show it when it is not useful.
Reviewed by: rrs
MFC after: 3 days
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D52986
sockstat: improve output formatting
Fix the format when the output for a socket spans multiple lines.
Reviewed by: rrs
MFC after: 3 days
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D52984
libcasper: explicit cast in cap_fileargs header
The implicit cast is incompatible with standard compiler options in a
C++ project, making the library difficult to use.
Signed-off-by: Quentin Thébault <quentin.thebault at defenso.fr>
Sponsored by: Defenso
MFC after: 3 days
Discussed with: kevans
Reviewed by: emaste, vexeduxr
Pull request: https://github.com/freebsd/freebsd-src/pull/1857
x86: Close race condition on MCA task queues at startup
Currently, the CMCI handler checks the cold variable to determine
whether it can schedule a task. The task queue is setup as part of the
mca_startup() function, which is run well after the configure_final()
function sets the cold variable to 0. Therefore, if an MCA arrives
in the window between configure_final() and mca_startup() running,
the code could try to schedule a task on an unintitalized task queue.
Close the race by specifically checking whether the mca_startup()
function has run.
Reviewed by: markj
MFC after: 1 week
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D12276
(cherry picked from commit 4a5d8670a7d58b04913fd90aae85a1e35236ca3d)
x86: Keep cumulative MCA statistics in the kernel
Keeping cumulative MCA statistics in the kernel provides a way for
users to get an accurate count of various kinds of errors reported
by the CPU.
After ca8929d2a3e9b9df31d2e487377f99d7c39aa01d, it is possible that
the kernel will drop the record of some MCA interrupts. Moreover, this
provides a cheaper interface to obtain statistics if that is the only
reason a user is processing MCA logs.
Reviewed by: markj
Sponsored by: Netflix
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D52709
(cherry picked from commit 5f1f7d8457d4fc28c6cff7e26a629a2d6ee3fc61)
x86: Close race condition on MCA task queues at startup
Currently, the CMCI handler checks the cold variable to determine
whether it can schedule a task. The task queue is setup as part of the
mca_startup() function, which is run well after the configure_final()
function sets the cold variable to 0. Therefore, if an MCA arrives
in the window between configure_final() and mca_startup() running,
the code could try to schedule a task on an unintitalized task queue.
Close the race by specifically checking whether the mca_startup()
function has run.
Reviewed by: markj
MFC after: 1 week
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D12276
(cherry picked from commit 4a5d8670a7d58b04913fd90aae85a1e35236ca3d)
x86: Keep cumulative MCA statistics in the kernel
Keeping cumulative MCA statistics in the kernel provides a way for
users to get an accurate count of various kinds of errors reported
by the CPU.
After ca8929d2a3e9b9df31d2e487377f99d7c39aa01d, it is possible that
the kernel will drop the record of some MCA interrupts. Moreover, this
provides a cheaper interface to obtain statistics if that is the only
reason a user is processing MCA logs.
Reviewed by: markj
Sponsored by: Netflix
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D52709
(cherry picked from commit 5f1f7d8457d4fc28c6cff7e26a629a2d6ee3fc61)
nfsuserd: Fix OOB access on membership of too many groups, take 2
Forgot to reset 'ngroup' after one of the calls to getgrouplist() in the
previous commit with same title (referenced also below).
MFC after: 1 hour
Fixes: e6c623c86ab4 ("Add support for the "-manage-gids" option to the nfsuserd daemon.")
Fixes: bb339adfb2a2 ("nfsuserd: Fix OOB access on membership of too many groups")
Sponsored by: The FreeBSD Foundation