From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751512AbdBAHbu (ORCPT ); Wed, 1 Feb 2017 02:31:50 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:34095 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751292AbdBAHbr (ORCPT ); Wed, 1 Feb 2017 02:31:47 -0500 Subject: Re: Fwd: Re: [tpmdd-devel] [PATCH v9 2/2] tpm: add securityfs support,for TPM 2.0 firmware event log To: Jarkko Sakkinen References: <588F09A2.4090502@linux.vnet.ibm.com> <20170131174659.b6njebycqzd5ur6f@intel.com> <5890DAFC.9030407@linux.vnet.ibm.com> <20170131205006.fljtxsy4s6lyhkvv@intel.com> Cc: Kenneth Goldman , "moderated list:TPM DEVICE DRIVER" , open list , linux-security-module@vger.kernel.org From: Nayna Date: Wed, 1 Feb 2017 13:01:06 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20170131205006.fljtxsy4s6lyhkvv@intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17020107-0020-0000-0000-00000B3EAA10 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006535; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000201; SDB=6.00815580; UDB=6.00398182; IPR=6.00593023; BA=6.00005105; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00014131; XFM=3.00000011; UTC=2017-02-01 07:31:39 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17020107-0021-0000-0000-000059B99915 Message-Id: <58918EBA.1000103@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-01-31_12:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702010074 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/01/2017 02:20 AM, Jarkko Sakkinen wrote: > On Wed, Feb 01, 2017 at 12:14:12AM +0530, Nayna wrote: >>> I already sent my pull request to 4.11 and even today I found something >>> fishy. You declared a function local array by using a variable in "tpm: >>> enhance TPM 2.0 PCR extend to support multiple banks" (max_active_banks >>> or something). And the event log patches have just passed the review. >> >> Yes. I have checked using clang and it has passed the clang.. and I also >> verified there were no complains during build. > > What we can deduce from that is that they didn't expose the issue in > question. > > I found this by running sparse with make C=2 M=drives/char/tpm > >> What type of problem do you see ? > > It is disallowed to do stack allocation in the kernel code even if C > standard would allow it. Stack is scarce resource so you need to know > its usage at compile time. > > In this case you actually know the allocation because the value is not > changed during the course of the function but it is still bad. Probably > compiler will optimize it out. Still it is not a good practice. Thanks Jarkko for explaining it. Hmm, do you want me to send a patch for this ? I think what we want is actually define it just array of size as 7. > >> Also, to understand, this is related to multi-bank patchset. I mean how does >> it affect for event log patchset ? > > Well in both cases these have landed fairly late but I asked from James > whether I'll have to postpone these to 4.12. > > Usually when I've sent my release pull request I do not want to make any > radical changes to the codebase because they always require extra QA and > thus take extra time. Thanks again for explaining details. Thanks & Regards, - Nayna > > /Jarkko >