]> git.baikalelectronics.ru Git - kernel.git/commit
regmap: Disable debugfs when locking is disabled
authorMark Brown <broonie@kernel.org>
Tue, 12 Dec 2017 16:56:43 +0000 (16:56 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 13 Dec 2017 16:22:31 +0000 (16:22 +0000)
commit10b51004735dcd6784ece2084800c189c3a7ba4c
treeddc19ef33b47c55b130e78cca79b3f6b064cd2c4
parent8012aa10f3cbd6821e9aefca48b615f78ca6c01c
regmap: Disable debugfs when locking is disabled

The recently added support for disabling the regmap internal locking left
debugfs enabled for devices with the locking disabled. This is a problem
since debugfs allows userspace to do things like initiate reads from the
hardware which will use the scratch buffers protected by the regmap locking
so could cause data corruption.

For safety address this by just disabling debugfs for these devices. That
is overly conservative since some of the debugfs files just read internal
data structures but it's much simpler to implmement and less likely to
lead to problems with tooling that works with debugfs.

Reported-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/regmap/internal.h
drivers/base/regmap/regmap-debugfs.c
drivers/base/regmap/regmap.c