From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751585AbbCJJwg (ORCPT ); Tue, 10 Mar 2015 05:52:36 -0400 Received: from service87.mimecast.com ([91.220.42.44]:56933 "EHLO service87.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751097AbbCJJwe convert rfc822-to-8bit (ORCPT ); Tue, 10 Mar 2015 05:52:34 -0400 Message-ID: <54FEBEE0.2030703@arm.com> Date: Tue, 10 Mar 2015 09:52:32 +0000 From: Sudeep Holla User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman CC: Sudeep Holla , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , Mark Rutland , Lorenzo Pieralisi Subject: Re: [PATCH v2] drivers/base: cacheinfo: validate device node for all the caches References: <1424095816-4414-1-git-send-email-sudeep.holla@arm.com> <1424709159-13152-1-git-send-email-sudeep.holla@arm.com> In-Reply-To: <1424709159-13152-1-git-send-email-sudeep.holla@arm.com> X-OriginalArrivalTime: 10 Mar 2015 09:52:30.0146 (UTC) FILETIME=[EC5A4A20:01D05B17] X-MC-Unique: 115031009523102701 Content-Type: text/plain; charset=WINDOWS-1252; format=flowed Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Reported-by: Mark Rutland > Acked-by: Mark Rutland > Signed-off-by: Sudeep Holla > --- > 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