This is in related to to the dirty-frag vulnerability that was recently discovered. One of the mitigation steps given was to block the installation of the module esp4, esp6 and rxrpc. Typically that is done by putting a .conf file in the directory /etc/modprobe.d/ with the following content
But then I realized that each linux kernel module also has an alias. This can be found by running the command modinfo. And the module can be loaded via the alias. The details of some of the aliases are given below
So a user might still be able to load the modules esp4, esp6, rxrpc using the alias xfrm-type-2-50, xfrm-type-10-50, net-pf-33 respectively. This leads me to my question. How to prevent this? For each and every alias do we have to give instal <<ModuleAliasName>> /bin/false followed by blacklist <<ModuleAliasName>>? Or does something different have to be done?
I don’t bother with this stuff. I leave it up to the kernel developers to fix these kind of issues related to vulnerabilities. But it’s your system!
@cactux I was hoping that someone who has done this already or configured will be able to tell. That is why I had asked. Was banking on the knowledge of the crowd.
Allright so this is what I found. Using the following in a conf file present in /etc/modprobe.d/ directory
install <<ModuleName>> /bin/false
blocks the module from being loaded via the command modprobe <<ModuleName>>. This also blocks the module from being loaded via aliases of the module, i.e. modprobe <<ModuleAlias>>. What this does not block are the following
Any dependencies. If the <<ModuleName>> is dependent on some other module, that will get loaded.
Loading of the module using insmod <<AbsolutePathToModuleFile>>
However if we use the following in a conf file present in /etc/modprobe.d/ directory
blocks the module from being loaded via the command modprobe as well as via insmod
So to answer the question, yeah blocking the module by using install <<ModuleName> /bin/false will also block the loading of the module using its alias. But it does not stop insmod.