Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crypto: algif_aead - fix uninitialized ctx->init #7

Closed
wants to merge 1 commit into from

Conversation

shaoyingxu
Copy link

Hello,

This pull request is to ingest the patch as a follow-up fix of commit ("crypto: algif_aead - Only wake up when ctx->more is zero") to openela 4.14 kernel and they are together to fix the crypto encryption issue reported upstream: https://lore.kernel.org/all/20240320143143.1643630-1-ralph.siemsen@linaro.org/. Could you please help to add this patch?

Thanks,
Shaoying

commit 21dfbcd1f5cbff9cf2f9e7e43475aed8d072b0dd upstram.

In skcipher_accept_parent_nokey() the whole af_alg_ctx structure is
cleared by memset() after allocation, so add such memset() also to
aead_accept_parent_nokey() so that the new "init" field is also
initialized to zero. Without that the initial ctx->init checks might
randomly return true and cause errors.

While there, also remove the redundant zero assignments in both
functions.

Found via libkcapi testsuite.

Cc: Stephan Mueller <smueller@chronox.de>
Fixes: f3c802a1f300 ("crypto: algif_aead - Only wake up when ctx->more is zero")
Suggested-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Suraj Jitindar Singh <surajjs@amazon.com>
@harshimogalapalli
Copy link

Thanks for contributing, will try getting into next release. Thanks.

@harshimogalapalli
Copy link

Hi @shaoyingxu

Thanks for your contribution.

This commit got merged into 4.14.349-openela release(which is released 6 hrs back).

Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants