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]
Date:   Thu, 15 Sep 2016 16:38:34 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Bartosz Golaszewski <bgolaszewski@...libre.com>
Cc:     Linus Walleij <linus.walleij@...aro.org>,
        Alexandre Courbot <gnurou@...il.com>,
        Ingo Molnar <mingo@...hat.com>,
        LKML <linux-kernel@...r.kernel.org>,
        linux-gpio <linux-gpio@...r.kernel.org>
Subject: Re: lockdep: incorrect deadlock warning with two GPIO expanders

On Thu, Sep 15, 2016 at 04:08:52PM +0200, Bartosz Golaszewski wrote:
> 2016-09-15 15:39 GMT+02:00 Peter Zijlstra <peterz@...radead.org>:

> > In any case, if this fails, we can always punt and simply count the
> > total number of instances of this driver on the system and go with that.
> >
> 
> But for __mutex_init() to work with the key argument you need to know
> it at compile time, right?

You can do something like:

	mutex_init(&mutex);
	lockdep_set_subclass(&mutex, nr);

which will of course fail at runtime the moment nr >= 8, but is that
really a concern?

Equally you can do:

static struct lock_class_key my_keys[NR];

	mutex_init(&mutex);
	BUG_ON(nr > NR);
	lockdep_set_class(&mutex, my_keys + nr);

and have a bigger limit.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ