Commit c773633f authored by Linus Torvalds's avatar Linus Torvalds

Add __user annotations to sock_get_timestamp()

parent 5140ba66
...@@ -1049,7 +1049,7 @@ static inline void net_timestamp(struct timeval *stamp) ...@@ -1049,7 +1049,7 @@ static inline void net_timestamp(struct timeval *stamp)
} }
} }
extern int sock_get_timestamp(struct sock *, struct timeval *); extern int sock_get_timestamp(struct sock *, struct timeval __user *);
/* /*
* Enable debug/info messages * Enable debug/info messages
......
...@@ -1795,7 +1795,7 @@ static int atalk_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -1795,7 +1795,7 @@ static int atalk_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
break; break;
} }
case SIOCGSTAMP: case SIOCGSTAMP:
rc = sock_get_timestamp(sk, (struct timeval *)arg); rc = sock_get_timestamp(sk, (struct timeval __user *)arg);
break; break;
/* Routing */ /* Routing */
case SIOCADDRT: case SIOCADDRT:
......
...@@ -1694,7 +1694,7 @@ static int ax25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -1694,7 +1694,7 @@ static int ax25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
case SIOCGSTAMP: case SIOCGSTAMP:
if (sk != NULL) { if (sk != NULL) {
res = sock_get_timestamp(sk, (struct timeval *)arg); res = sock_get_timestamp(sk, (struct timeval __user *)arg);
break; break;
} }
res = -EINVAL; res = -EINVAL;
......
...@@ -1172,7 +1172,7 @@ EXPORT_SYMBOL(release_sock); ...@@ -1172,7 +1172,7 @@ EXPORT_SYMBOL(release_sock);
/* When > 0 there are consumers of rx skb time stamps */ /* When > 0 there are consumers of rx skb time stamps */
atomic_t netstamp_needed = ATOMIC_INIT(0); atomic_t netstamp_needed = ATOMIC_INIT(0);
int sock_get_timestamp(struct sock *sk, struct timeval *userstamp) int sock_get_timestamp(struct sock *sk, struct timeval __user *userstamp)
{ {
if (!sock_flag(sk, SOCK_TIMESTAMP)) if (!sock_flag(sk, SOCK_TIMESTAMP))
sock_enable_timestamp(sk); sock_enable_timestamp(sk);
......
...@@ -665,7 +665,7 @@ static int econet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg ...@@ -665,7 +665,7 @@ static int econet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg
switch(cmd) { switch(cmd) {
case SIOCGSTAMP: case SIOCGSTAMP:
return sock_get_timestamp(sk,(struct timeval *)arg); return sock_get_timestamp(sk,(struct timeval __user *)arg);
case SIOCSIFADDR: case SIOCSIFADDR:
case SIOCGIFADDR: case SIOCGIFADDR:
......
...@@ -843,7 +843,7 @@ int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -843,7 +843,7 @@ int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
switch (cmd) { switch (cmd) {
case SIOCGSTAMP: case SIOCGSTAMP:
err = sock_get_timestamp(sk, (struct timeval *)arg); err = sock_get_timestamp(sk, (struct timeval __user *)arg);
break; break;
case SIOCADDRT: case SIOCADDRT:
case SIOCDELRT: case SIOCDELRT:
......
...@@ -474,7 +474,7 @@ int inet6_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -474,7 +474,7 @@ int inet6_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
switch(cmd) switch(cmd)
{ {
case SIOCGSTAMP: case SIOCGSTAMP:
return sock_get_timestamp(sk, (struct timeval *)arg); return sock_get_timestamp(sk, (struct timeval __user *)arg);
case SIOCADDRT: case SIOCADDRT:
case SIOCDELRT: case SIOCDELRT:
......
...@@ -1872,7 +1872,7 @@ static int ipx_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -1872,7 +1872,7 @@ static int ipx_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
case SIOCGSTAMP: case SIOCGSTAMP:
rc = -EINVAL; rc = -EINVAL;
if (sk) if (sk)
rc = sock_get_timestamp(sk, (struct timeval *)arg); rc = sock_get_timestamp(sk, (struct timeval __user *)arg);
break; break;
case SIOCGIFDSTADDR: case SIOCGIFDSTADDR:
case SIOCSIFDSTADDR: case SIOCSIFDSTADDR:
......
...@@ -1797,7 +1797,7 @@ static int irda_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -1797,7 +1797,7 @@ static int irda_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
case SIOCGSTAMP: case SIOCGSTAMP:
if (sk != NULL) if (sk != NULL)
return sock_get_timestamp(sk, (struct timeval *)arg); return sock_get_timestamp(sk, (struct timeval __user *)arg);
return -EINVAL; return -EINVAL;
case SIOCGIFADDR: case SIOCGIFADDR:
......
...@@ -1202,7 +1202,7 @@ static int nr_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -1202,7 +1202,7 @@ static int nr_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
case SIOCGSTAMP: case SIOCGSTAMP:
ret = -EINVAL; ret = -EINVAL;
if (sk != NULL) if (sk != NULL)
ret = sock_get_timestamp(sk, (struct timeval *)arg); ret = sock_get_timestamp(sk, (struct timeval __user *)arg);
release_sock(sk); release_sock(sk);
return ret; return ret;
......
...@@ -1465,7 +1465,7 @@ static int packet_ioctl(struct socket *sock, unsigned int cmd, ...@@ -1465,7 +1465,7 @@ static int packet_ioctl(struct socket *sock, unsigned int cmd,
return put_user(amount, (int *)arg); return put_user(amount, (int *)arg);
} }
case SIOCGSTAMP: case SIOCGSTAMP:
return sock_get_timestamp(sk, (struct timeval *)arg); return sock_get_timestamp(sk, (struct timeval __user *)arg);
#ifdef CONFIG_INET #ifdef CONFIG_INET
case SIOCADDRT: case SIOCADDRT:
......
...@@ -1270,7 +1270,7 @@ static int rose_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -1270,7 +1270,7 @@ static int rose_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
case SIOCGSTAMP: case SIOCGSTAMP:
if (sk != NULL) if (sk != NULL)
return sock_get_timestamp(sk, (struct timeval *)arg); return sock_get_timestamp(sk, (struct timeval __user *)arg);
return -EINVAL; return -EINVAL;
case SIOCGIFADDR: case SIOCGIFADDR:
......
...@@ -1765,7 +1765,7 @@ static int wanpipe_ioctl(struct socket *sock, unsigned int cmd, unsigned long ar ...@@ -1765,7 +1765,7 @@ static int wanpipe_ioctl(struct socket *sock, unsigned int cmd, unsigned long ar
switch(cmd) switch(cmd)
{ {
case SIOCGSTAMP: case SIOCGSTAMP:
return sock_get_timestamp(sk, (struct timeval *)arg); return sock_get_timestamp(sk, (struct timeval __user *)arg);
case SIOC_WANPIPE_CHECK_TX: case SIOC_WANPIPE_CHECK_TX:
......
...@@ -1209,7 +1209,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -1209,7 +1209,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
rc = -EINVAL; rc = -EINVAL;
if (sk) if (sk)
rc = sock_get_timestamp(sk, rc = sock_get_timestamp(sk,
(struct timeval *)arg); (struct timeval __user *)arg);
break; break;
case SIOCGIFADDR: case SIOCGIFADDR:
case SIOCSIFADDR: case SIOCSIFADDR:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment