this post was submitted on 07 May 2026
183 points (97.4% liked)

Linux

65117 readers
873 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 7 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] shirro@aussie.zone 39 points 2 days ago (2 children)

In the 90s I compiled all my kernels at home from source with just the drivers I needed. Only installed the packages I needed. Only enabled the services I needed. The Unix way. When the kernel added modules I was still only compiling a subset and generally loading them manually.

Obviously that doesn't work for most users and distros sensibly started shipping with modules compiled for practically every need. Usually when I view distro security alerts they are for packages I don't install. But I have all these damn kernel modules just waiting to automatically load. I know I can blacklist them individually but I wonder if there is a way to profile the modules I use and use a deny all/whitelist approach instead?

[–] mlfh@lm.mlfh.org 24 points 2 days ago* (last edited 1 day ago) (1 children)

modprobed-db can create a profile of the kernel modules that get loaded by your system over time. You can feed that directly into make localmodconfig to build a kernel that only includes those modules, or use the data to build a modprobe whitelist.

[–] MonkderVierte@lemmy.zip 6 points 1 day ago* (last edited 1 day ago) (2 children)

Hm? Somehow, lemmy.zip messed up the proxying, (clickable link)? Good thing you've pasted it plaintext.

[–] mlfh@lm.mlfh.org 3 points 1 day ago

Hahaha no I'm just an idiot and accidentally swapped the url and text, thanks for catching that - fixed now

[–] Hexarei@beehaw.org 1 points 1 day ago

I think that's a Voyager thing, maybe?

[–] MNByChoice@midwest.social 3 points 2 days ago (1 children)

Clearly you know of lot about this. Here are some comments for the next human.

Deny all modules seems more possible than a whitelist approach. To deny all, the command is likely "sysctl kernel.modules_disabled=1".

Whitelisting is harder. One could store a list of all loaded modules on a working system. Store a list of all kernel modules currently installed on the system. Compare the lists and remove from the "all" list the "running" list (grep will do this) and write it to the blacklist file.

The problem with the Whitelisting approach is that it needs to run after every kernel module install (which is doable).

If the above is the case, then someone must have automated this already, but I cannot find it quickly. (I checked Debian's package repository.)

[–] shirro@aussie.zone 5 points 2 days ago

Clearly you know of lot about this.

Nah, that is the problem. It all got so dynamic and easy I don't really know how the hundreds of active modules on my desktop are loaded, why or in what order anymore. The days when I could list a handful of modules to load at boot are long gone I think unless its an embedded device or perhaps a simple server.

Setting modules_disabled might be viable for a relatively static system. I have seen that one when looking at hardening servers in the past but thought it was a bit extreme. Perhaps not.