[LTP] [PATCH v1] af_alg08: Allow EINVAL when calling recv()

Wei Gao wegao@suse.com
Tue May 19 08:57:55 CEST 2026


On older kernels (e.g. 4.4), recv() on AF_ALG AEAD sockets may return
EINVAL instead of EBADMSG. Since the primary goal of this test is to
detect page cache corruption (which is verified separately), allow both
error codes.

Signed-off-by: Wei Gao <wegao@suse.com>
---
 testcases/kernel/crypto/af_alg08.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/testcases/kernel/crypto/af_alg08.c b/testcases/kernel/crypto/af_alg08.c
index 5e04b579c..3de76b428 100644
--- a/testcases/kernel/crypto/af_alg08.c
+++ b/testcases/kernel/crypto/af_alg08.c
@@ -100,7 +100,10 @@ static void try_corrupt(void)
 	SAFE_SPLICE(pipefd[0], NULL, reqfd, NULL, OVERWRITE_SIZE, 0);
 
 	/* Expected to fail (invalid ciphertext); triggers the scratch write */
-	TST_EXP_FAIL_SILENT(recv(reqfd, recvbuf, sizeof(recvbuf), 0), EBADMSG);
+	const int exp_errs[] = {EBADMSG, EINVAL};
+
+	TST_EXP_FAIL_ARR(recv(reqfd, recvbuf, sizeof(recvbuf), 0),
+			 exp_errs, ARRAY_SIZE(exp_errs));
 
 	SAFE_CLOSE(pipefd[0]);
 	SAFE_CLOSE(pipefd[1]);
-- 
2.54.0



More information about the ltp mailing list