]> git.baikalelectronics.ru Git - kernel.git/commit
net: sched: fix skb leak in dev_requeue_skb()
authorWei Yongjun <weiyongjun1@huawei.com>
Wed, 27 Dec 2017 09:05:52 +0000 (17:05 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 2 Jan 2018 18:48:29 +0000 (13:48 -0500)
commitd45c09f1b2041384b4754e65c8e8f0c87803eef1
treebf212df68278a7556241877a3358df4aa0635f4c
parentdb399c10d8359cb824ac14a8f27ccd1202f798ce
net: sched: fix skb leak in dev_requeue_skb()

When dev_requeue_skb() is called with bulked skb list, only the
first skb of the list will be requeued to qdisc layer, and leak
the others without free them.

TCP is broken due to skb leak since no free skb will be considered
as still in the host queue and never be retransmitted. This happend
when dev_requeue_skb() called from qdisc_restart().
  qdisc_restart
  |-- dequeue_skb
  |-- sch_direct_xmit()
      |-- dev_requeue_skb() <-- skb may bluked

Fix dev_requeue_skb() to requeue the full bluked list. Also change
to use __skb_queue_tail() in __dev_requeue_skb() to avoid skb out
of order.

Fixes: b16e81465636 ("net: sched: explicit locking in gso_cpu fallback")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_generic.c