From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Fastabend Subject: Re: [PATCH net-next v3] net: sched: fix skb leak in dev_requeue_skb() Date: Tue, 2 Jan 2018 13:34:12 -0800 Message-ID: References: <1514365552-150962-1-git-send-email-weiyongjun1@huawei.com> <20180102.134911.1471297664330738902.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us, netdev@vger.kernel.org To: David Miller , weiyongjun1@huawei.com Return-path: Received: from mail-pf0-f178.google.com ([209.85.192.178]:46670 "EHLO mail-pf0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750726AbeABVea (ORCPT ); Tue, 2 Jan 2018 16:34:30 -0500 Received: by mail-pf0-f178.google.com with SMTP id c204so26135681pfc.13 for ; Tue, 02 Jan 2018 13:34:29 -0800 (PST) In-Reply-To: <20180102.134911.1471297664330738902.davem@davemloft.net> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 01/02/2018 10:49 AM, David Miller wrote: > From: Wei Yongjun > Date: Wed, 27 Dec 2017 17:05:52 +0800 > >> When dev_requeue_skb() is called with bluked skb list, only the > ^^^^^^ > > "bulked" > >> 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: a53851e2c321 ("net: sched: explicit locking in gso_cpu fallback") >> Signed-off-by: Wei Yongjun >> --- >> v2 -> v3: move lock out of while loop > > Applied, thank you. > Bit late on my review but LGTM thanks!