提交 0d92242c 编写于 作者: Z Zhang Tianxing 提交者: Zheng Zengkai

Revert "keys: Add domain tag to the keyring search criteria"

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I4O25G
CVE: NA

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

This reverts commit d3ef5f85.
Signed-off-by: NZhang Tianxing <zhangtianxing3@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
Acked-by: Xiu Jianfeng<xiujianfeng@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 210bd463
...@@ -417,11 +417,10 @@ extern int restrict_link_reject(struct key *keyring, ...@@ -417,11 +417,10 @@ extern int restrict_link_reject(struct key *keyring,
extern int keyring_clear(struct key *keyring); extern int keyring_clear(struct key *keyring);
extern key_ref_t keyring_search_tag(key_ref_t keyring, extern key_ref_t keyring_search(key_ref_t keyring,
struct key_type *type, struct key_type *type,
const char *description, const char *description,
struct key_tag *domain_tag, bool recurse);
bool recurse);
extern int keyring_add_key(struct key *keyring, extern int keyring_add_key(struct key *keyring,
struct key *key); struct key *key);
...@@ -431,14 +430,6 @@ extern int keyring_restrict(key_ref_t keyring, const char *type, ...@@ -431,14 +430,6 @@ extern int keyring_restrict(key_ref_t keyring, const char *type,
extern struct key *key_lookup(key_serial_t id); extern struct key *key_lookup(key_serial_t id);
static inline key_ref_t keyring_search(key_ref_t keyring,
struct key_type *type,
const char *description,
bool recurse)
{
return keyring_search_tag(keyring, type, description, NULL, recurse);
}
static inline key_serial_t key_serial(const struct key *key) static inline key_serial_t key_serial(const struct key *key)
{ {
return key ? key->serial : 0; return key ? key->serial : 0;
......
...@@ -925,25 +925,22 @@ key_ref_t keyring_search_rcu(key_ref_t keyring_ref, ...@@ -925,25 +925,22 @@ key_ref_t keyring_search_rcu(key_ref_t keyring_ref,
} }
/** /**
* keyring_search_tag - Search the supplied keyring tree for a matching key * keyring_search - Search the supplied keyring tree for a matching key
* @keyring: The root of the keyring tree to be searched. * @keyring: The root of the keyring tree to be searched.
* @type: The type of keyring we want to find. * @type: The type of keyring we want to find.
* @description: The name of the keyring we want to find. * @description: The name of the keyring we want to find.
* @domain_tag: The domain_tag of the key we want to find.
* @recurse: True to search the children of @keyring also * @recurse: True to search the children of @keyring also
* *
* As keyring_search_rcu() above, but using the current task's credentials and * As keyring_search_rcu() above, but using the current task's credentials and
* type's default matching function and preferred search method. * type's default matching function and preferred search method.
*/ */
key_ref_t keyring_search_tag(key_ref_t keyring, key_ref_t keyring_search(key_ref_t keyring,
struct key_type *type, struct key_type *type,
const char *description, const char *description,
struct key_tag *domain_tag, bool recurse)
bool recurse)
{ {
struct keyring_search_context ctx = { struct keyring_search_context ctx = {
.index_key.type = type, .index_key.type = type,
.index_key.domain_tag = domain_tag,
.index_key.description = description, .index_key.description = description,
.index_key.desc_len = strlen(description), .index_key.desc_len = strlen(description),
.cred = current_cred(), .cred = current_cred(),
...@@ -971,7 +968,7 @@ key_ref_t keyring_search_tag(key_ref_t keyring, ...@@ -971,7 +968,7 @@ key_ref_t keyring_search_tag(key_ref_t keyring,
type->match_free(&ctx.match_data); type->match_free(&ctx.match_data);
return key; return key;
} }
EXPORT_SYMBOL(keyring_search_tag); EXPORT_SYMBOL(keyring_search);
static struct key_restriction *keyring_restriction_alloc( static struct key_restriction *keyring_restriction_alloc(
key_restrict_link_func_t check) key_restrict_link_func_t check)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册