Wed Dec 4 23:35:36 2019 UTC ()
Note that the size returned by modctl(2) and displayed by modstat(8) is
only for the module's text section, not for the entire size of the module.

Addresses PR kern-54737


(pgoyette)
diff -r1.15 -r1.16 src/lib/libc/sys/modctl.2
diff -r1.23 -r1.24 src/sbin/modstat/modstat.8

cvs diff -r1.15 -r1.16 src/lib/libc/sys/modctl.2 (expand / switch to unified diff)

--- src/lib/libc/sys/modctl.2 2019/04/08 10:47:16 1.15
+++ src/lib/libc/sys/modctl.2 2019/12/04 23:35:36 1.16
@@ -1,40 +1,40 @@ @@ -1,40 +1,40 @@
1.\" $NetBSD: modctl.2,v 1.15 2019/04/08 10:47:16 pgoyette Exp $ 1.\" $NetBSD: modctl.2,v 1.16 2019/12/04 23:35:36 pgoyette Exp $
2.\" 2.\"
3.\" Copyright (c) 2009 The NetBSD Foundation, Inc. 3.\" Copyright (c) 2009 The NetBSD Foundation, Inc.
4.\" All rights reserved. 4.\" All rights reserved.
5.\" 5.\"
6.\" Redistribution and use in source and binary forms, with or without 6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions 7.\" modification, are permitted provided that the following conditions
8.\" are met: 8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright 9.\" 1. Redistributions of source code must retain the above copyright
10.\" notice, this list of conditions and the following disclaimer. 10.\" notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\" notice, this list of conditions and the following disclaimer in the 12.\" notice, this list of conditions and the following disclaimer in the
13.\" documentation and/or other materials provided with the distribution. 13.\" documentation and/or other materials provided with the distribution.
14.\" 14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 15.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
16.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 16.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 17.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 18.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
19.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25.\" POSSIBILITY OF SUCH DAMAGE. 25.\" POSSIBILITY OF SUCH DAMAGE.
26.\" 26.\"
27.Dd April 8, 2019 27.Dd December 4, 2019
28.Dt MODCTL 2 28.Dt MODCTL 2
29.Os 29.Os
30.Sh NAME 30.Sh NAME
31.Nm modctl 31.Nm modctl
32.Nd module control 32.Nd module control
33.Sh LIBRARY 33.Sh LIBRARY
34.Lb libc 34.Lb libc
35.Sh SYNOPSIS 35.Sh SYNOPSIS
36.In sys/module.h 36.In sys/module.h
37.Ft int 37.Ft int
38.Fn modctl "int operation" "void *argp" 38.Fn modctl "int operation" "void *argp"
39.Sh DESCRIPTION 39.Sh DESCRIPTION
40.Fn modctl 40.Fn modctl
@@ -174,27 +174,27 @@ Security model. @@ -174,27 +174,27 @@ Security model.
174.It Dv MODULE_CLASS_VFS 174.It Dv MODULE_CLASS_VFS
175File system. 175File system.
176.It Dv MODULE_CLASS_DRIVER 176.It Dv MODULE_CLASS_DRIVER
177Device driver. 177Device driver.
178.It Dv MODULE_CLASS_EXEC 178.It Dv MODULE_CLASS_EXEC
179Executable file format. 179Executable file format.
180.It Dv MODULE_CLASS_MISC 180.It Dv MODULE_CLASS_MISC
181Miscellaneous. 181Miscellaneous.
182.El 182.El
183.It Fa "uint64_t ms_addr" 183.It Fa "uint64_t ms_addr"
184The load address within the kernel. 184The load address within the kernel.
185(This value is available only for privileged users.) 185(This value is available only for privileged users.)
186.It Fa "u_int ms_size" 186.It Fa "u_int ms_size"
187Loaded size of the module. 187Loaded size of the module's text section.
188(This value is available only for privileged users.) 188(This value is available only for privileged users.)
189.It Fa "u_int ms_refcnt" 189.It Fa "u_int ms_refcnt"
190Current number of live references to this module. 190Current number of live references to this module.
191.It Fa "u_int ms_flags" 191.It Fa "u_int ms_flags"
192The module's flags: 192The module's flags:
193.Bl -tag -compact -width "MODFLAG_AUTO_LOADED" 193.Bl -tag -compact -width "MODFLAG_AUTO_LOADED"
194.It Dv MODFLAG_MUST_FORCE 194.It Dv MODFLAG_MUST_FORCE
195The "force" flag must be specified to reload this module. 195The "force" flag must be specified to reload this module.
196.It Dv MODFLAG_AUTO_LOADED 196.It Dv MODFLAG_AUTO_LOADED
197The module was auto-loaded by the operating system. 197The module was auto-loaded by the operating system.
198.El 198.El
199.It Fa "uint_ms_reqoffset" 199.It Fa "uint_ms_reqoffset"
200The offset (in bytes) from the beginning of the required-module data. 200The offset (in bytes) from the beginning of the required-module data.

cvs diff -r1.23 -r1.24 src/sbin/modstat/modstat.8 (expand / switch to unified diff)

--- src/sbin/modstat/modstat.8 2019/01/27 02:08:36 1.23
+++ src/sbin/modstat/modstat.8 2019/12/04 23:35:36 1.24
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: modstat.8,v 1.23 2019/01/27 02:08:36 pgoyette Exp $ 1.\" $NetBSD: modstat.8,v 1.24 2019/12/04 23:35:36 pgoyette Exp $
2.\" 2.\"
3.\" Copyright (c) 1993 Christopher G. Demetriou 3.\" Copyright (c) 1993 Christopher G. Demetriou
4.\" All rights reserved. 4.\" All rights reserved.
5.\" 5.\"
6.\" Redistribution and use in source and binary forms, with or without 6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions 7.\" modification, are permitted provided that the following conditions
8.\" are met: 8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright 9.\" 1. Redistributions of source code must retain the above copyright
10.\" notice, this list of conditions and the following disclaimer. 10.\" notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\" notice, this list of conditions and the following disclaimer in the 12.\" notice, this list of conditions and the following disclaimer in the
13.\" documentation and/or other materials provided with the distribution. 13.\" documentation and/or other materials provided with the distribution.
14.\" 3. All advertising materials mentioning features or use of this software 14.\" 3. All advertising materials mentioning features or use of this software
@@ -22,27 +22,27 @@ @@ -22,27 +22,27 @@
22.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 22.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 23.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 24.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 25.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 26.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 30.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32.\" 32.\"
33.\" <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>> 33.\" <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>>
34.\" 34.\"
35.Dd September 8, 2018 35.Dd December 4, 2019
36.Dt MODSTAT 8 36.Dt MODSTAT 8
37.Os 37.Os
38.Sh NAME 38.Sh NAME
39.Nm modstat 39.Nm modstat
40.Nd display status of loaded kernel modules 40.Nd display status of loaded kernel modules
41.Sh SYNOPSIS 41.Sh SYNOPSIS
42.Nm 42.Nm
43.Op Fl Aaek 43.Op Fl Aaek
44.Op Fl n Ar name | name 44.Op Fl n Ar name | name
45.Sh DESCRIPTION 45.Sh DESCRIPTION
46The 46The
47.Nm 47.Nm
48utility displays the status of any kernel modules present in the kernel. 48utility displays the status of any kernel modules present in the kernel.
@@ -80,27 +80,27 @@ includes: @@ -80,27 +80,27 @@ includes:
80.Bl -tag -width Loadaddr 80.Bl -tag -width Loadaddr
81.It Li CLASS 81.It Li CLASS
82Module class, such as 82Module class, such as
83"vfs", "driver", "exec", "misc" or "secmodel". 83"vfs", "driver", "exec", "misc" or "secmodel".
84.It Li SOURCE 84.It Li SOURCE
85Where the module was loaded from. 85Where the module was loaded from.
86.Qq Dv builtin 86.Qq Dv builtin
87indicates that the module was built into the running kernel. 87indicates that the module was built into the running kernel.
88.Qq Dv boot 88.Qq Dv boot
89indicates that the module was loaded during system bootstrap. 89indicates that the module was loaded during system bootstrap.
90.Qq Dv filesys 90.Qq Dv filesys
91indicates that the module was loaded from the file system. 91indicates that the module was loaded from the file system.
92.It Li SIZE 92.It Li SIZE
93Size of the module in bytes. 93Size of the module's text section, in bytes.
94.It Li FLAG 94.It Li FLAG
95The module flags: 95The module flags:
96.Bl -tag -width a -offset indent -compact 96.Bl -tag -width a -offset indent -compact
97.It Dv a 97.It Dv a
98Module is auto-loaded. 98Module is auto-loaded.
99.It Dv f 99.It Dv f
100Requires the 100Requires the
101.Xr modload 8 101.Xr modload 8
102flag 102flag
103.Fl f 103.Fl f
104(force) to be loaded. 104(force) to be loaded.
105.El 105.El
106.It Li REFS 106.It Li REFS