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/sctp/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/sctp/socket.c')
| -rw-r--r-- | net/sctp/socket.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 9a767f359718..144808dfea9e 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -4429,7 +4429,7 @@ out: * optlen - the size of the buffer. */ static int sctp_setsockopt(struct sock *sk, int level, int optname, - char __user *optval, unsigned int optlen) + sockptr_t optval, unsigned int optlen) { void *kopt = NULL; int retval = 0; @@ -4449,7 +4449,7 @@ static int sctp_setsockopt(struct sock *sk, int level, int optname, } if (optlen > 0) { - kopt = memdup_user(optval, optlen); + kopt = memdup_sockptr(optval, optlen); if (IS_ERR(kopt)) return PTR_ERR(kopt); } |
