summaryrefslogtreecommitdiffstats
path: root/security/keys/key.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2019-02-14 17:20:37 +0100
committerJames Morris <james.morris@microsoft.com>2019-02-15 23:12:09 +0100
commit7c1857bdbdf1e4c541e45eab477ee23ed4333ea4 (patch)
tree88cb14cc9520c998adfaf2fecddad900e566b8ce /security/keys/key.c
parentkeys: Fix dependency loop between construction record and auth key (diff)
downloadlinux-7c1857bdbdf1e4c541e45eab477ee23ed4333ea4.tar.xz
linux-7c1857bdbdf1e4c541e45eab477ee23ed4333ea4.zip
keys: Timestamp new keys
Set the timestamp on new keys rather than leaving it unset. Fixes: 31d5a79d7f3d ("KEYS: Do LRU discard in full keyrings") Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: James Morris <james.morris@microsoft.com>
Diffstat (limited to 'security/keys/key.c')
-rw-r--r--security/keys/key.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/security/keys/key.c b/security/keys/key.c
index 0ec9322af4f9..696f1c092c50 100644
--- a/security/keys/key.c
+++ b/security/keys/key.c
@@ -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;