Skip to content

Commit 037c343

Browse files
hreineckekeithbusch
authored andcommitted
security/keys: export key_lookup()
For in-kernel consumers one cannot readily assign a user (eg when running from a workqueue), so the normal key search permissions cannot be applied. This patch exports the 'key_lookup()' function for a simple lookup of keys without checking for permissions. Signed-off-by: Hannes Reinecke <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Acked-by: David Howells <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent 501cc6f commit 037c343

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

include/linux/key.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ extern void key_init(void);
515515
#define key_init() do { } while(0)
516516
#define key_free_user_ns(ns) do { } while(0)
517517
#define key_remove_domain(d) do { } while(0)
518+
#define key_lookup(k) NULL
518519

519520
#endif /* CONFIG_KEYS */
520521
#endif /* __KERNEL__ */

security/keys/key.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,7 @@ struct key *key_lookup(key_serial_t id)
693693
spin_unlock(&key_serial_lock);
694694
return key;
695695
}
696+
EXPORT_SYMBOL(key_lookup);
696697

697698
/*
698699
* Find and lock the specified key type against removal.

0 commit comments

Comments
 (0)