summaryrefslogtreecommitdiff
path: root/debian/patches/0001-Fix-initialization-of-s390-hardware-switches.patch
blob: dbc1430df8be321fa50a1a7e12b6c6b9844470d2 (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
36
37
38
39
40
41
42
43
44
45
46
47
From b73a9c6bcfded1f15cb02692fe5ed38fad05c8a0 Mon Sep 17 00:00:00 2001
From: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Date: Tue, 19 Apr 2016 10:55:50 +0200
Subject: [PATCH 1/2] Fix initialization of s390 hardware switches

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/include/s390_crypto.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/include/s390_crypto.h b/src/include/s390_crypto.h
index 0f967f7..793a41f 100644
--- a/src/include/s390_crypto.h
+++ b/src/include/s390_crypto.h
@@ -83,7 +83,7 @@ enum s390_crypto_function {
 	S390_CRYPTO_SHA512_DRNG_SEED = 0x03 | 0x80
 };
 
-unsigned int sha1_switch, sha256_switch, sha512_switch, des_switch,
+extern 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;
@@ -119,10 +119,10 @@ typedef enum {
 	SHA512_DRNG_SEED
 } ppno_functions_t;
 
-s390_supported_function_t s390_kmc_functions[PRNG + 1];
-s390_supported_function_t s390_msa4_functions[AES_256_XTS_DECRYPT + 1];
-s390_supported_function_t s390_kimd_functions[GHASH + 1];
-s390_supported_function_t s390_ppno_functions[SHA512_DRNG_SEED + 1];
+extern s390_supported_function_t s390_kmc_functions[PRNG + 1];
+extern s390_supported_function_t s390_msa4_functions[AES_256_XTS_DECRYPT + 1];
+extern s390_supported_function_t s390_kimd_functions[GHASH + 1];
+extern s390_supported_function_t s390_ppno_functions[SHA512_DRNG_SEED + 1];
 
 void s390_crypto_switches_init(void);
 
-- 
2.7.4