keys: Allow access to key_type_lookup
Subsystems (2)
cover keys: Allow access to key_type_lookup
Planned changes to block/sed-opal will need to access a Platform Key-Store (PKS) in a platform-independent manner. Linux keyrings were chosen for that. This code will need to use key_type_lookup() to check for existence of the PKS key-type and adapt accordingly.
PATCH RESEND 1/1 keys: Allow access to key_type_lookup()/key_type_put() within kernel.
--- include/linux/key-type.h | 2 ++ security/keys/key.c | 2 ++ 2 files changed, 4 insertions(+)
include/linux/key-type.h +2 -0
@@ -165,6 +165,8 @@ extern struct key_type key_type_keyring;extern int register_key_type (struct key_type *ktype);extern void unregister_key_type (struct key_type *ktype); +extern struct key_type *key_type_lookup (const char *type); +extern void key_type_put (struct key_type *ktype);extern int key_payload_reserve (struct key *key,size_t datalen); extern int key_instantiate_and_link(struct key *key,
security/keys/key.c +2 -0
@@ -719,6 +719,7 @@ struct key_type *key_type_lookup(const char *type) found_kernel_type:return ktype; } +EXPORT_SYMBOL (key_type_lookup);void key_set_timeout (struct key *key,unsigned timeout) {
@@ -744,6 +745,7 @@ void key_type_put(struct key_type *ktype) {up_read (&key_types_sem); } +EXPORT_SYMBOL (key_type_put);/* * Attempt to update an existing key.
Signature · 1 line
2.27.0
Jarkko Sakkinen
maintainerRe: [PATCH RESEND 1/1] keys: Allow access to key_type_lookup()/key_type_put() within kernel.
Quoted 42 lines · Douglas Miller
Signed-off-by Douglas Miller <[email protected]>--- include/linux/key-type.h | 2 ++ security/keys/key.c | 2 ++ 2 files changed, 4 insertions(+)include/linux/key-type.h +2
-0@@ -165,6 +165,8 @@ extern struct key_type key_type_keyring;extern int register_key_type (struct key_type *ktype);extern void unregister_key_type (struct key_type *ktype); +extern struct key_type *key_type_lookup (const char *type); +extern void key_type_put (struct key_type *ktype);extern int key_payload_reserve (struct key *key,size_t datalen); extern int key_instantiate_and_link(struct key *key,security/keys/key.c +2
-0@@ -719,6 +719,7 @@ struct key_type *key_type_lookup(const char *type) found_kernel_type:return ktype; } +EXPORT_SYMBOL (key_type_lookup);void key_set_timeout (struct key *key,unsigned timeout) {@@ -744,6 +745,7 @@ void key_type_put(struct key_type *ktype) {up_read (&key_types_sem); } +EXPORT_SYMBOL (key_type_put);/* * Attempt to update an existing key. Signature · 1 line
2.27.0
This should be included with the changes that actually require this.
BR, Jarkko
Jarkko Sakkinen
maintainerRe: [PATCH RESEND 1/1] keys: Allow access to key_type_lookup()/key_type_put() within kernel.
Quoted 38 lines · Jarkko Sakkinen
Quoted 37 lines · Douglas Miller
Signed-off-by Douglas Miller <[email protected]>--- include/linux/key-type.h | 2 ++ security/keys/key.c | 2 ++ 2 files changed, 4 insertions(+)include/linux/key-type.h +2
-0@@ -165,6 +165,8 @@ extern struct key_type key_type_keyring;extern int register_key_type (struct key_type *ktype);extern void unregister_key_type (struct key_type *ktype); +extern struct key_type *key_type_lookup (const char *type); +extern void key_type_put (struct key_type *ktype);extern int key_payload_reserve (struct key *key,size_t datalen); extern int key_instantiate_and_link(struct key *key,security/keys/key.c +2
-0@@ -719,6 +719,7 @@ struct key_type *key_type_lookup(const char *type) found_kernel_type:return ktype; } +EXPORT_SYMBOL (key_type_lookup);void key_set_timeout (struct key *key,unsigned timeout) {@@ -744,6 +745,7 @@ void key_type_put(struct key_type *ktype) {up_read (&key_types_sem); } +EXPORT_SYMBOL (key_type_put);
Quoted 7 lines
Quoted 5 lines
security/keys/key.c +0
-0/* * Attempt to update an existing key. Signature · 1 line
2.27.0This should be included with the changes that actually require this.
I.e. planned changes do not count.
BR, Jarkko