Linux Test Project
 help / color / mirror / Atom feed
* [LTP] [PATCH v1] af_alg08: Allow EINVAL when calling recv()
@ 2026-05-19  6:57 Wei Gao via ltp
  2026-05-19  8:43 ` Andrea Cervesato via ltp
  0 siblings, 1 reply; 5+ messages in thread
From: Wei Gao via ltp @ 2026-05-19  6:57 UTC (permalink / raw)
  To: ltp

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


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-05-19  9:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-19  6:57 [LTP] [PATCH v1] af_alg08: Allow EINVAL when calling recv() Wei Gao via ltp
2026-05-19  8:43 ` Andrea Cervesato via ltp
2026-05-19  8:53   ` Andrea Cervesato via ltp
2026-05-19  8:55     ` Martin Doucha
2026-05-19  9:35       ` Andrea Cervesato via ltp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox