net: pass a sockptr_t into ->setsockopt
Rework the remaining setsockopt code to pass a sockptr_t instead of a plain user pointer. This removes the last remaining set_fs(KERNEL_DS) outside of architecture specific code. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Stefan Schmidt <stefan@datenfreihafen.org> [ieee802154] Acked-by: Matthieu Baerts <matthieu.baerts@tessares.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
d38d2b00ba
commit
a7b75c5a8c
@@ -451,7 +451,7 @@ int svc_change_qos(struct atm_vcc *vcc, struct atm_qos *qos)
|
||||
}
|
||||
|
||||
static int svc_setsockopt(struct socket *sock, int level, int optname,
|
||||
char __user *optval, unsigned int optlen)
|
||||
sockptr_t optval, unsigned int optlen)
|
||||
{
|
||||
struct sock *sk = sock->sk;
|
||||
struct atm_vcc *vcc = ATM_SD(sock);
|
||||
@@ -464,7 +464,7 @@ static int svc_setsockopt(struct socket *sock, int level, int optname,
|
||||
error = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
if (copy_from_user(&vcc->sap, optval, optlen)) {
|
||||
if (copy_from_sockptr(&vcc->sap, optval, optlen)) {
|
||||
error = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
@@ -475,7 +475,7 @@ static int svc_setsockopt(struct socket *sock, int level, int optname,
|
||||
error = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
if (get_user(value, (int __user *)optval)) {
|
||||
if (copy_from_sockptr(&value, optval, sizeof(int))) {
|
||||
error = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
|
Reference in New Issue
Block a user