Skip to content

Commit 7c1857b

Browse files
dhowellsJames Morris
authored andcommitted
keys: Timestamp new keys
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 <dhowells@redhat.com> Signed-off-by: James Morris <james.morris@microsoft.com>
1 parent 822ad64 commit 7c1857b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

security/keys/key.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ struct key *key_alloc(struct key_type *type, const char *desc,
297297
key->gid = gid;
298298
key->perm = perm;
299299
key->restrict_link = restrict_link;
300+
key->last_used_at = ktime_get_real_seconds();
300301

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

0 commit comments

Comments
 (0)