summaryrefslogtreecommitdiffstats
path: root/net/sctp/ipv6.c
diff options
context:
space:
mode:
authorQiujun Huang <hqjagain@gmail.com>2020-03-27 04:07:51 +0100
committerDavid S. Miller <davem@davemloft.net>2020-03-30 06:57:30 +0200
commit5c3e82fe159622e46e91458c1a6509c321a62820 (patch)
treee7bda32450ded263271390bb290f5b630e46b956 /net/sctp/ipv6.c
parentipv4: fix a RCU-list lock in fib_triestat_seq_show (diff)
downloadlinux-5c3e82fe159622e46e91458c1a6509c321a62820.tar.xz
linux-5c3e82fe159622e46e91458c1a6509c321a62820.zip
sctp: fix refcount bug in sctp_wfree
We should iterate over the datamsgs to move all chunks(skbs) to newsk. The following case cause the bug: for the trouble SKB, it was in outq->transmitted list sctp_outq_sack sctp_check_transmitted SKB was moved to outq->sacked list then throw away the sack queue SKB was deleted from outq->sacked (but it was held by datamsg at sctp_datamsg_to_asoc So, sctp_wfree was not called here) then migrate happened sctp_for_each_tx_datachunk( sctp_clear_owner_w); sctp_assoc_migrate(); sctp_for_each_tx_datachunk( sctp_set_owner_w); SKB was not in the outq, and was not changed to newsk finally __sctp_outq_teardown sctp_chunk_put (for another skb) sctp_datamsg_put __kfree_skb(msg->frag_list) sctp_wfree (for SKB) SKB->sk was still oldsk (skb->sk != asoc->base.sk). Reported-and-tested-by: syzbot+cea71eec5d6de256d54d@syzkaller.appspotmail.com Signed-off-by: Qiujun Huang <hqjagain@gmail.com> Acked-by: Marcelo Ricardo Leitner <mleitner@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/ipv6.c')
0 files changed, 0 insertions, 0 deletions