]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drivers/base: cacheinfo: validate device node for all the caches
authorSudeep Holla <sudeep.holla@arm.com>
Tue, 17 Mar 2015 17:28:46 +0000 (17:28 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 May 2015 20:03:43 +0000 (22:03 +0200)
commite654ded279c44285d07a31fe6d6c6fb74a9b5465
tree13421865956afd2db4e80e2670e7f41bf4f6e541
parenta3ec48fa3f64ea293bfe691a02c17c0a7d2887e1
drivers/base: cacheinfo: validate device node for all the caches

commit 8a7d95f95c95f396decbd4cda6d4903fc4664946 upstream.

On architectures that depend on DT for obtaining cache hierarcy, we need
to validate the device node for all the cache indices, failing to do so
might result in wrong information being exposed to the userspace.

This is quite possible on initial/incomplete versions of the device
trees. In such cases, it's better to bail out if all the required device
nodes are not present.

This patch adds checks for the validation of device node for all the
caches and doesn't initialise the cacheinfo if there's any error.

Reported-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/cacheinfo.c