diff options
author | Xin Long <lucien.xin@gmail.com> | 2019-03-13 17:00:48 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-03-13 14:22:49 -0700 |
commit | 9417d81f4f8adfe20a12dd1fadf73a618cbd945d (patch) | |
tree | e5909be0f6b3404f4a85c7bc184aa21b7dc32c45 /include/net | |
parent | 63b6c974c24cc6a56cd1c17609d8d218dcff999c (diff) | |
download | linux-9417d81f4f8adfe20a12dd1fadf73a618cbd945d.tar.bz2 |
pptp: dst_release sk_dst_cache in pptp_sock_destruct
sk_setup_caps() is called to set sk->sk_dst_cache in pptp_connect,
so we have to dst_release(sk->sk_dst_cache) in pptp_sock_destruct,
otherwise, the dst refcnt will leak.
It can be reproduced by this syz log:
r1 = socket$pptp(0x18, 0x1, 0x2)
bind$pptp(r1, &(0x7f0000000100)={0x18, 0x2, {0x0, @local}}, 0x1e)
connect$pptp(r1, &(0x7f0000000000)={0x18, 0x2, {0x3, @remote}}, 0x1e)
Consecutive dmesg warnings will occur:
unregister_netdevice: waiting for lo to become free. Usage count = 1
v1->v2:
- use rcu_dereference_protected() instead of rcu_dereference_check(),
as suggested by Eric.
Fixes: 00959ade36ac ("PPTP: PPP over IPv4 (Point-to-Point Tunneling Protocol)")
Reported-by: Xiumei Mu <xmu@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
0 files changed, 0 insertions, 0 deletions