So how do you find out detailed information about a Linux Kernel module or device drivers on the server?

You need to use modinfo command to display or show information about a Linux Kernel loaded modules. Use the lsmod command to obtain list of loaded modules in the Linux kernel.

Advertisement

Display or show information about a Linux Kernel module or drivers

The modinfo extracts information from the Linux Kernel modules given on the command line. This is not just useful to find out information about loaded modules but it can be used to identify modules inserted by crackers/hackers (try less /proc/modules). Also following is a good way to verify output reported by the ps ax command and wc command:
# ps ax | wc -l
Outputs:

77

Then:
# ls -d /proc/* | grep [0-9]|wc -l
Sample outputs:

78

Usually, the rootkit will install its own ps command, which hides kernel modules. If the second output is larger than the first (ps ax) command output, take a closer look at your server. Back to our main question, the modinfo command outputs the following information for each module:

  1. Kernel module author
  2. Linux kernel module description
  3. License
  4. Parameter and filename

Task: Display list of modules

Run the lsmod command or the less command over the /proc/modules file as follows:
$ lsmod
$ less /proc/modules

Task: Display information about ide-cd module

Want to see info about the ide-cd Linux module? Try the modinfo command $ /sbin/modinfo ide-cd
Here is what I see from RHEL server:

filename:       /lib/modules/2.6.8-2-686/kernel/drivers/ide/ide-cd.ko
description:    ATAPI CD-ROM Driver
license:        GPL
vermagic:       2.6.8-2-686 preempt 686 gcc-3.3
depends:        ide-core,cdrom

Task: Display information about rt61 module

Again use the modinfo command:
# /sbin/modinfo rt61
Outputs:

filename:       /lib/modules/2.6.8-2-686/kernel/net/wireless/rt61.ko
author:         Paul Lin 
description:    RT61 Wireless Lan Linux Driver
vermagic:       2.6.8-2-686 preempt 686 gcc-3.3
depends:
alias:          pci:v00001814d00000301sv*sd*bc*sc*i*
alias:          pci:v00001814d00000302sv*sd*bc*sc*i*
alias:          pci:v00001814d00000401sv*sd*bc*sc*i*

You can load modules automatically during Linux system boot sequence by adding a module name to /etc/modules.conf under Red Hat and friends, or /etc/modules under Debian / Ubuntu Linux file.

Summing up

The modinfo command display information about a Linux Kernel module and the lsmod command list those modules loaded by the running Linux kernel. For info use the man command to read man pages:

man lsmod
man modinfo

🥺 Was this helpful? Please add a comment to show your appreciation or feedback.

nixCrat Tux Pixel Penguin
Hi! 🤠
I'm Vivek Gite, and I write about Linux, macOS, Unix, IT, programming, infosec, and open source. Subscribe to my RSS feed or email newsletter for updates.

3 comments… add one
  • Klacar Nebojsa Apr 3, 2009 @ 6:38

    Sorry, there is something: I have troubles installing external USB speakers, type Genius SP-i202U. Can I get related tips and tricks about troubleshooting it on my Fedora 8?

    thanks

  • Alvaro Mar 25, 2010 @ 22:56

    Hi there,

    If x module is listed using the commands described above, it means that the x module is up and runing ?

    Thanks in advance

  • SysAdmin Sep 13, 2013 @ 9:17

    “ls -d /proc/* | grep [0-9]|wc -l” command shows result in one line bigger than “ps ax | wc -l” command. And this pretty normal, on my system it’s because /proc/fairsched2 entry. So I think the grep condition must be more strict in the second command.

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre> for code samples. Your comment will appear only after approval by the site admin.