mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 23:27:06 +00:00
keys: Timestamp new keys
[ Upstream commit7c1857bdbd
] Set the timestamp on new keys rather than leaving it unset. Fixes:31d5a79d7f
("KEYS: Do LRU discard in full keyrings") Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: James Morris <james.morris@microsoft.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
b77f9249e6
commit
0abc0d523a
1 changed files with 1 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue