net/tcp: switch ->md5_parse to sockptr_t
Pass a sockptr_t to prepare for set_fs-less handling of the kernel pointer from bpf-cgroup. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
91ac1ccaff
commit
d4c19c4914
@@ -567,7 +567,7 @@ static struct tcp_md5sig_key *tcp_v6_md5_lookup(const struct sock *sk,
|
||||
}
|
||||
|
||||
static int tcp_v6_parse_md5_keys(struct sock *sk, int optname,
|
||||
char __user *optval, int optlen)
|
||||
sockptr_t optval, int optlen)
|
||||
{
|
||||
struct tcp_md5sig cmd;
|
||||
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)&cmd.tcpm_addr;
|
||||
@@ -577,7 +577,7 @@ static int tcp_v6_parse_md5_keys(struct sock *sk, int optname,
|
||||
if (optlen < sizeof(cmd))
|
||||
return -EINVAL;
|
||||
|
||||
if (copy_from_user(&cmd, optval, sizeof(cmd)))
|
||||
if (copy_from_sockptr(&cmd, optval, sizeof(cmd)))
|
||||
return -EFAULT;
|
||||
|
||||
if (sin6->sin6_family != AF_INET6)
|
||||
|
Reference in New Issue
Block a user