|
@@ -1795,6 +1795,7 @@ vchiq_compat_ioctl_await_completion(struct file *file,
|
|
struct vchiq_await_completion32 args32;
|
|
struct vchiq_await_completion32 args32;
|
|
struct vchiq_completion_data32 completion32;
|
|
struct vchiq_completion_data32 completion32;
|
|
unsigned int *msgbufcount32;
|
|
unsigned int *msgbufcount32;
|
|
|
|
+ unsigned int msgbufcount_native;
|
|
compat_uptr_t msgbuf32;
|
|
compat_uptr_t msgbuf32;
|
|
void *msgbuf;
|
|
void *msgbuf;
|
|
void **msgbufptr;
|
|
void **msgbufptr;
|
|
@@ -1906,7 +1907,11 @@ vchiq_compat_ioctl_await_completion(struct file *file,
|
|
sizeof(completion32)))
|
|
sizeof(completion32)))
|
|
return -EFAULT;
|
|
return -EFAULT;
|
|
|
|
|
|
- args32.msgbufcount--;
|
|
|
|
|
|
+ if (get_user(msgbufcount_native, &args->msgbufcount))
|
|
|
|
+ return -EFAULT;
|
|
|
|
+
|
|
|
|
+ if (!msgbufcount_native)
|
|
|
|
+ args32.msgbufcount--;
|
|
|
|
|
|
msgbufcount32 =
|
|
msgbufcount32 =
|
|
&((struct vchiq_await_completion32 __user *)arg)->msgbufcount;
|
|
&((struct vchiq_await_completion32 __user *)arg)->msgbufcount;
|