Kconfig 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. # SPDX-License-Identifier: GPL-2.0
  2. menu "Certificates for signature checking"
  3. config MODULE_SIG_KEY
  4. string "File name or PKCS#11 URI of module signing key"
  5. default "certs/signing_key.pem"
  6. depends on MODULE_SIG || (IMA_APPRAISE_MODSIG && MODULES)
  7. help
  8. Provide the file name of a private key/certificate in PEM format,
  9. or a PKCS#11 URI according to RFC7512. The file should contain, or
  10. the URI should identify, both the certificate and its corresponding
  11. private key.
  12. If this option is unchanged from its default "certs/signing_key.pem",
  13. then the kernel will automatically generate the private key and
  14. certificate as described in Documentation/admin-guide/module-signing.rst
  15. choice
  16. prompt "Type of module signing key to be generated"
  17. depends on MODULE_SIG || (IMA_APPRAISE_MODSIG && MODULES)
  18. help
  19. The type of module signing key type to generate. This option
  20. does not apply if a #PKCS11 URI is used.
  21. config MODULE_SIG_KEY_TYPE_RSA
  22. bool "RSA"
  23. help
  24. Use an RSA key for module signing.
  25. config MODULE_SIG_KEY_TYPE_ECDSA
  26. bool "ECDSA"
  27. select CRYPTO_ECDSA
  28. depends on !(MODULE_SIG_SHA256 || MODULE_SIG_SHA3_256)
  29. help
  30. Use an elliptic curve key (NIST P384) for module signing. Use
  31. a strong hash of same or higher bit length, i.e. sha384 or
  32. sha512 for hashing modules.
  33. Note: Remove all ECDSA signing keys, e.g. certs/signing_key.pem,
  34. when falling back to building Linux 5.14 and older kernels.
  35. endchoice
  36. config SYSTEM_TRUSTED_KEYRING
  37. bool "Provide system-wide ring of trusted keys"
  38. depends on KEYS
  39. depends on ASYMMETRIC_KEY_TYPE
  40. depends on X509_CERTIFICATE_PARSER = y
  41. help
  42. Provide a system keyring to which trusted keys can be added. Keys in
  43. the keyring are considered to be trusted. Keys may be added at will
  44. by the kernel from compiled-in data and from hardware key stores, but
  45. userspace may only add extra keys if those keys can be verified by
  46. keys already in the keyring.
  47. Keys in this keyring are used by module signature checking.
  48. config SYSTEM_TRUSTED_KEYS
  49. string "Additional X.509 keys for default system keyring"
  50. depends on SYSTEM_TRUSTED_KEYRING
  51. help
  52. If set, this option should be the filename of a PEM-formatted file
  53. containing trusted X.509 certificates to be included in the default
  54. system keyring. Any certificate used for module signing is implicitly
  55. also trusted.
  56. NOTE: If you previously provided keys for the system keyring in the
  57. form of DER-encoded *.x509 files in the top-level build directory,
  58. those are no longer used. You will need to set this option instead.
  59. config SYSTEM_EXTRA_CERTIFICATE
  60. bool "Reserve area for inserting a certificate without recompiling"
  61. depends on SYSTEM_TRUSTED_KEYRING
  62. help
  63. If set, space for an extra certificate will be reserved in the kernel
  64. image. This allows introducing a trusted certificate to the default
  65. system keyring without recompiling the kernel.
  66. config SYSTEM_EXTRA_CERTIFICATE_SIZE
  67. int "Number of bytes to reserve for the extra certificate"
  68. depends on SYSTEM_EXTRA_CERTIFICATE
  69. default 4096
  70. help
  71. This is the number of bytes reserved in the kernel image for a
  72. certificate to be inserted.
  73. config SECONDARY_TRUSTED_KEYRING
  74. bool "Provide a keyring to which extra trustable keys may be added"
  75. depends on SYSTEM_TRUSTED_KEYRING
  76. help
  77. If set, provide a keyring to which extra keys may be added, provided
  78. those keys are not blacklisted and are vouched for by a key built
  79. into the kernel, machine keyring (if configured), or already in the
  80. secondary trusted keyring.
  81. config SECONDARY_TRUSTED_KEYRING_SIGNED_BY_BUILTIN
  82. bool "Only allow additional certs signed by keys on the builtin trusted keyring"
  83. depends on SECONDARY_TRUSTED_KEYRING
  84. help
  85. If set, only certificates signed by keys on the builtin trusted
  86. keyring may be loaded onto the secondary trusted keyring.
  87. Note: The machine keyring, if configured, will be linked to the
  88. secondary keyring. When enabling this option, it is recommended
  89. to also configure INTEGRITY_CA_MACHINE_KEYRING_MAX to prevent
  90. linking code signing keys with imputed trust to the secondary
  91. trusted keyring.
  92. config SYSTEM_BLACKLIST_KEYRING
  93. bool "Provide system-wide ring of blacklisted keys"
  94. depends on KEYS
  95. help
  96. Provide a system keyring to which blacklisted keys can be added.
  97. Keys in the keyring are considered entirely untrusted. Keys in this
  98. keyring are used by the module signature checking to reject loading
  99. of modules signed with a blacklisted key.
  100. config SYSTEM_BLACKLIST_HASH_LIST
  101. string "Hashes to be preloaded into the system blacklist keyring"
  102. depends on SYSTEM_BLACKLIST_KEYRING
  103. help
  104. If set, this option should be the filename of a list of hashes in the
  105. form "<hash>", "<hash>", ... . This will be included into a C
  106. wrapper to incorporate the list into the kernel. Each <hash> must be a
  107. string starting with a prefix ("tbs" or "bin"), then a colon (":"), and
  108. finally an even number of hexadecimal lowercase characters (up to 128).
  109. Certificate hashes can be generated with
  110. tools/certs/print-cert-tbs-hash.sh .
  111. config SYSTEM_REVOCATION_LIST
  112. bool "Provide system-wide ring of revocation certificates"
  113. depends on SYSTEM_BLACKLIST_KEYRING
  114. depends on PKCS7_MESSAGE_PARSER=y
  115. help
  116. If set, this allows revocation certificates to be stored in the
  117. blacklist keyring and implements a hook whereby a PKCS#7 message can
  118. be checked to see if it matches such a certificate.
  119. config SYSTEM_REVOCATION_KEYS
  120. string "X.509 certificates to be preloaded into the system blacklist keyring"
  121. depends on SYSTEM_REVOCATION_LIST
  122. help
  123. If set, this option should be the filename of a PEM-formatted file
  124. containing X.509 certificates to be included in the default blacklist
  125. keyring.
  126. config SYSTEM_BLACKLIST_AUTH_UPDATE
  127. bool "Allow root to add signed blacklist keys"
  128. depends on SYSTEM_BLACKLIST_KEYRING
  129. depends on SYSTEM_DATA_VERIFICATION
  130. help
  131. If set, provide the ability to load new blacklist keys at run time if
  132. they are signed and vouched by a certificate from the builtin trusted
  133. keyring. The PKCS#7 signature of the description is set in the key
  134. payload. Blacklist keys cannot be removed.
  135. endmenu