Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] s390: CEX2A crt message length

Undetected edge case for CRT messages to CEX2A caused length to be too short,
thus truncating the message. The solution was to check a different variable
which actually determines which key type is being used.

Increment version number in z90main.c to correct level of 1.3.3, fix copyright
year and add comment about bitlength limit of CEX2A.

Signed-off-by: Eric Rossman <edrossma@us.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Eric Rossman and committed by
Linus Torvalds
96641ee1 b6cba4ee

+12 -3
+9 -1
drivers/s390/crypto/z90hardware.c
··· 2214 2214 long_len = 128; 2215 2215 } 2216 2216 2217 - tmp_size = ((mod_len <= 128) ? TYPE50_CRB1_LEN : TYPE50_CRB2_LEN) + 2217 + tmp_size = ((long_len <= 64) ? TYPE50_CRB1_LEN : TYPE50_CRB2_LEN) + 2218 2218 CALLER_HEADER; 2219 2219 2220 2220 memset(z90cMsg_p, 0, tmp_size); ··· 2479 2479 2480 2480 if (reply_code) 2481 2481 switch (reply_code) { 2482 + case REP82_ERROR_MACHINE_FAILURE: 2483 + if (errh_p->type == TYPE82_RSP_CODE) 2484 + PRINTKW("Machine check failure\n"); 2485 + else 2486 + PRINTKW("Module failure\n"); 2487 + return REC_HARDWAR_ERR; 2482 2488 case REP82_ERROR_OPERAND_INVALID: 2489 + return REC_OPERAND_INV; 2483 2490 case REP88_ERROR_MESSAGE_MALFORMD: 2491 + PRINTKW("Message malformed\n"); 2484 2492 return REC_OPERAND_INV; 2485 2493 case REP82_ERROR_OPERAND_SIZE: 2486 2494 return REC_OPERAND_SIZE;
+3 -2
drivers/s390/crypto/z90main.c
··· 1 1 /* 2 2 * linux/drivers/s390/crypto/z90main.c 3 3 * 4 - * z90crypt 1.3.2 4 + * z90crypt 1.3.3 5 5 * 6 - * Copyright (C) 2001, 2004 IBM Corporation 6 + * Copyright (C) 2001, 2005 IBM Corporation 7 7 * Author(s): Robert Burroughs (burrough@us.ibm.com) 8 8 * Eric Rossman (edrossma@us.ibm.com) 9 9 * ··· 991 991 * PCIXCC_MCL2 512-2048 ----- (applying any GA LIC will make an MCL3 card) 992 992 * PCIXCC_MCL3 ----- 128-2048 993 993 * CEX2C 512-2048 128-2048 994 + * CEX2A ??-2048 same (the lower limit is less than 128 bit...) 994 995 * 995 996 * ext_bitlens (extended bitlengths) is a global, since you should not apply an 996 997 * MCL to just one card in a machine. We assume, at first, that all cards have