-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
integrity: Define a trusted platform keyring
On secure boot enabled systems, a verified kernel may need to kexec additional kernels. For example, it may be used as a bootloader needing to kexec a target kernel or it may need to kexec a crashdump kernel. In such cases, it may want to verify the signature of the next kernel image. It is further possible that the kernel image is signed with third party keys which are stored as platform or firmware keys in the 'db' variable. The kernel, however, can not directly verify these platform keys, and an administrator may therefore not want to trust them for arbitrary usage. In order to differentiate platform keys from other keys and provide the necessary separation of trust, the kernel needs an additional keyring to store platform keys. This patch creates the new keyring called ".platform" to isolate keys provided by platform from keys by kernel. These keys are used to facilitate signature verification during kexec. Since the scope of this keyring is only the platform/firmware keys, it cannot be updated from userspace. This keyring can be enabled by setting CONFIG_INTEGRITY_PLATFORM_KEYRING. Signed-off-by: Nayna Jain <nayna@linux.ibm.com> Reviewed-by: Mimi Zohar <zohar@linux.ibm.com> Acked-by: Serge Hallyn <serge@hallyn.com> Reviewed-by: James Morris <james.morris@microsoft.com> Reviewed-by: Thiago Jung Bauermann <bauerman@linux.ibm.com> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
- Loading branch information
Nayna Jain
authored and
Mimi Zohar
committed
Dec 13, 2018
1 parent
a802ed0
commit 9dc92c4
Showing
5 changed files
with
81 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// SPDX-License-Identifier: GPL-2.0+ | ||
/* | ||
* Platform keyring for firmware/platform keys | ||
* | ||
* Copyright IBM Corporation, 2018 | ||
* Author(s): Nayna Jain <nayna@linux.ibm.com> | ||
*/ | ||
|
||
#include <linux/export.h> | ||
#include <linux/kernel.h> | ||
#include <linux/sched.h> | ||
#include <linux/cred.h> | ||
#include <linux/err.h> | ||
#include <linux/slab.h> | ||
#include "../integrity.h" | ||
|
||
/* | ||
* Create the trusted keyrings. | ||
*/ | ||
static __init int platform_keyring_init(void) | ||
{ | ||
int rc; | ||
|
||
rc = integrity_init_keyring(INTEGRITY_KEYRING_PLATFORM); | ||
if (rc) | ||
return rc; | ||
|
||
pr_notice("Platform Keyring initialized\n"); | ||
return 0; | ||
} | ||
|
||
/* | ||
* Must be initialised before we try and load the keys into the keyring. | ||
*/ | ||
device_initcall(platform_keyring_init); |