Thread (17 messages) 17 messages, 2 authors, 2017-04-04
STALE3348d

[PATCH v13 03/10] KEYS: Add a key restriction struct

From: Mat Martineau <hidden>
Date: 2017-03-30 23:50:20
Subsystem: keys/keyrings, the rest · Maintainers: David Howells, Jarkko Sakkinen, Linus Torvalds

Key link restrictions require restriction-specific data as well as a
restriction-specific function pointer. As a first step toward replacing
the restrict_link pointer in struct key, define a more general
key_restriction structure that captures the required function, key, and
key type pointers. Key type modules should not be pinned on account of
this key type pointer because the pointer will be cleared by the garbage
collector if the key type is unregistered.

Signed-off-by: Mat Martineau <redacted>
---
 include/linux/key.h | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/include/linux/key.h b/include/linux/key.h
index 59cad0268fa7..9fd726642846 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -131,6 +131,12 @@ typedef int (*key_restrict_link_func_t)(struct key *dest_keyring,
 					const union key_payload *payload,
 					struct key *restriction_key);
 
+struct key_restriction {
+	key_restrict_link_func_t check;
+	struct key *key;
+	struct key_type *keytype;
+};
+
 /*****************************************************************************/
 /*
  * authentication token / access credential / keyring
-- 
2.12.1

--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help