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
| ||
|
Message-ID: <CAMRc=Meyr6AuomZYZsuc4MnnoOcOGVDiQvPc+zA+tzsRsY1f3w@mail.gmail.com> Date: Tue, 12 Dec 2017 13:21:46 +0100 From: Bartosz Golaszewski <brgl@...ev.pl> To: Mark Brown <broonie@...nel.org> Cc: Lars-Peter Clausen <lars@...afoo.de>, Greg Kroah-Hartman <gregkh@...uxfoundation.org>, Linux Kernel Mailing List <linux-kernel@...r.kernel.org> Subject: Re: [PATCH] regmap: allow to disable all locking mechanisms 2017-12-12 13:18 GMT+01:00 Mark Brown <broonie@...nel.org>: > On Tue, Dec 12, 2017 at 12:42:47PM +0100, Lars-Peter Clausen wrote: >> On 12/06/2017 03:26 PM, Bartosz Golaszewski wrote: > >> > + * @disable_locking: This regmap is either protected by external means or >> > + * is guaranteed not be be accessed from multiple threads. > >> To guarantee this you need to make sure that a regmap instance with this >> flag set does not register a debugfs interface. debugfs file access happens >> from a userspace process and hence could (and probably) is in a different >> thread than the driver regmap access. > > That's true, and the debugfs is world readable too so we can't just say > it's up to root to be sensible. This lock is only taken when writing to cache_only and cache_bypass though. This shouldn't cause serious trouble but yeah, we need to find a better solution. Maybe the right approach would be to provide users with locking routines (regmap_lock()/regmap_unlock()) and then add a boolean variable to the config (e.g. bool manual_locking) which would indicate to regmap that it shouldn't take the lock in most cases (except for debugfs) as this would be manually done by the regmap owner? Or possibly a separate lock for map->cache_bypass/map->cache_only? Thanks, Bartosz
Powered by blists - more mailing lists