From: Mat Martineau Date: Mon, 27 Jun 2016 23:10:59 +0000 (-0700) Subject: KEYS: Add a key restriction struct X-Git-Tag: v5.15~6410^2~241^2~2^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e9cc0f689a7c0c9be6fed6861b3a3f49ad0e7a52;p=platform%2Fkernel%2Flinux-starfive.git KEYS: Add a key restriction struct 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 --- diff --git a/include/linux/key.h b/include/linux/key.h index c59d100..a06649f 100644 --- a/include/linux/key.h +++ b/include/linux/key.h @@ -132,6 +132,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