Skip to content

Commit

Permalink
keys: Timestamp new keys
Browse files Browse the repository at this point in the history
Set the timestamp on new keys rather than leaving it unset.

Fixes: 31d5a79 ("KEYS: Do LRU discard in full keyrings")
Signed-off-by: David Howells <[email protected]>
Signed-off-by: James Morris <[email protected]>
  • Loading branch information
dhowells authored and James Morris committed Feb 15, 2019
1 parent 822ad64 commit 7c1857b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions security/keys/key.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ struct key *key_alloc(struct key_type *type, const char *desc,
key->gid = gid;
key->perm = perm;
key->restrict_link = restrict_link;
key->last_used_at = ktime_get_real_seconds();

if (!(flags & KEY_ALLOC_NOT_IN_QUOTA))
key->flags |= 1 << KEY_FLAG_IN_QUOTA;
Expand Down

0 comments on commit 7c1857b

Please sign in to comment.