Re: lockdep null-ptr-deref

Boqun Feng
2020-10-02T13:35:44Z

On Fri, Oct 02, 2020 at 03:09:29PM +0200, Peter Zijlstra wrote:
> On Fri, Oct 02, 2020 at 08:36:02PM +0800, Boqun Feng wrote:
>
> > But what if f2() is called with interrupt disabled? Or f2() disables
> > interrupt inside the function, like:
> >
> > void f2(...)
> > {
> > local_irq_disable();
> > spin_lock(&B);
> > g(...);
> > ...
> > local_irq_enable();
> > }
> >
> > In this case, there wouldn't be any LOCK_ENABLED_*_READ usage for
> > rwlock_t A. As a result, we won't see it in the lockdep splat.
>
> Hurm, fair enough. So just to make sure, you're arguing for:
>
> -#define LOCK_TRACE_STATES (XXX_LOCK_USAGE_STATES*4 + 1)
> +#define LOCK_TRACE_STATES (XXX_LOCK_USAGE_STATES*4 + 2)
>
> On top of my earlier patch, right?

Yep. Thanks ;-)

Regards,
Boqun