Listing Information About Loaded Modules

The lsmod command lists the modules that are loaded into the kernel:

lsmod
Module                  Size  Used by
udp_diag               16384  0
ib_core               311296  0
tcp_diag               16384  0
inet_diag              24576  2 tcp_diag,udp_diag
nfsv3                  49152  0
nfs_acl                16384  1 nfsv3
...
dm_mirror              24576  0
dm_region_hash         20480  1 dm_mirror
dm_log                 20480  2 dm_region_hash,dm_mirror
...

The output shows the module name, the amount of memory it uses, the number of processes using the module and the names of other modules on which it depends. The module dm_log, for example, depends on the dm_region_hash and dm_mirror modules. The example also shows that two processes are using all three modules.

Show detailed information about a module by using the modinfo command:

modinfo ahci
filename:       /lib/modules/5.4.17-2136.306.1.3.el8uek.x86_64/kernel/drivers/ata/ahci.ko.xz
version:        3.0
license:        GPL
description:    AHCI SATA low-level driver
author:         Jeff Garzik
srcversion:     3F4E4F52FD2D5F8BBD5F972
alias:          pci:v*d*sv*sd*bc01sc06i01*
alias:          pci:v00001C44d00008000sv*sd*bc*sc*i*
...
depends:        libahci,libata
retpoline:      Y
intree:         Y
name:           ahci
vermagic:       5.4.17-2136.306.1.3.el8uek.x86_64 SMP mod_unload modversions 
sig_id:         PKCS#7
signer:         Oracle CA Server
sig_key:        22:07:CB:47:59:F3:50:A0:A2:FA:24:CE:B4:00:53:4E:C5:1D:C6:2A
sig_hashalgo:   sha512
signature:      2F:AE:AF:6D:56:92:69:C4:77:AB:E1:3D:41:09:AF:A6:FC:1D:3B:A2:
                9C:23:79:6F:17:82:D5:A3:9B:61:64:32:72:9B:98:C9:8C:89:73:FB:
                A4:86:4F:B5:7D:DF:84:8E:05:26:4F:22:CB:02:41:38:7B:7C:CB:C2:
                ...
                9F:FD:94:8F:35:9B:2A:89:3E:E1:17:40:49:79:30:8B:92:4D:3A:9A:
                F4:C7:82:8D:26:BE:6D:FB:71:C6:E5:FD
parm:           marvell_enable:Marvell SATA via AHCI (1 = enabled) (int)
parm:           mobile_lpm_policy:Default LPM policy for mobile chipsets (int)

...

The output would include the following information:

filename

Absolute path of the kernel object file.

version

Version number of the module. Note that the version number might not be updated for patched modules and might be missing or removed in newer kernels.

license

License information for the module.

description

Short description of the module.

author

Author credit for the module.

srcversion

Hash of the source code used to create the module.

alias

Internal alias names for the module.

depends

Comma-separated list of any modules on which this module depends.

retpoline

A flag indicating that the module is built that includes a mitigation against the Spectre security vulnerability.

intree

A flag indicating that the module is built from the kernel in-tree source and isn't tainted.

vermagic

Kernel version that was used to compile the module, which is checked against the current kernel when the module is loaded.

sig_id

The method used to store signing keys that might have been used to sign a module for Secure Boot, typically PKCS#7

signer

The name of the signing key used to sign a module for Secure Boot.

sig_key

The signature key identifier for the key used to sign the module.

sig_hashalgo

The algorithm used to generate the signature hash for a signed module.

signature

The signature data for a signed module.

parm

Module parameters and descriptions.

Modules are loaded into the kernel from kernel object files (/lib/modules/kernel_version/kernel/*ko*). To display the absolute path of a kernel object file, specify the -n option, for example:

modinfo -n parport
/lib/modules/5.4.17-2136.306.1.3.el8uek.x86_64/kernel/drivers/parport/parport.ko.xz

For more information, see the lsmod(5) and modinfo(8) manual pages.