]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
crypto: authenc - Correctly pass EINPROGRESS back up to the caller
authorHerbert Xu <herbert@gondor.apana.org.au>
Wed, 24 Sep 2025 10:20:17 +0000 (18:20 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 12:54:43 +0000 (13:54 +0100)
commit752e578549ff116ed2d81a1d334f40b9fac7c034
treebad753a664d8e24dde5aaf1dacbe36dc9de0c9a4
parent9268a215905af10084cc659e4944fa1fa592ddc4
crypto: authenc - Correctly pass EINPROGRESS back up to the caller

[ Upstream commit 96feb73def02d175850daa0e7c2c90c876681b5c ]

When authenc is invoked with MAY_BACKLOG, it needs to pass EINPROGRESS
notifications back up to the caller when the underlying algorithm
returns EBUSY synchronously.

However, if the EBUSY comes from the second part of an authenc call,
i.e., it is asynchronous, both the EBUSY and the subsequent EINPROGRESS
notification must not be passed to the caller.

Implement this by passing a mask to the function that starts the
second half of authenc and using it to determine whether EBUSY
and EINPROGRESS should be passed to the caller.

This was a deficiency in the original implementation of authenc
because it was not expected to be used with MAY_BACKLOG.

Reported-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reported-by: Mikulas Patocka <mpatocka@redhat.com>
Fixes: 180ce7e81030 ("crypto: authenc - Add EINPROGRESS check")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
crypto/authenc.c