|
@@ -2340,7 +2340,7 @@ SYSCALL_DEFINE3(recvmsg, int, fd, struct user_msghdr __user *, msg,
|
|
|
*/
|
|
|
|
|
|
int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen,
|
|
|
- unsigned int flags, struct timespec *timeout)
|
|
|
+ unsigned int flags, struct timespec64 *timeout)
|
|
|
{
|
|
|
int fput_needed, err, datagrams;
|
|
|
struct socket *sock;
|
|
@@ -2405,8 +2405,7 @@ int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen,
|
|
|
|
|
|
if (timeout) {
|
|
|
ktime_get_ts64(&timeout64);
|
|
|
- *timeout = timespec64_to_timespec(
|
|
|
- timespec64_sub(end_time, timeout64));
|
|
|
+ *timeout = timespec64_sub(end_time, timeout64);
|
|
|
if (timeout->tv_sec < 0) {
|
|
|
timeout->tv_sec = timeout->tv_nsec = 0;
|
|
|
break;
|
|
@@ -2452,10 +2451,10 @@ out_put:
|
|
|
|
|
|
static int do_sys_recvmmsg(int fd, struct mmsghdr __user *mmsg,
|
|
|
unsigned int vlen, unsigned int flags,
|
|
|
- struct timespec __user *timeout)
|
|
|
+ struct __kernel_timespec __user *timeout)
|
|
|
{
|
|
|
int datagrams;
|
|
|
- struct timespec timeout_sys;
|
|
|
+ struct timespec64 timeout_sys;
|
|
|
|
|
|
if (flags & MSG_CMSG_COMPAT)
|
|
|
return -EINVAL;
|
|
@@ -2463,13 +2462,12 @@ static int do_sys_recvmmsg(int fd, struct mmsghdr __user *mmsg,
|
|
|
if (!timeout)
|
|
|
return __sys_recvmmsg(fd, mmsg, vlen, flags, NULL);
|
|
|
|
|
|
- if (copy_from_user(&timeout_sys, timeout, sizeof(timeout_sys)))
|
|
|
+ if (get_timespec64(&timeout_sys, timeout))
|
|
|
return -EFAULT;
|
|
|
|
|
|
datagrams = __sys_recvmmsg(fd, mmsg, vlen, flags, &timeout_sys);
|
|
|
|
|
|
- if (datagrams > 0 &&
|
|
|
- copy_to_user(timeout, &timeout_sys, sizeof(timeout_sys)))
|
|
|
+ if (datagrams > 0 && put_timespec64(&timeout_sys, timeout))
|
|
|
datagrams = -EFAULT;
|
|
|
|
|
|
return datagrams;
|
|
@@ -2477,7 +2475,7 @@ static int do_sys_recvmmsg(int fd, struct mmsghdr __user *mmsg,
|
|
|
|
|
|
SYSCALL_DEFINE5(recvmmsg, int, fd, struct mmsghdr __user *, mmsg,
|
|
|
unsigned int, vlen, unsigned int, flags,
|
|
|
- struct timespec __user *, timeout)
|
|
|
+ struct __kernel_timespec __user *, timeout)
|
|
|
{
|
|
|
return do_sys_recvmmsg(fd, mmsg, vlen, flags, timeout);
|
|
|
}
|
|
@@ -2601,7 +2599,7 @@ SYSCALL_DEFINE2(socketcall, int, call, unsigned long __user *, args)
|
|
|
break;
|
|
|
case SYS_RECVMMSG:
|
|
|
err = do_sys_recvmmsg(a0, (struct mmsghdr __user *)a1, a[2],
|
|
|
- a[3], (struct timespec __user *)a[4]);
|
|
|
+ a[3], (struct __kernel_timespec __user *)a[4]);
|
|
|
break;
|
|
|
case SYS_ACCEPT4:
|
|
|
err = __sys_accept4(a0, (struct sockaddr __user *)a1,
|