net: remove sockptr_advance
sockptr_advance never properly worked. Replace it with _offset variants
of copy_from_sockptr and copy_to_sockptr.
Fixes: ba423fdaa5
("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>
This commit is contained in:

committed by
David S. Miller

parent
035bfd051e
commit
d3c4815151
@@ -522,9 +522,9 @@ static int do_tls_setsockopt_conf(struct sock *sk, sockptr_t optval,
|
||||
goto err_crypto_info;
|
||||
}
|
||||
|
||||
sockptr_advance(optval, sizeof(*crypto_info));
|
||||
rc = copy_from_sockptr(crypto_info + 1, optval,
|
||||
optlen - sizeof(*crypto_info));
|
||||
rc = copy_from_sockptr_offset(crypto_info + 1, optval,
|
||||
sizeof(*crypto_info),
|
||||
optlen - sizeof(*crypto_info));
|
||||
if (rc) {
|
||||
rc = -EFAULT;
|
||||
goto err_crypto_info;
|
||||
|
Reference in New Issue
Block a user