Skip to content

Bug: Problems with copy scenarios in digest algorithm #199

@liuyangNB

Description

@liuyangNB
static int uadk_e_digest_copy(EVP_MD_CTX *to, const EVP_MD_CTX *from)
{
.........
	if (t->sess) {
		params.numa_id = -1;
		t->setup.sched_param = &params;
		t->sess = wd_digest_alloc_sess(&t->setup);
		if (!t->sess) {
			fprintf(stderr, "failed to alloc session for digest ctx copy.\n");
			return 0;
		}
........

In the uadk_e_digest_copy function, if the to context applies for hardware resources to calculate digest, and the hardware instance value is exhausted during the copy process, applying for a session to the to context will return failure. The code logic here is to return an error, and the business will be interrupted.

Recurrence conditions: Construct a situation where the instance value is small, triggering the calculation of digets in flow mode. For example, yum reinstall git or SSL link building, multiple processes can be started in the background to exhaust the queue. It will report failed to alloc session for digest ctx copy, and the business will fail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions