Linux Kernel Shifts from SHA1 to SHA512 for Module Signing to Enhance Default Security
Many Linux distribution developers have already moved from the default SHA1 signature to SHA512 for kernel module signing. However, the Linux Kernel had been sticking with the SHA1 algorithm for module signing by default.
As the kernel version evolves, Linux Kernel 6.14 has started to default to the SHA512 algorithm for signing, significantly enhancing security compared to the SHA1 algorithm.
In the latest code merged into Linux Kernel 6.14, the kernel now defaults to using SHA512 while still supporting SHA1. The former, being more modern and secure, offers better resistance to attacks, as the SHA1 algorithm is gradually being phased out due to its vulnerabilities.
Switching to the SHA512 algorithm might cause some Linux distributions that use OpenSSL to encounter errors when attempting to sign kernel modules with SHA1, leading to kernel build failures.
However, as time progresses, the SHA512 algorithm is expected to become mainstream, at least within the Linux kernel, minimizing issues in kernel version builds.
Attached is the merged kernel code:
diff --git a/kernel/module/Kconfig b/kernel/module/Kconfig index 7c6588148d42d3..0c746a150e34e2 100644 --- a/kernel/module/Kconfig +++ b/kernel/module/Kconfig @@ -231,6 +231,7 @@ comment "Do not forget to sign required modules with scripts/sign-file" choice prompt "Hash algorithm to sign modules" depends on MODULE_SIG || IMA_APPRAISE_MODSIG + default MODULE_SIG_SHA512 help This determines which sort of hashing algorithm will be used during signature generation. This algorithm _must_ be built into the kernel base-commit: d3d1556696c1a993eec54ac585fe5bf677e07474 -- 2.45.0