Skip to contentSkip to conversation

af_alg08: Allow EINVAL when calling recv()

PATCH In review Wei Gao via ltp 2 participants 5 messages May 19

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 af_alg08: Allow EINVAL when calling recv()

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.

---
 testcases/kernel/crypto/af_alg08.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
testcases/kernel/crypto/af_alg08.c +4 -1
index 5e04b579c..3de76b428 100644
@@ -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]);
Signature · 5 lines
2.54.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#3 lore raw
Quoted 3 lines · Andrea Cervesato via ltp

Sorry I didn't double check the CI. Can you please send a new version fixing the patch applying issue?
https://github.com/linux-test-project/ltp/actions/runs/26086543445

The patch fails to apply because the issue has already been fixed:
https://github.com/linux-test-project/ltp/commit/88b249e6bdf3086cb402c2aab324b200c3d0c2ea

Signature · 10 lines
Martin Doucha   [email protected]
SW Quality Engineer
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#4 lore raw

Hi Martin,

Quoted 7 lines · Andrea Cervesato via ltp
Quoted 3 lines

Sorry I didn't double check the CI. Can you please send a new version fixing the patch applying issue?
https://github.com/linux-test-project/ltp/actions/runs/26086543445

The patch fails to apply because the issue has already been fixed:
https://github.com/linux-test-project/ltp/commit/88b249e6bdf3086cb402c2aab324b200c3d0c2ea

thanks for double checking.

Regards,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
[email protected]

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp