netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <edumazet@google.com>
To: Maxim Mikityanskiy <maximmi@nvidia.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	Cong Wang <xiyou.wangcong@gmail.com>,
	Jiri Pirko <jiri@resnulli.us>, Tariq Toukan <tariqt@nvidia.com>,
	netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH] sch_api: Don't skip qdisc attach on ingress
Date: Wed, 12 Jan 2022 05:06:49 -0800	[thread overview]
Message-ID: <CANn89iL4RLjcJH8s4HAUoSa4cxAztkhx-4rsUZ2xwY8tYbPcCg@mail.gmail.com> (raw)
In-Reply-To: <20220112102805.488510-1-maximmi@nvidia.com>

On Wed, Jan 12, 2022 at 2:28 AM Maxim Mikityanskiy <maximmi@nvidia.com> wrote:
>
> The attach callback of struct Qdisc_ops is used by only a few qdiscs:
> mq, mqprio and htb. qdisc_graft() contains the following logic
> (pseudocode):
>
>     if (!qdisc->ops->attach) {
>         if (ingress)
>             do ingress stuff;
>         else
>             do egress stuff;
>     }
>     if (!ingress) {
>         ...
>         if (qdisc->ops->attach)
>             qdisc->ops->attach(qdisc);
>     } else {
>         ...
>     }
>
> unregister_netdevice: waiting for lo to become free. Usage count = 2
>
> This commit addresses the issue by running "do ingress stuff" in the
> ingress flow even in the attach callback is present, which is fine,
> because attach isn't going to be called afterwards.
>
> The bug was found by syzbot and reported by Eric.
>
> Fixes: d03b195b5aa0 ("sch_htb: Hierarchical QoS hardware offload")
> Signed-off-by: Maxim Mikityanskiy <maximmi@nvidia.com>
> Reported-by: Eric Dumazet <edumazet@google.com>
> ---

Thanks for fixing this issue.

Reviewed-by: Eric Dumazet <edumazet@google.com>

  reply	other threads:[~2022-01-12 13:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-12 10:28 [PATCH] sch_api: Don't skip qdisc attach on ingress Maxim Mikityanskiy
2022-01-12 13:06 ` Eric Dumazet [this message]
2022-01-13 12:40 ` patchwork-bot+netdevbpf

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=CANn89iL4RLjcJH8s4HAUoSa4cxAztkhx-4rsUZ2xwY8tYbPcCg@mail.gmail.com \
    --to=edumazet@google.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=maximmi@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=tariqt@nvidia.com \
    --cc=xiyou.wangcong@gmail.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).