Module Name:    src
Committed By:   riastradh
Date:           Fri Aug 12 15:43:38 UTC 2022

Modified Files:
        src/share/man/man7: sysctl.7
        src/share/man/man9: module.9

Log Message:
module(9), sysctl(7): Document kern.module.autounload_unsafe.


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/share/man/man7/sysctl.7
cvs rdiff -u -r1.53 -r1.54 src/share/man/man9/module.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man7/sysctl.7
diff -u src/share/man/man7/sysctl.7:1.158 src/share/man/man7/sysctl.7:1.159
--- src/share/man/man7/sysctl.7:1.158	Tue Aug  9 08:03:22 2022
+++ src/share/man/man7/sysctl.7	Fri Aug 12 15:43:38 2022
@@ -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.
@@ -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.

Index: src/share/man/man9/module.9
diff -u src/share/man/man9/module.9:1.53 src/share/man/man9/module.9:1.54
--- src/share/man/man9/module.9:1.53	Thu Jul 22 01:38:45 2021
+++ src/share/man/man9/module.9	Fri Aug 12 15:43:38 2022
@@ -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.
@@ -347,7 +347,7 @@ 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
@@ -355,6 +355,11 @@ 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

Reply via email to