s390/zcrypt: add length check for aligned data to avoid overflow in msg-type 6
[deliverable/linux.git] / drivers / s390 / crypto / zcrypt_api.c
index 4b824b15194f6eb034c4dd2ef4a7f0ab3ee9c3b7..5222ebe15705e14f8a0a9b2598b63ebb3672752f 100644 (file)
@@ -626,8 +626,8 @@ static long zcrypt_send_ep11_cprb(struct ep11_urb *xcrb)
                        return -ENOMEM;
 
                if (copy_from_user(ep11_dev_list.targets,
-                                  (struct ep11_target_dev *)xcrb->targets,
-                                  xcrb->targets_num *
+                                  (struct ep11_target_dev __force __user *)
+                                  xcrb->targets, xcrb->targets_num *
                                   sizeof(struct ep11_target_dev)))
                        return -EFAULT;
        }
This page took 0.026477 seconds and 5 git commands to generate.