r/linux • • 16d ago

Kernel Locking down unnecessary kernel mods

[removed]

0 Upvotes

43 comments sorted by

View all comments

Show parent comment

-16

u/Beneficial-Sock-5130 16d ago

thats the entire point of this thread, i want to block loading any mods outside of a whitelist

32

u/kido5217 16d ago

You don't get it. If malware has enough privilege to load modules, you're already fucked. End of story.

17

u/zapman449 16d ago

The point people are making is, effectively if the attacker has ability to inject kernel mods, they already have root privs... so they can undo most any protection you setup here.

The real value is blocking an attacker from getting the privs they want in the first place.

11

u/Alternative_Web7202 16d ago

It's too late when something is able to load module.

8

u/ersentenza 16d ago

If a malware has the privilege to load modules it also has the privilege to disable your block and load whatever it wants.

4

u/hackingdreams 16d ago

You're missing the point. If they have local root, it doesn't matter. They already own the box.

You can compile a kernel without module loading support, only building in the modules you want... but why bother? You're worrying about the wrong attack surface. You need to stop the attack before it gets root, not after.