From 468ffddf19c1417947cac931c240b0d600e4b5bf Mon Sep 17 00:00:00 2001 From: Felix Beck Date: Mon, 7 Dec 2009 12:51:54 +0100 Subject: [S390] zcrypt: initialize ap_messages for cex3 exploitation AP messages need to be initialized, before they will be used. Values will be zeroized. This will be needed later when introducing support for the special commands. Signed-off-by: Felix Beck Signed-off-by: Ralph Wuerthner Signed-off-by: Martin Schwidefsky --- drivers/s390/crypto/ap_bus.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'drivers/s390/crypto/ap_bus.h') diff --git a/drivers/s390/crypto/ap_bus.h b/drivers/s390/crypto/ap_bus.h index a3536224180..fcf2497556d 100644 --- a/drivers/s390/crypto/ap_bus.h +++ b/drivers/s390/crypto/ap_bus.h @@ -167,6 +167,17 @@ struct ap_message { .dev_type=(dt), \ .match_flags=AP_DEVICE_ID_MATCH_DEVICE_TYPE, +/** + * ap_init_message() - Initialize ap_message. + * Initialize a message before using. Otherwise this might result in + * unexpected behaviour. + */ +static inline void ap_init_message(struct ap_message *ap_msg) +{ + ap_msg->psmid = 0; + ap_msg->length = 0; +} + /* * Note: don't use ap_send/ap_recv after using ap_queue_message * for the first time. Otherwise the ap message queue will get -- cgit v1.2.3