Unverified Commit 58ec866c authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!13165 security/keys: fix slab-out-of-bounds in key_task_permission

parents 078e0901 a46eb00f
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -739,8 +739,11 @@ static bool search_nested_keyrings(struct key *keyring,
	for (; slot < ASSOC_ARRAY_FAN_OUT; slot++) {
		ptr = READ_ONCE(node->slots[slot]);

		if (assoc_array_ptr_is_meta(ptr) && node->back_pointer)
		if (assoc_array_ptr_is_meta(ptr)) {
			if (node->back_pointer ||
			    assoc_array_ptr_is_shortcut(ptr))
				goto descend_to_node;
		}

		if (!keyring_ptr_is_keyring(ptr))
			continue;