tcp: release sk_frag.page in tcp_disconnect
authorLi RongQing <lirongqing@baidu.com>
Fri, 26 Jan 2018 08:40:41 +0000 (16:40 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Feb 2018 09:19:47 +0000 (10:19 +0100)
commit6d35430fdaf47880cacda975a7d1b1588f933357
tree59c76a17c5f615847d2ecddaad07522a3dd3420d
parente8513f250d1b632f17cf909ff6b76293adc5f682
tcp: release sk_frag.page in tcp_disconnect

[ Upstream commit 9b42d55a66d388e4dd5550107df051a9637564fc ]

socket can be disconnected and gets transformed back to a listening
socket, if sk_frag.page is not released, which will be cloned into
a new socket by sk_clone_lock, but the reference count of this page
is increased, lead to a use after free or double free issue

Signed-off-by: Li RongQing <lirongqing@baidu.com>
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/tcp.c