Unverified Commit 0a119122 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

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

parents 4c009121 3a000fcf
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -772,8 +772,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;