]> 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 13:02:31 +0000 (14:02 +0100)
commit841b3868a64f6f3fd06bf7797ba149eb53c2ee45
treed4eba7a222810480e3a24f0e1d14a1e160223044
parent58c47ba6f329f1597f077640c84c290a2adb1119
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