Add a patch to fix fuzz tests

Add a pending patch to fix fuzz tests hanging infinitely:
https://github.com/smuellerDD/libkcapi/pull/110

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
This commit is contained in:
Ondrej Mosnacek 2021-03-27 14:26:36 +01:00
parent f95b05caae
commit 8d3f288df5
2 changed files with 40 additions and 0 deletions

37
001-fix-fuzz-test.patch Normal file
View File

@ -0,0 +1,37 @@
From e8c22fe01c6dd46399396694cd1d72a6988dc287 Mon Sep 17 00:00:00 2001
From: Ondrej Mosnacek <omosnace@redhat.com>
Date: Sat, 27 Mar 2021 13:46:45 +0100
Subject: [PATCH] kcapi: Fix hang in fuzz tests with recent kernels
After kernel commit f3c802a1f300 ("crypto: algif_aead - Only wake up
when..."), the fuzz tests hang indefinitely, because they request more
output data than the operation can produce. Fix this by requesting at
most the expected size of the output data.
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
---
test/kcapi-main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/kcapi-main.c b/test/kcapi-main.c
index 64e466c..975e8d1 100644
--- a/test/kcapi-main.c
+++ b/test/kcapi-main.c
@@ -380,7 +380,7 @@ static int fuzz_cipher(struct kcapi_cavs *cavs_test, unsigned long flags,
}
for (i = 0; i < sizeof(indata); i++) {
- unsigned int outlen = sizeof(outdata);
+ unsigned int outlen = i;
uint8_t *out = outdata;
uint8_t *iv = indata;
uint8_t *in = indata;
@@ -474,7 +474,7 @@ static int fuzz_aead(struct kcapi_cavs *cavs_test, unsigned long flags,
}
for (i = 0; i < sizeof(indata); i++) {
- unsigned int outlen = sizeof(outdata);
+ unsigned int outlen = i;
uint8_t *out = outdata;
uint8_t *iv = indata;
uint8_t *in = indata;

View File

@ -135,6 +135,8 @@ Source1: https://www.chronox.de/%{name}/%{name}-%{version}.tar.xz.asc
Source2: sha512hmac-openssl.sh Source2: sha512hmac-openssl.sh
Source3: fipshmac-openssl.sh Source3: fipshmac-openssl.sh
Patch001: %{giturl}/pull/110.patch#/001-fix-fuzz-test.patch
BuildRequires: bash BuildRequires: bash
BuildRequires: coreutils BuildRequires: coreutils
BuildRequires: gcc BuildRequires: gcc
@ -514,6 +516,7 @@ popd
- Update to upstream version 1.2.1 - Update to upstream version 1.2.1
- Remove patch fix MSG_MORE uasge as it is added upstream - Remove patch fix MSG_MORE uasge as it is added upstream
- Remove cppcheck dependency for rhel bz#1931518 - Remove cppcheck dependency for rhel bz#1931518
- Add a patch to fix fuzz tests
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-4 * Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild