libkcapi/001-fix-fuzz-test.patch
DistroBaker 2812e3c806 Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/libkcapi.git#5db30d35f3a03860e8a9f2deda675b94ec6e2cb9
2021-04-04 23:30:48 +00:00

38 lines
1.3 KiB
Diff

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;