提交 0013e500 编写于 作者: D David Howells 提交者: Xie XiuQi

keys: Timestamp new keys

mainline inclusion
from mainline-5.0-rc8
commit 7c1857bd
category: bugfix
bugzilla: 10783
CVE: NA

---------------------------

Set the timestamp on new keys rather than leaving it unset.

Fixes: 31d5a79d ("KEYS: Do LRU discard in full keyrings")
Signed-off-by: NDavid Howells <dhowells@redhat.com>
Signed-off-by: NJames Morris <james.morris@microsoft.com>
Signed-off-by: NJason Yan <yanaijie@huawei.com>
Reviewed-by: NZhangXiaoxu <zhangxiaoxu5@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 8282e42e
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册