Skip to content

Commit

Permalink
module(9), sysctl(7): Document kern.module.autounload_unsafe.
Browse files Browse the repository at this point in the history
  • Loading branch information
riastradh authored and riastradh committed Aug 12, 2022
1 parent 7b62cae commit 5fd4b47
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
15 changes: 11 additions & 4 deletions share/man/man7/sysctl.7
@@ -1,4 +1,4 @@
.\" $NetBSD: sysctl.7,v 1.158 2022/08/09 08:03:22 knakahara Exp $
.\" $NetBSD: sysctl.7,v 1.159 2022/08/12 15:43:38 riastradh Exp $
.\"
.\" Copyright (c) 1993
.\" The Regents of the University of California. All rights reserved.
Expand Down Expand Up @@ -842,20 +842,27 @@ See
.It Li kern.module
Settings related to kernel modules.
The third level names for the settings are described below.
.Bl -column "kern.module.autoload" "integer" "Changeable" -offset indent
.Bl -column "kern.module.autounload_unsafe" "integer" "Changeable" -offset indent
.It Sy Third level name Ta Sy Type Ta Sy Changeable
.It kern.module.autoload integer yes
.It kern.module.autounload_unsafe integer yes
.It kern.module.autotime integer yes
.It kern.module.verbose boolean yes
.El
.Pp
The variables are as follows:
.Bl -tag -width "123456"
.Bl -tag -width 6n
.It Li kern.module.autoload
A boolean that controls whether kernel modules are loaded automatically.
See
.Xr module 7
for additional details.
for details.
.It Li kern.module.autounload_unsafe
A boolean that controls whether the kernel will autounload modules that
were automatically loaded and have not been audited for autounload.
.Pp
By default, only modules that have been audited will be autounloaded,
and only if they were autoloaded to begin with.
.It Li kern.module.autotime
An integer that controls the delay before an attempt is made to
automatically unload a module that was auto-loaded.
Expand Down
9 changes: 7 additions & 2 deletions share/man/man9/module.9
@@ -1,4 +1,4 @@
.\" $NetBSD: module.9,v 1.53 2021/07/22 01:38:45 pgoyette Exp $
.\" $NetBSD: module.9,v 1.54 2022/08/12 15:43:38 riastradh Exp $
.\"
.\" Copyright (c) 2010 The NetBSD Foundation, Inc.
.\" All rights reserved.
Expand Down Expand Up @@ -347,14 +347,19 @@ routine.
The module subsystem uses a kernel thread to attempt to automatically
unload modules a short time (currently, 10 seconds) after being loaded by
.Fn module_autoload .
Before the module is unloaded, its
Before the module is unloaded by this thread, its
.Fn modcmd
is called with the
.Fa cmd
argument specified as
.Dv MODULE_CMD_AUTOUNLOAD .
A module can prevent itself from being unloaded by returning a non-zero
value.
Exception: If
.Li kern.module.autounload_unsafe
is set, a module that returns
.Er ENOTTY ,
meaning it does not understand the command, may still be autounloaded.
.Pp
The
.Fn module_autoload
Expand Down

0 comments on commit 5fd4b47

Please sign in to comment.