lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEVVKH8B0mgqMra_3G9A9jv+WUyewpxmFC7GHP_uHUU81y5mmg@mail.gmail.com>
Date:   Mon, 12 Jul 2021 17:21:43 +0800
From:   Xiongwei Song <sxwjean@...il.com>
To:     Boqun Feng <boqun.feng@...il.com>
Cc:     Waiman Long <llong@...hat.com>, Xiongwei Song <sxwjean@...com>,
        peterz@...radead.org, mingo@...hat.com, will@...nel.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH v1 1/3] locking/lockdep: Fix false warning of check_wait_context()

On Mon, Jul 12, 2021 at 4:52 PM Boqun Feng <boqun.feng@...il.com> wrote:
>
> On Mon, Jul 12, 2021 at 04:18:36PM +0800, Xiongwei Song wrote:
> > On Mon, Jul 12, 2021 at 12:43 AM Waiman Long <llong@...hat.com> wrote:
> > >
> > > On 7/11/21 10:14 AM, Xiongwei Song wrote:
> > > > From: Xiongwei Song <sxwjean@...il.com>
> > > >
> > > > We now always get a "Invalid wait context" warning with
> > > > CONFIG_PROVE_RAW_LOCK_NESTING=y, see the full warning below:
> > > >
> > > >       [    0.705900] =============================
> > > >       [    0.706002] [ BUG: Invalid wait context ]
> > > >       [    0.706180] 5.13.0+ #4 Not tainted
> > > >       [    0.706349] -----------------------------
> > >
> > > I believe the purpose of CONFIG_PROVE_RAW_LOCK_NESTING is experimental
> > > and it is turned off by default. Turning it on can cause problem as
> > > shown in your lockdep splat. Limiting it to just PREEMPT_RT will defeat
> > > its purpose to find potential spinlock nesting problem in non-PREEMPT_RT
> > > kernel.
> > As far as I know, a spinlock can nest another spinlock. In
> > non-PREEMPT_RT kernel
> > spin_lock and raw_spin_lock are same , so here acquiring a spin_lock in hardirq
> > context is acceptable, the warning is not needed. My knowledge on this
> > is not enough,
> > Will dig into this.
> >
>
> You may find this useful: https://lwn.net/Articles/146861/ ;-)
>
> The thing is that most of the irq handlers will run in process contexts
> in PREEMPT_RT kernel (threaded irq), while the rest continues to run in
> hardirq contexts. spinlock_t is allowed int threaded irqs but not in
> hardirq contexts for PREEMPT_RT, because spinlock_t will become
> sleeplable locks.
Exactly. I think I have known why the fix is incorrect.

Regards,
Xiongwei
>
> Regards,
> Boqun
>
> > > The point is to fix the issue found,
> > Agree. I thought there was a spinlock usage issue, but by checking
> > deactivate_slab context,
> > looks like the spinlock usage is well. Maybe I'm missing something?
> >
> > > not hiding it from appearing.
> > I'm not trying to hiding it, according to the code context, the fix is
> > reasonable from my point of
> > view. Let me check again.
> >
> > Thank  you for the comments.
> >
> > Regards,
> > Xiongwei
> > >
> > > Cheers,
> > > Longman
> > >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ