summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorXin Long <lucien.xin@gmail.com>2018-11-18 15:07:38 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-12-13 08:51:28 +0100
commit94b4e528b152d24db7d92db0dfaa4f577d78be3f (patch)
tree4dce7ddcea03b026310a715b633d44d3fb71a311 /include/linux
parent959f19ffa49e65c91c7280ded7978c03d90ba6c6 (diff)
sctp: count sk_wmem_alloc by skb truesize in sctp_packet_transmit
[ Upstream commit 02968ccf0125d39b08ecef5946300a8a873c0942 ] Now sctp increases sk_wmem_alloc by 1 when doing set_owner_w for the skb allocked in sctp_packet_transmit and decreases by 1 when freeing this skb. But when this skb goes through networking stack, some subcomponents might change skb->truesize and add the same amount on sk_wmem_alloc. However sctp doesn't know the amount to decrease by, it would cause a leak on sk->sk_wmem_alloc and the sock can never be freed. Xiumei found this issue when it hit esp_output_head() by using sctp over ipsec, where skb->truesize is added and so is sk->sk_wmem_alloc. Since sctp has used sk_wmem_queued to count for writable space since Commit cd305c74b0f8 ("sctp: use sk_wmem_queued to check for writable space"), it's ok to fix it by counting sk_wmem_alloc by skb truesize in sctp_packet_transmit. Fixes: cac2661c53f3 ("esp4: Avoid skb_cow_data whenever possible") 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions