bsphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget./translations/zh_CN/admin-guide/module-signingmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget./translations/zh_TW/admin-guide/module-signingmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget./translations/it_IT/admin-guide/module-signingmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget./translations/ja_JP/admin-guide/module-signingmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget./translations/ko_KR/admin-guide/module-signingmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget./translations/sp_SP/admin-guide/module-signingmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(hKernel module signing facilityh]hKernel module signing facility}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhH/var/lib/git/docbuild/linux/Documentation/admin-guide/module-signing.rsthKubhcomment)}(hCONTENTSh]hCONTENTS}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhhhhKubh)}(hhh]h}(h]h ]h"]h$]h&]hhuh1hhhhhhhhKubh)}(h - Overview.h]h - Overview.}hhsbah}(h]h ]h"]h$]h&]hhuh1hhhhhhhhKubh)}(h- Configuring module signing.h]h- Configuring module signing.}hhsbah}(h]h ]h"]h$]h&]hhuh1hhhhhhhhKubh)}(h- Generating signing keys.h]h- Generating signing keys.}hhsbah}(h]h ]h"]h$]h&]hhuh1hhhhhhhhKubh)}(h- Public keys in the kernel.h]h- Public keys in the kernel.}hhsbah}(h]h ]h"]h$]h&]hhuh1hhhhhhhhK ubh)}(h- Manually signing modules.h]h- Manually signing modules.}hj sbah}(h]h ]h"]h$]h&]hhuh1hhhhhhhhK ubh)}(h- Signed modules and stripping.h]h- Signed modules and stripping.}hjsbah}(h]h ]h"]h$]h&]hhuh1hhhhhhhhK ubh)}(h- Loading signed modules.h]h- Loading signed modules.}hj&sbah}(h]h ]h"]h$]h&]hhuh1hhhhhhhhK ubh)}(h,- Non-valid signatures and unsigned modules.h]h,- Non-valid signatures and unsigned modules.}hj4sbah}(h]h ]h"]h$]h&]hhuh1hhhhhhhhK ubh)}(h+- Administering/protecting the private key.h]h+- Administering/protecting the private key.}hjBsbah}(h]h ]h"]h$]h&]hhuh1hhhhhhhhKubh)}(hhh](h)}(hOverviewh]hOverview}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhjPhhhhhKubh paragraph)}(hXThe kernel module signing facility cryptographically signs modules during installation and then checks the signature upon loading the module. This allows increased kernel security by disallowing the loading of unsigned modules or modules signed with an invalid key. Module signing increases security by making it harder to load a malicious module into the kernel. The module signature checking is done by the kernel so that it is not necessary to have trusted userspace bits.h]hXThe kernel module signing facility cryptographically signs modules during installation and then checks the signature upon loading the module. This allows increased kernel security by disallowing the loading of unsigned modules or modules signed with an invalid key. Module signing increases security by making it harder to load a malicious module into the kernel. The module signature checking is done by the kernel so that it is not necessary to have trusted userspace bits.}(hjchhhNhNubah}(h]h ]h"]h$]h&]uh1jahhhKhjPhhubjb)}(hXThis facility uses X.509 ITU-T standard certificates to encode the public keys involved. The signatures are not themselves encoded in any industrial standard type. The built-in facility currently only supports the RSA & NIST P-384 ECDSA public key signing standard (though it is pluggable and permits others to be used). The possible hash algorithms that can be used are SHA-2 and SHA-3 of sizes 256, 384, and 512 (the algorithm is selected by data in the signature).h]hXThis facility uses X.509 ITU-T standard certificates to encode the public keys involved. The signatures are not themselves encoded in any industrial standard type. The built-in facility currently only supports the RSA & NIST P-384 ECDSA public key signing standard (though it is pluggable and permits others to be used). The possible hash algorithms that can be used are SHA-2 and SHA-3 of sizes 256, 384, and 512 (the algorithm is selected by data in the signature).}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1jahhhKhjPhhubeh}(h]overviewah ]h"]overviewah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hConfiguring module signingh]hConfiguring module signing}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK'ubjb)}(hThe module signing facility is enabled by going to the :menuselection:`Enable Loadable Module Support` section of the kernel configuration and turning on::h](h7The module signing facility is enabled by going to the }(hjhhhNhNubhinline)}(hEnable Loadable Module Supporth]hEnable Loadable Module Support}(hjhhhNhNubah}(h]h ] menuselectionah"]h$]h&]rawtext/:menuselection:`Enable Loadable Module Support`uh1jhjubh4 section of the kernel configuration and turning on:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jahhhK)hjhhubh literal_block)}(h7CONFIG_MODULE_SIG "Module signature verification"h]h7CONFIG_MODULE_SIG "Module signature verification"}hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhK-hjhhubjb)}(h'This has a number of options available:h]h'This has a number of options available:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jahhhK/hjhhubh block_quote)}(hX (1) :menuselection:`Require modules to be validly signed` (``CONFIG_MODULE_SIG_FORCE``) This specifies how the kernel should deal with a module that has a signature for which the key is not known or a module that is unsigned. If this is off (ie. "permissive"), then modules for which the key is not available and modules that are unsigned are permitted, but the kernel will be marked as being tainted, and the concerned modules will be marked as tainted, shown with the character 'E'. If this is on (ie. "restrictive"), only modules that have a valid signature that can be verified by a public key in the kernel's possession will be loaded. All other modules will generate an error. Irrespective of the setting here, if the module has a signature block that cannot be parsed, it will be rejected out of hand. (2) :menuselection:`Automatically sign all modules` (``CONFIG_MODULE_SIG_ALL``) If this is on then modules will be automatically signed during the modules_install phase of a build. If this is off, then the modules must be signed manually using:: scripts/sign-file (3) :menuselection:`Which hash algorithm should modules be signed with?` This presents a choice of which hash algorithm the installation phase will sign the modules with: =============================== ========================================== ``CONFIG_MODULE_SIG_SHA256`` :menuselection:`Sign modules with SHA-256` ``CONFIG_MODULE_SIG_SHA384`` :menuselection:`Sign modules with SHA-384` ``CONFIG_MODULE_SIG_SHA512`` :menuselection:`Sign modules with SHA-512` ``CONFIG_MODULE_SIG_SHA3_256`` :menuselection:`Sign modules with SHA3-256` ``CONFIG_MODULE_SIG_SHA3_384`` :menuselection:`Sign modules with SHA3-384` ``CONFIG_MODULE_SIG_SHA3_512`` :menuselection:`Sign modules with SHA3-512` =============================== ========================================== The algorithm selected here will also be built into the kernel (rather than being a module) so that modules signed with that algorithm can have their signatures checked without causing a dependency loop. (4) :menuselection:`File name or PKCS#11 URI of module signing key` (``CONFIG_MODULE_SIG_KEY``) Setting this option to something other than its default of ``certs/signing_key.pem`` will disable the autogeneration of signing keys and allow the kernel modules to be signed with a key of your choosing. The string provided should identify a file containing both a private key and its corresponding X.509 certificate in PEM form, or — on systems where the OpenSSL ENGINE_pkcs11 is functional — a PKCS#11 URI as defined by RFC7512. In the latter case, the PKCS#11 URI should reference both a certificate and a private key. If the PEM file containing the private key is encrypted, or if the PKCS#11 token requires a PIN, this can be provided at build time by means of the ``KBUILD_SIGN_PIN`` variable. (5) :menuselection:`Additional X.509 keys for default system keyring` (``CONFIG_SYSTEM_TRUSTED_KEYS``) This option can be set to the filename of a PEM-encoded file containing additional certificates which will be included in the system keyring by default. h]henumerated_list)}(hhh](h list_item)}(hX+:menuselection:`Require modules to be validly signed` (``CONFIG_MODULE_SIG_FORCE``) This specifies how the kernel should deal with a module that has a signature for which the key is not known or a module that is unsigned. If this is off (ie. "permissive"), then modules for which the key is not available and modules that are unsigned are permitted, but the kernel will be marked as being tainted, and the concerned modules will be marked as tainted, shown with the character 'E'. If this is on (ie. "restrictive"), only modules that have a valid signature that can be verified by a public key in the kernel's possession will be loaded. All other modules will generate an error. Irrespective of the setting here, if the module has a signature block that cannot be parsed, it will be rejected out of hand. h](jb)}(hS:menuselection:`Require modules to be validly signed` (``CONFIG_MODULE_SIG_FORCE``)h](j)}(h$Require modules to be validly signedh]h$Require modules to be validly signed}(hjhhhNhNubah}(h]h ] menuselectionah"]h$]h&]rawtext5:menuselection:`Require modules to be validly signed`uh1jhjubh (}(hjhhhNhNubhliteral)}(h``CONFIG_MODULE_SIG_FORCE``h]hCONFIG_MODULE_SIG_FORCE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh)}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jahhhK1hjubjb)}(hThis specifies how the kernel should deal with a module that has a signature for which the key is not known or a module that is unsigned.h]hThis specifies how the kernel should deal with a module that has a signature for which the key is not known or a module that is unsigned.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jahhhK4hjubjb)}(hXIf this is off (ie. "permissive"), then modules for which the key is not available and modules that are unsigned are permitted, but the kernel will be marked as being tainted, and the concerned modules will be marked as tainted, shown with the character 'E'.h]hX If this is off (ie. “permissive”), then modules for which the key is not available and modules that are unsigned are permitted, but the kernel will be marked as being tainted, and the concerned modules will be marked as tainted, shown with the character ‘E’.}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1jahhhK7hjubjb)}(hIf this is on (ie. "restrictive"), only modules that have a valid signature that can be verified by a public key in the kernel's possession will be loaded. All other modules will generate an error.h]hIf this is on (ie. “restrictive”), only modules that have a valid signature that can be verified by a public key in the kernel’s possession will be loaded. All other modules will generate an error.}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1jahhhK