summaryrefslogtreecommitdiff
path: root/net/dccp
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-07-28 19:38:35 +0300
committerDavid S. Miller <davem@davemloft.net>2020-07-28 23:43:40 +0300
commitd3c48151512922dd35f1f393b30b9138e4441d14 (patch)
treef283952cf8a17bf8ecca6c4f11aab2252aaa8b46 /net/dccp
parent035bfd051eae5b365368be915dfaf916aa501a52 (diff)
downloadlinux-d3c48151512922dd35f1f393b30b9138e4441d14.tar.xz
net: remove sockptr_advance
sockptr_advance never properly worked. Replace it with _offset variants of copy_from_sockptr and copy_to_sockptr. Fixes: ba423fdaa589 ("net: add a new sockptr_t type") Reported-by: Jason A. Donenfeld <Jason@zx2c4.com> Reported-by: Ido Schimmel <idosch@idosch.org> Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Jason A. Donenfeld <Jason@zx2c4.com> Tested-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp')
-rw-r--r--net/dccp/proto.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index 2e9e8449698f..d148ab1530e5 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -426,9 +426,8 @@ static int dccp_setsockopt_service(struct sock *sk, const __be32 service,
return -ENOMEM;
sl->dccpsl_nr = optlen / sizeof(u32) - 1;
- sockptr_advance(optval, sizeof(service));
- if (copy_from_sockptr(sl->dccpsl_list, optval,
- optlen - sizeof(service)) ||
+ if (copy_from_sockptr_offset(sl->dccpsl_list, optval,
+ sizeof(service), optlen - sizeof(service)) ||
dccp_list_has_service(sl, DCCP_SERVICE_INVALID_VALUE)) {
kfree(sl);
return -EFAULT;