From: David Howells Date: Thu, 14 Feb 2019 16:20:37 +0000 (+0000) Subject: keys: Timestamp new keys X-Git-Tag: v4.19.99~438 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0abc0d523aa25d4e993c266374e7a807d5897461;p=platform%2Fkernel%2Flinux-rpi.git keys: Timestamp new keys [ Upstream commit 7c1857bdbdf1e4c541e45eab477ee23ed4333ea4 ] 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 Signed-off-by: James Morris Signed-off-by: Sasha Levin --- diff --git a/security/keys/key.c b/security/keys/key.c index 249a6da..749a5cf 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;