mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-27 05:40:37 +07:00
Merge branch 'diag-raw-fixes'
Cyrill Gorcunov says: ==================== net: Fixes for raw diag sockets handling Hi! Here are a few fixes for raw-diag sockets handling: missing sock_put call and jump for exiting from nested cycle. I made patches for iproute2 as well so will send them out soon. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
d3bc29a4b3
@ -79,10 +79,11 @@ static struct sock *raw_sock_get(struct net *net, const struct inet_diag_req_v2
|
|||||||
* hashinfo->lock here.
|
* hashinfo->lock here.
|
||||||
*/
|
*/
|
||||||
sock_hold(sk);
|
sock_hold(sk);
|
||||||
break;
|
goto out_unlock;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
out_unlock:
|
||||||
read_unlock(&hashinfo->lock);
|
read_unlock(&hashinfo->lock);
|
||||||
|
|
||||||
return sk ? sk : ERR_PTR(-ENOENT);
|
return sk ? sk : ERR_PTR(-ENOENT);
|
||||||
@ -205,11 +206,14 @@ static int raw_diag_destroy(struct sk_buff *in_skb,
|
|||||||
{
|
{
|
||||||
struct net *net = sock_net(in_skb->sk);
|
struct net *net = sock_net(in_skb->sk);
|
||||||
struct sock *sk;
|
struct sock *sk;
|
||||||
|
int err;
|
||||||
|
|
||||||
sk = raw_sock_get(net, r);
|
sk = raw_sock_get(net, r);
|
||||||
if (IS_ERR(sk))
|
if (IS_ERR(sk))
|
||||||
return PTR_ERR(sk);
|
return PTR_ERR(sk);
|
||||||
return sock_diag_destroy(sk, ECONNABORTED);
|
err = sock_diag_destroy(sk, ECONNABORTED);
|
||||||
|
sock_put(sk);
|
||||||
|
return err;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user