Home Home > GIT Browse > SLE12-SP4
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-07-17 12:38:06 +0200
committerTakashi Iwai <tiwai@suse.de>2019-07-17 12:38:06 +0200
commit187af5acf5ad2298218938a66776e34cab0ddb90 (patch)
treef216dfb350c931555996e4419132f6f3fe40b9f9
parenta34d4f31408f4a97616e5df98a025e7cbe274cfc (diff)
parent962cbcc2b3f19c2b0bc0560a75575a53bb0129a7 (diff)
Merge branch 'users/msuchanek/SLE15/for-next' into SLE15
Pull powerpc crypto fix from Michal Suchanek
-rw-r--r--config/ppc64le/default3
-rw-r--r--patches.arch/powerpc-crypto-Use-cheaper-random-numbers-for-crc-vp.patch54
-rw-r--r--series.conf1
-rw-r--r--supported.conf2
4 files changed, 59 insertions, 1 deletions
diff --git a/config/ppc64le/default b/config/ppc64le/default
index b06c824c76..2ce412c303 100644
--- a/config/ppc64le/default
+++ b/config/ppc64le/default
@@ -5246,7 +5246,8 @@ CONFIG_CRYPTO_CRC32C=y
CONFIG_CRYPTO_CRC32C_VPMSUM=m
CONFIG_CRYPTO_CRC32=m
CONFIG_CRYPTO_CRCT10DIF=y
-# CONFIG_CRYPTO_CRCT10DIF_VPMSUM is not set
+CONFIG_CRYPTO_CRCT10DIF_VPMSUM=m
+CONFIG_CRYPTO_VPMSUM_TESTER=m
CONFIG_CRYPTO_GHASH=m
CONFIG_CRYPTO_POLY1305=m
CONFIG_CRYPTO_MD4=m
diff --git a/patches.arch/powerpc-crypto-Use-cheaper-random-numbers-for-crc-vp.patch b/patches.arch/powerpc-crypto-Use-cheaper-random-numbers-for-crc-vp.patch
new file mode 100644
index 0000000000..717ed1daf8
--- /dev/null
+++ b/patches.arch/powerpc-crypto-Use-cheaper-random-numbers-for-crc-vp.patch
@@ -0,0 +1,54 @@
+From 80d04b7fabe161a23d143b3bfcfca1b002c23da1 Mon Sep 17 00:00:00 2001
+From: George Spelvin <lkml@sdf.org>
+Date: Thu, 21 Mar 2019 10:42:22 +0000
+Subject: [PATCH] powerpc/crypto: Use cheaper random numbers for crc-vpmsum
+ self-test
+
+References: FATE#327696
+Patch-mainline: v5.2-rc1
+Git-commit: 80d04b7fabe161a23d143b3bfcfca1b002c23da1
+
+This code was filling a 64K buffer from /dev/urandom in order to
+compute a CRC over (on average half of) it by two different methods,
+comparing the CRCs, and repeating.
+
+This is not a remotely security-critical application, so use the far
+faster and cheaper prandom_u32() generator.
+
+And, while we're at it, only fill as much of the buffer as we plan to use.
+
+Signed-off-by: George Spelvin <lkml@sdf.org>
+Acked-by: Daniel Axtens <dja@axtens.net>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Acked-by: Michal Suchanek <msuchanek@suse.de>
+---
+ arch/powerpc/crypto/crc-vpmsum_test.c | 10 +++-------
+ 1 file changed, 3 insertions(+), 7 deletions(-)
+
+diff --git a/arch/powerpc/crypto/crc-vpmsum_test.c b/arch/powerpc/crypto/crc-vpmsum_test.c
+index 0153a9c6f4af..98ea4f4d3dde 100644
+--- a/arch/powerpc/crypto/crc-vpmsum_test.c
++++ b/arch/powerpc/crypto/crc-vpmsum_test.c
+@@ -78,16 +78,12 @@ static int __init crc_test_init(void)
+
+ pr_info("crc-vpmsum_test begins, %lu iterations\n", iterations);
+ for (i=0; i<iterations; i++) {
+- size_t len, offset;
++ size_t offset = prandom_u32_max(16);
++ size_t len = prandom_u32_max(MAX_CRC_LENGTH);
+
+- get_random_bytes(data, MAX_CRC_LENGTH);
+- get_random_bytes(&len, sizeof(len));
+- get_random_bytes(&offset, sizeof(offset));
+-
+- len %= MAX_CRC_LENGTH;
+- offset &= 15;
+ if (len <= offset)
+ continue;
++ prandom_bytes(data, len);
+ len -= offset;
+
+ crypto_shash_update(crct10dif_shash, data+offset, len);
+--
+2.22.0
+
diff --git a/series.conf b/series.conf
index 7d1a7c867f..712e17a030 100644
--- a/series.conf
+++ b/series.conf
@@ -22486,6 +22486,7 @@
patches.suse/tipc-fix-hanging-clients-using-poll-with-EPOLLOUT-fl.patch
patches.fixes/vlan-disable-SIOCSHWTSTAMP-in-container.patch
patches.suse/packet-Fix-error-path-in-packet_init.patch
+ patches.arch/powerpc-crypto-Use-cheaper-random-numbers-for-crc-vp.patch
patches.arch/powerpc-numa-improve-control-of-topology-updates.patch
patches.arch/powerpc-numa-document-topology_updates_enabled-disab.patch
patches.arch/powerpc-powernv-idle-Restore-IAMR-after-idle.patch
diff --git a/supported.conf b/supported.conf
index 72649aaaba..17fd735091 100644
--- a/supported.conf
+++ b/supported.conf
@@ -27,6 +27,8 @@
arch/arm64/crypto/sha256-arm64
arch/arm64/crypto/sha512-arm64
arch/powerpc/crypto/crc32c-vpmsum # ppc-specific crc32c
+ arch/powerpc/crypto/crct10dif-vpmsum # FATE#327696
+- arch/powerpc/crypto/crc-vpmsum_test # test for the above modules
arch/powerpc/crypto/sha1-powerpc
arch/powerpc/crypto/md5-ppc
arch/powerpc/kernel/rtas_flash