aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-03-02 22:53:09 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-03-02 22:53:09 -0500
commitaa074c1c805a38c01c0dfe56f78d409e33be28a2 (patch)
tree5a361535d8df880af24e02b1508c2a6b44ae17c5 /drivers/s390
parent7a962a4b6e86d27a7ba1c325a5981b52ad72c29b (diff)
parent0414855fdc4a40da05221fc6062cccbc0c30f169 (diff)
Merge 3.14-rc5 into char-misc-next
We want these fixes in here as well.
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/cio/chsc.c1
-rw-r--r--drivers/s390/crypto/zcrypt_msgtype6.c24
2 files changed, 24 insertions, 1 deletions
diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c
index f6b9188c5af5..9f0ea6cb6922 100644
--- a/drivers/s390/cio/chsc.c
+++ b/drivers/s390/cio/chsc.c
@@ -610,6 +610,7 @@ void chsc_chp_online(struct chp_id chpid)
610 css_wait_for_slow_path(); 610 css_wait_for_slow_path();
611 for_each_subchannel_staged(__s390_process_res_acc, NULL, 611 for_each_subchannel_staged(__s390_process_res_acc, NULL,
612 &link); 612 &link);
613 css_schedule_reprobe();
613 } 614 }
614} 615}
615 616
diff --git a/drivers/s390/crypto/zcrypt_msgtype6.c b/drivers/s390/crypto/zcrypt_msgtype6.c
index dc542e0a3055..0bc91e46395a 100644
--- a/drivers/s390/crypto/zcrypt_msgtype6.c
+++ b/drivers/s390/crypto/zcrypt_msgtype6.c
@@ -311,7 +311,7 @@ static int XCRB_msg_to_type6CPRB_msgX(struct zcrypt_device *zdev,
311 } __packed * msg = ap_msg->message; 311 } __packed * msg = ap_msg->message;
312 312
313 int rcblen = CEIL4(xcRB->request_control_blk_length); 313 int rcblen = CEIL4(xcRB->request_control_blk_length);
314 int replylen; 314 int replylen, req_sumlen, resp_sumlen;
315 char *req_data = ap_msg->message + sizeof(struct type6_hdr) + rcblen; 315 char *req_data = ap_msg->message + sizeof(struct type6_hdr) + rcblen;
316 char *function_code; 316 char *function_code;
317 317
@@ -321,12 +321,34 @@ static int XCRB_msg_to_type6CPRB_msgX(struct zcrypt_device *zdev,
321 xcRB->request_data_length; 321 xcRB->request_data_length;
322 if (ap_msg->length > MSGTYPE06_MAX_MSG_SIZE) 322 if (ap_msg->length > MSGTYPE06_MAX_MSG_SIZE)
323 return -EINVAL; 323 return -EINVAL;
324
325 /* Overflow check
326 sum must be greater (or equal) than the largest operand */
327 req_sumlen = CEIL4(xcRB->request_control_blk_length) +
328 xcRB->request_data_length;
329 if ((CEIL4(xcRB->request_control_blk_length) <=
330 xcRB->request_data_length) ?
331 (req_sumlen < xcRB->request_data_length) :
332 (req_sumlen < CEIL4(xcRB->request_control_blk_length))) {
333 return -EINVAL;
334 }
335
324 replylen = sizeof(struct type86_fmt2_msg) + 336 replylen = sizeof(struct type86_fmt2_msg) +
325 CEIL4(xcRB->reply_control_blk_length) + 337 CEIL4(xcRB->reply_control_blk_length) +
326 xcRB->reply_data_length; 338 xcRB->reply_data_length;
327 if (replylen > MSGTYPE06_MAX_MSG_SIZE) 339 if (replylen > MSGTYPE06_MAX_MSG_SIZE)
328 return -EINVAL; 340 return -EINVAL;
329 341
342 /* Overflow check
343 sum must be greater (or equal) than the largest operand */
344 resp_sumlen = CEIL4(xcRB->reply_control_blk_length) +
345 xcRB->reply_data_length;
346 if ((CEIL4(xcRB->reply_control_blk_length) <= xcRB->reply_data_length) ?
347 (resp_sumlen < xcRB->reply_data_length) :
348 (resp_sumlen < CEIL4(xcRB->reply_control_blk_length))) {
349 return -EINVAL;
350 }
351
330 /* prepare type6 header */ 352 /* prepare type6 header */
331 msg->hdr = static_type6_hdrX; 353 msg->hdr = static_type6_hdrX;
332 memcpy(msg->hdr.agent_id , &(xcRB->agent_ID), sizeof(xcRB->agent_ID)); 354 memcpy(msg->hdr.agent_id , &(xcRB->agent_ID), sizeof(xcRB->agent_ID));