|
@@ -382,7 +382,11 @@ static ssize_t ucma_get_event(struct ucma_file *file, const char __user *inbuf,
|
|
|
struct ucma_event *uevent;
|
|
|
int ret = 0;
|
|
|
|
|
|
- if (out_len < sizeof uevent->resp)
|
|
|
+ /*
|
|
|
+ * Old 32 bit user space does not send the 4 byte padding in the
|
|
|
+ * reserved field. We don't care, allow it to keep working.
|
|
|
+ */
|
|
|
+ if (out_len < sizeof(uevent->resp) - sizeof(uevent->resp.reserved))
|
|
|
return -ENOSPC;
|
|
|
|
|
|
if (copy_from_user(&cmd, inbuf, sizeof(cmd)))
|
|
@@ -417,7 +421,8 @@ static ssize_t ucma_get_event(struct ucma_file *file, const char __user *inbuf,
|
|
|
}
|
|
|
|
|
|
if (copy_to_user((void __user *)(unsigned long)cmd.response,
|
|
|
- &uevent->resp, sizeof uevent->resp)) {
|
|
|
+ &uevent->resp,
|
|
|
+ min_t(size_t, out_len, sizeof(uevent->resp)))) {
|
|
|
ret = -EFAULT;
|
|
|
goto done;
|
|
|
}
|