diff options
| author | Christoph Hellwig <[email protected]> | 2020-07-23 06:09:07 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2020-07-24 22:41:54 +0000 |
| commit | a7b75c5a8c41445f33efb663887ff5f5c3b4454b (patch) | |
| tree | a87e011ba3a0d76fda030b3a62080caa97fae1ef /net/ieee802154/socket.c | |
| parent | net/tcp: switch do_tcp_setsockopt to sockptr_t (diff) | |
| download | kernel-a7b75c5a8c41445f33efb663887ff5f5c3b4454b.tar.gz kernel-a7b75c5a8c41445f33efb663887ff5f5c3b4454b.zip | |
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 <[email protected]>
Acked-by: Stefan Schmidt <[email protected]> [ieee802154]
Acked-by: Matthieu Baerts <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/ieee802154/socket.c')
| -rw-r--r-- | net/ieee802154/socket.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ieee802154/socket.c b/net/ieee802154/socket.c index 94ae9662133e..a45a0401adc5 100644 --- a/net/ieee802154/socket.c +++ b/net/ieee802154/socket.c @@ -382,7 +382,7 @@ static int raw_getsockopt(struct sock *sk, int level, int optname, } static int raw_setsockopt(struct sock *sk, int level, int optname, - char __user *optval, unsigned int optlen) + sockptr_t optval, unsigned int optlen) { return -EOPNOTSUPP; } @@ -872,7 +872,7 @@ static int dgram_getsockopt(struct sock *sk, int level, int optname, } static int dgram_setsockopt(struct sock *sk, int level, int optname, - char __user *optval, unsigned int optlen) + sockptr_t optval, unsigned int optlen) { struct dgram_sock *ro = dgram_sk(sk); struct net *net = sock_net(sk); @@ -882,7 +882,7 @@ static int dgram_setsockopt(struct sock *sk, int level, int optname, if (optlen < sizeof(int)) return -EINVAL; - if (get_user(val, (int __user *)optval)) + if (copy_from_sockptr(&val, optval, sizeof(int))) return -EFAULT; lock_sock(sk); |
