Thread (26 messages) 26 messages, 4 authors, 2021-08-13

[PATCH v3 11/14] KEYS: link secondary_trusted_keys to mok trusted keys

flat view
STALE1898d SUPERSEDED

From: Eric Snowberg <eric.snowberg@oracle.com>
Date: 2021-08-12 02:21:05
Also in: keyrings, linux-integrity, linux-security-module, lkml
Subsystem: certificate handling, the rest · Maintainers: David Howells, David Woodhouse, Linus Torvalds

Revision v3 of 8 in this series.

Revisions (8)
  1. rfc [diff vs current]
  2. v2 [diff vs current]
  3. v3 current
  4. v4 [diff vs current]
  5. v5 [diff vs current]
  6. v6 [diff vs current]
  7. v7 [diff vs current]
  8. v8 [diff vs current]
Allow the .mok keyring to be linked to the secondary_trusted_keys.  After
the link is created, keys contained in the .mok keyring will automatically
be searched when searching secondary_trusted_keys.

Signed-off-by: Eric Snowberg <eric.snowberg@oracle.com>
---
v3: Initial version
---
 certs/system_keyring.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/certs/system_keyring.c b/certs/system_keyring.c
index 8cc19a1ff051..f6fcd53e3a0e 100644
--- a/certs/system_keyring.c
+++ b/certs/system_keyring.c
@@ -117,6 +117,9 @@ static __init struct key_restriction *get_builtin_and_secondary_restriction(void
 void __init set_mok_trusted_keys(struct key *keyring)
 {
 	mok_trusted_keys = keyring;
+
+	if (key_link(secondary_trusted_keys, mok_trusted_keys) < 0)
+		panic("Can't link (mok) trusted keyrings\n");
 }
 #endif
 
-- 
2.18.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help