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
@@ -2801,12 +2801,13 @@ static int tcp_repair_options_est(struct sock *sk, sockptr_t optbuf,
|
||||
{
|
||||
struct tcp_sock *tp = tcp_sk(sk);
|
||||
struct tcp_repair_opt opt;
|
||||
size_t offset = 0;
|
||||
|
||||
while (len >= sizeof(opt)) {
|
||||
if (copy_from_sockptr(&opt, optbuf, sizeof(opt)))
|
||||
if (copy_from_sockptr_offset(&opt, optbuf, offset, sizeof(opt)))
|
||||
return -EFAULT;
|
||||
|
||||
sockptr_advance(optbuf, sizeof(opt));
|
||||
offset += sizeof(opt);
|
||||
len -= sizeof(opt);
|
||||
|
||||
switch (opt.opt_code) {
|
||||
|
||||
Reference in New Issue
Block a user