]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
sctp: increase sk_wmem_alloc when head->truesize is increased
authorXin Long <lucien.xin@gmail.com>
Mon, 26 Nov 2018 06:52:44 +0000 (14:52 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 27 Nov 2018 23:42:31 +0000 (15:42 -0800)
commit0d32f17717e65e76cbdb248374dd162acdfe2fff
tree6fe60c6c6116598809bcc587d3f94919899f0443
parenta8842e975503191e4982efb886299fc19972c97f
sctp: increase sk_wmem_alloc when head->truesize is increased

I changed to count sk_wmem_alloc by skb truesize instead of 1 to
fix the sk_wmem_alloc leak caused by later truesize's change in
xfrm in Commit 02968ccf0125 ("sctp: count sk_wmem_alloc by skb
truesize in sctp_packet_transmit").

But I should have also increased sk_wmem_alloc when head->truesize
is increased in sctp_packet_gso_append() as xfrm does. Otherwise,
sctp gso packet will cause sk_wmem_alloc underflow.

Fixes: 02968ccf0125 ("sctp: count sk_wmem_alloc by skb truesize in sctp_packet_transmit")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/output.c