From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [Patch net-next] net_sched: remove the unsafe __skb_array_empty() Date: Tue, 02 Jan 2018 11:37:27 -0500 (EST) Message-ID: <20180102.113727.916343507524190191.davem@davemloft.net> References: <20171222000330.29009-1-xiyou.wangcong@gmail.com> <20171222000330.29009-2-xiyou.wangcong@gmail.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, jakub.kicinski@netronome.com, john.fastabend@gmail.com To: xiyou.wangcong@gmail.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:49500 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750960AbeABQhe (ORCPT ); Tue, 2 Jan 2018 11:37:34 -0500 In-Reply-To: <20171222000330.29009-2-xiyou.wangcong@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Cong Wang Date: Thu, 21 Dec 2017 16:03:30 -0800 > __skb_array_empty() is only safe if array is never resized. > pfifo_fast_dequeue() is called in TX BH context and without > qdisc lock, so even after we disable BH on ->reset() path > we can still race with other CPU's. > > Fixes: c5ad119fb6c0 ("net: sched: pfifo_fast use skb_array") > Reported-by: Jakub Kicinski > Cc: John Fastabend > Signed-off-by: Cong Wang Based upon the discussion over this patch, this bug is ultimately fixed by John's patch which adds a dummy element at the end of allocated ptr_ring queues. And I've just applied that.