clocksource: Make clocksource watchdog test safe for slow-HZ systems
[linux-2.6-microblaze.git] / drivers / s390 / crypto / zcrypt_api.c
index 5d726cd..529ffe2 100644 (file)
@@ -900,6 +900,9 @@ static long _zcrypt_send_cprb(bool userspace, struct ap_perms *perms,
                if (xcRB->user_defined != AUTOSELECT &&
                    xcRB->user_defined != zc->card->id)
                        continue;
+               /* check if request size exceeds card max msg size */
+               if (ap_msg.len > zc->card->maxmsgsize)
+                       continue;
                /* check if device node has admission for this card */
                if (!zcrypt_check_card(perms, zc->card->id))
                        continue;
@@ -1068,6 +1071,9 @@ static long _zcrypt_send_ep11_cprb(bool userspace, struct ap_perms *perms,
                if (targets &&
                    !is_desired_ep11_card(zc->card->id, target_num, targets))
                        continue;
+               /* check if request size exceeds card max msg size */
+               if (ap_msg.len > zc->card->maxmsgsize)
+                       continue;
                /* check if device node has admission for this card */
                if (!zcrypt_check_card(perms, zc->card->id))
                        continue;