Information
The Controller Area Network (CAN) is a serial communications protocol, which was initially developed for automotive and is now also used in marine, industrial, and medical applications. Disabling CAN protects the system against exploitation of any flaws in its implementation.
Removing support for unneeded protocols reduces the local attack surface of the system. If this protocol is not needed, disable it.
Solution
Unload and disable the can kernel module.
- Run the following commands to unload the can kernel module:
# modprobe -r can 2>/dev/null
# rmmod can 2>/dev/null
- Perform the following to disable the can kernel module:
Create a file ending in .conf with install can /bin/false in the /etc/modprobe.d/ directory
Example:
# printf '\n%s\n' "install can /bin/false" >> /etc/modprobe.d/60-can.conf
Create a file ending in .conf with blacklist can in the /etc/modprobe.d/ directory
Example:
# printf '\n%s\n' "blacklist can" >> /etc/modprobe.d/60-can.conf