Skip to content

Commit

Permalink
keys: Export lookup_user_key to external users
Browse files Browse the repository at this point in the history
Export lookup_user_key() symbol in order to allow nvdimm passphrase
update to retrieve user injected keys.

Signed-off-by: Dave Jiang <[email protected]>
Acked-by: David Howells <[email protected]>
Signed-off-by: Dan Williams <[email protected]>
  • Loading branch information
davejiang authored and djbw committed Dec 14, 2018
1 parent d6548ae commit 76ef5e1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions include/linux/key.h
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,9 @@ static inline key_serial_t key_serial(const struct key *key)

extern void key_set_timeout(struct key *, unsigned);

extern key_ref_t lookup_user_key(key_serial_t id, unsigned long flags,
key_perm_t perm);

/*
* The permissions required on a key that we're looking up.
*/
Expand Down
2 changes: 0 additions & 2 deletions security/keys/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,6 @@ extern struct key *request_key_and_link(struct key_type *type,

extern bool lookup_user_key_possessed(const struct key *key,
const struct key_match_data *match_data);
extern key_ref_t lookup_user_key(key_serial_t id, unsigned long flags,
key_perm_t perm);
#define KEY_LOOKUP_CREATE 0x01
#define KEY_LOOKUP_PARTIAL 0x02
#define KEY_LOOKUP_FOR_UNLINK 0x04
Expand Down
1 change: 1 addition & 0 deletions security/keys/process_keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,7 @@ key_ref_t lookup_user_key(key_serial_t id, unsigned long lflags,
put_cred(ctx.cred);
goto try_again;
}
EXPORT_SYMBOL(lookup_user_key);

/*
* Join the named keyring as the session keyring if possible else attempt to
Expand Down

0 comments on commit 76ef5e1

Please sign in to comment.