linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <edumazet@google.com>
To: Davide Caratti <dcaratti@redhat.com>
Cc: Naresh Kamboju <naresh.kamboju@linaro.org>,
	lkft-triage@lists.linaro.org,  regressions@lists.linux.dev,
	linux-kernel@vger.kernel.org,  netdev@vger.kernel.org,
	jhs@mojatatu.com, xiyou.wangcong@gmail.com,  jiri@resnulli.us,
	cpaasch@apple.com, pabeni@redhat.com, xmu@redhat.com,
	 maxim@isovalent.com, anders.roxell@linaro.org,
	dan.carpenter@linaro.org,  arnd@arndb.de,
	Linux Kernel Functional Testing <lkft@linaro.org>
Subject: Re: selftests: tc-testing: tdc.sh: WARNING: at kernel/locking/lockdep.c:1226 lockdep_register_key
Date: Tue, 30 Apr 2024 12:50:58 +0200	[thread overview]
Message-ID: <CANn89iJ=Nom+4gUL2yROvobd0VQ=rjW5nVdDHkADxPFMjkn0OQ@mail.gmail.com> (raw)
In-Reply-To: <CANn89iJ4go0oXSjRaxkdxsUFPCK8kcb8YPt+0d7isK9ZsFrpww@mail.gmail.com>

On Tue, Apr 30, 2024 at 12:30 PM Eric Dumazet <edumazet@google.com> wrote:
>
> On Tue, Apr 30, 2024 at 12:17 PM Davide Caratti <dcaratti@redhat.com> wrote:
> >
> > hello,
> >
> > On Tue, Apr 30, 2024 at 12:17 AM Naresh Kamboju
> > <naresh.kamboju@linaro.org> wrote:
> > >
> > > While running selftests: tc-testing: tdc.sh the following kernel warnings,
> > > kernel Bug, kernel oops and kernel panic noticed with Linux next-20240429
> > > tag kernel as per the available data.
> > >
> > > This build config is from kselftest merge config[1].
> > >
> > > Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
> > >
> > > selftests: tc-testing: tdc.sh log and crash log
> >
> > the problem is created by [1]. I think that at least we need to guard
> > against failures to allocate sch->cpu_bstats and sch->cpu_qstats,
> > otherwise the dynamic key is registered but never unregistered (though
> > the key is freed  in the error path of of qdisc_alloc() ). But there
> > might be also something else; however, I can reproduce some similar
> > splat, will follow-up on the list.
> >
> > sorry for the noise,
> > --
> > davide
> >
> > [1] https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=af0cb3fa3f9ed258d14abab0152e28a0f9593084
> >
>
> I just had  5 or 6 syzbot reports about this issue.
>
> I tested the following fix.
>
> diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
> index 31dfd6c7405b01e22fe1b8c80944e2bed7d30ddc..d3f6006b563ccd8827b7af362ce9dceaa78f8841
> 100644
> --- a/net/sched/sch_generic.c
> +++ b/net/sched/sch_generic.c
> @@ -982,6 +982,7 @@ struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
>
>         return sch;
>  errout1:
> +       lockdep_unregister_key(&sch->root_lock_key);
>         kfree(sch);
>  errout:
>         return ERR_PTR(err);

Davide, I will let you send a formal fix. Let me know if you want me
to release a syzbot report.

  reply	other threads:[~2024-04-30 10:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-29 22:17 selftests: tc-testing: tdc.sh: WARNING: at kernel/locking/lockdep.c:1226 lockdep_register_key Naresh Kamboju
2024-04-30 10:17 ` Davide Caratti
2024-04-30 10:30   ` Eric Dumazet
2024-04-30 10:50     ` Eric Dumazet [this message]
2024-04-30 10:50     ` Davide Caratti

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='CANn89iJ=Nom+4gUL2yROvobd0VQ=rjW5nVdDHkADxPFMjkn0OQ@mail.gmail.com' \
    --to=edumazet@google.com \
    --cc=anders.roxell@linaro.org \
    --cc=arnd@arndb.de \
    --cc=cpaasch@apple.com \
    --cc=dan.carpenter@linaro.org \
    --cc=dcaratti@redhat.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkft-triage@lists.linaro.org \
    --cc=lkft@linaro.org \
    --cc=maxim@isovalent.com \
    --cc=naresh.kamboju@linaro.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=regressions@lists.linux.dev \
    --cc=xiyou.wangcong@gmail.com \
    --cc=xmu@redhat.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).