summaryrefslogtreecommitdiff
path: root/debian/patches/0002-Fix-initialization-of-s390-hardware-switches-part-2.patch
blob: 5427706cf20ae83d28da0838c939735e7df30e91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From 9a0ff895de3756c2e1b0815cf9d96b77278e8282 Mon Sep 17 00:00:00 2001
From: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Date: Tue, 19 Apr 2016 12:43:35 +0200
Subject: [PATCH 2/2] Fix initialization of s390 hardware switches (part 2)

The initialization of the hardware switches was not done correctly.
This could lead to illegal access and segmentation fault.

Changed declaration of hardware switches to ensure uniqueness
across compile units and thereby proper initialization.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
---
 src/s390_crypto.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/s390_crypto.c b/src/s390_crypto.c
index 44fb40b..8424480 100644
--- a/src/s390_crypto.c
+++ b/src/s390_crypto.c
@@ -26,6 +26,11 @@
 #include "s390_crypto.h"
 #include "init.h"
 
+unsigned int sha1_switch, sha256_switch, sha512_switch, des_switch,
+             tdes_switch, aes128_switch, aes192_switch, aes256_switch,
+             prng_switch, tdea128_switch, tdea192_switch, sha512_drng_switch,
+             msa4_switch, msa5_switch;
+
 s390_supported_function_t s390_kimd_functions[] = {
 	{SHA_1, S390_CRYPTO_SHA_1, &sha1_switch},
 	{SHA_224, S390_CRYPTO_SHA_256, &sha256_switch},
-- 
2.7.4