[PATCH v2] drivers/base: cacheinfo: validate device node for all the caches
Sudeep Holla
sudeep.holla at arm.com
Tue Mar 10 02:52:32 PDT 2015
Hi Greg,
On 23/02/15 16:32, Sudeep Holla wrote:
> 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.
>
> Cc: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
> Reported-by: Mark Rutland <mark.rutland at arm.com>
> Acked-by: Mark Rutland <mark.rutland at arm.com>
> Signed-off-by: Sudeep Holla <sudeep.holla at arm.com>
> ---
> drivers/base/cacheinfo.c | 13 +++++++++++--
> 1 file changed, 11 insertions(+), 2 deletions(-)
>
> v1->v2:
> - Updated log information as suggested by Mark
> - Added Mark's ACK
>
> Hi Greg,
>
> Can you please pick this fix for the next rc ?
>
> Without this there's possibility that erroneous information is exposed
> to userspace on architecture depending on DT especially if DT lacks
> cache hierarchy information.
>
There are many arm64 DT without cache hierarchy which exposes wrong
cacheinfo to the user space. It would be good to get this included
as bug fix for 4.0
Regards,
Sudeep
More information about the linux-arm-kernel
mailing list