summaryrefslogtreecommitdiffstats
path: root/arch/s390/Kconfig
diff options
context:
space:
mode:
authorAnastasia Eskova <anastasia.eskova@ibm.com>2023-04-28 06:42:42 -0400
committerHeiko Carstens <hca@linux.ibm.com>2023-07-24 12:12:21 +0200
commit8cf57d7217c32133d25615324c0ab4aaacf4d9c4 (patch)
tree7625a540aaf7d1e854a09fca5d528f867c51a961 /arch/s390/Kconfig
parent6eaae198076080886b9e7d57f4ae06fa782f90ef (diff)
downloadlinux-stable-8cf57d7217c32133d25615324c0ab4aaacf4d9c4.tar.gz
linux-stable-8cf57d7217c32133d25615324c0ab4aaacf4d9c4.tar.bz2
linux-stable-8cf57d7217c32133d25615324c0ab4aaacf4d9c4.zip
s390: add support for user-defined certificates
Enable receiving the user-defined certificates from the s390x hypervisor via new diagnose 0x320 calls, and make them available to the Linux root user as 'cert_store_key' type keys in a so-called 'cert_store' keyring. New user-space interfaces: /sys/firmware/cert_store/refresh Writing to this attribute re-fetches certificates via DIAG 0x320 /sys/firmware/cert_store/cs_status Reading from this attribute returns either of: "uninitialized" If no certificate has been retrieved yet "ok" If certificates have been successfully retrieved "failed (<number>)" If certificate retrieval failed with reason code <number> New debug trace areas: /sys/kernel/debug/s390dbf/cert_store_msg /sys/kernel/debug/s390dbf/cert_store_hexdump Usage example: To initiate request for certificates available to the system as root: $ echo 1 > /sys/firmware/cert_store/refresh Upon success the '/sys/firmware/cert_store/cs_status' contains the value 'ok'. $ cat /sys/firmware/cert_store/cs_status ok Get the ID of the keyring 'cert_store': $ keyctl search @us keyring cert_store OR $ keyctl link @us @s; keyctl request keyring cert_store Obtain list of IDs of certificates: $ keyctl rlist <cert_store keyring ID> Display certificate content as hex-dump: $ keyctl read <certificate ID> Read certificate contents as binary data: $ keyctl pipe <certificate ID> >cert_data Display certificate description: $ keyctl describe <certificate ID> The certificate description has the following format: <64 bytes certificate name in EBCDIC> ':' <certificate index as obtained from hypervisor> ':' <certificate store token obtained from hypervisor> The certificate description in /proc/keys has certificate name represented in ASCII. Users can read but cannot update the content of the certificate. Signed-off-by: Anastasia Eskova <anastasia.eskova@ibm.com> Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch/s390/Kconfig')
-rw-r--r--arch/s390/Kconfig10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 5b39918b7042..c0afca69904e 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -512,6 +512,16 @@ config KEXEC_SIG
verification for the corresponding kernel image type being
loaded in order for this to work.
+config CERT_STORE
+ bool "Get user certificates via DIAG320"
+ depends on KEYS
+ help
+ Enable this option if you want to access user-provided secure boot
+ certificates via DIAG 0x320.
+
+ These certificates will be made available via the keyring named
+ 'cert_store'.
+
config KERNEL_NOBP
def_bool n
prompt "Enable modified branch prediction for the kernel by default"