Information
The hfs filesystem type is a hierarchical filesystem that allows you to mount Mac OS filesystems.
Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it.
Solution
Run the following to unload and disable the hfs kernel module. This can also be done by running the script included below.
Run the following commands to unload the hfs kernel module:
# modprobe -r hfs 2>/dev/null
# rmmod hfs 2>/dev/null
Perform the following to disable the hfs kernel module:
Create a file ending inconf with install hfs /bin/false in the /etc/modprobe.d/ directory
Example:
# printf '\n%s\n' "install hfs /bin/false" >> hfs.conf
Create a file ending inconf with blacklist hfs in the /etc/modprobe.d/ directory
Example:
# printf '\n%s\n' "blacklist hfs" >> hfs.conf