|
@@ -593,6 +593,9 @@ static long efi_runtime_query_capsulecaps(unsigned long arg)
|
|
if (copy_from_user(&qcaps, qcaps_user, sizeof(qcaps)))
|
|
if (copy_from_user(&qcaps, qcaps_user, sizeof(qcaps)))
|
|
return -EFAULT;
|
|
return -EFAULT;
|
|
|
|
|
|
|
|
+ if (qcaps.capsule_count == ULONG_MAX)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
capsules = kcalloc(qcaps.capsule_count + 1,
|
|
capsules = kcalloc(qcaps.capsule_count + 1,
|
|
sizeof(efi_capsule_header_t), GFP_KERNEL);
|
|
sizeof(efi_capsule_header_t), GFP_KERNEL);
|
|
if (!capsules)
|
|
if (!capsules)
|