netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: daniel@iogearbox.net
Cc: netdev@vger.kernel.org, sandipan@linux.vnet.ibm.com,
	bhole_prashant_q7@lab.ntt.co.jp, john.fastabend@gmail.com,
	ast@kernel.org, jiri@resnulli.us
Subject: Re: [PATCH net] net, sched: fix panic when updating miniq {b,q}stats
Date: Tue, 16 Jan 2018 15:03:46 -0500 (EST)	[thread overview]
Message-ID: <20180116.150346.1844547653220225428.davem@davemloft.net> (raw)
In-Reply-To: <20180115221209.22360-1-daniel@iogearbox.net>

From: Daniel Borkmann <daniel@iogearbox.net>
Date: Mon, 15 Jan 2018 23:12:09 +0100

> While working on fixing another bug, I ran into the following panic
> on arm64 by simply attaching clsact qdisc, adding a filter and running
> traffic on ingress to it:
...
> Reason is that sch_ingress and sch_clsact are doing mini_qdisc_pair_init()
> which sets up miniq pointers to cpu_{b,q}stats from the underlying qdisc.
> Problem is that this cannot work since they are actually set up right after
> the qdisc ->init() callback in qdisc_create(), so first packet going into
> sch_handle_ingress() tries to call mini_qdisc_bstats_cpu_update() and we
> therefore panic.
> 
> In order to fix this, allocation of {b,q}stats needs to happen before we
> call into ->init(). In net-next, there's already such option through commit
> d59f5ffa59d8 ("net: sched: a dflt qdisc may be used with per cpu stats").
> However, the bug needs to be fixed in net still for 4.15. Thus, include
> these bits to reduce any merge churn and reuse the static_flags field to
> set TCQ_F_CPUSTATS, and remove the allocation from qdisc_create() since
> there is no other user left. Prashant Bhole ran into the same issue but
> for net-next, thus adding him below as well as co-author. Same issue was
> also reported by Sandipan Das when using bcc.
> 
> Fixes: 46209401f8f6 ("net: core: introduce mini_Qdisc and eliminate usage of tp->q for clsact fastpath")
> Reference: https://lists.iovisor.org/pipermail/iovisor-dev/2018-January/001190.html
> Reported-by: Sandipan Das <sandipan@linux.vnet.ibm.com>
> Co-authored-by: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
> Co-authored-by: John Fastabend <john.fastabend@gmail.com>
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>

Applied, thanks Daniel.

      reply	other threads:[~2018-01-16 20:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-15 22:12 [PATCH net] net, sched: fix panic when updating miniq {b,q}stats Daniel Borkmann
2018-01-16 20:03 ` David Miller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180116.150346.1844547653220225428.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=ast@kernel.org \
    --cc=bhole_prashant_q7@lab.ntt.co.jp \
    --cc=daniel@iogearbox.net \
    --cc=jiri@resnulli.us \
    --cc=john.fastabend@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=sandipan@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).