From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754584AbdEDRN2 (ORCPT ); Thu, 4 May 2017 13:13:28 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:37157 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753203AbdEDRNX (ORCPT ); Thu, 4 May 2017 13:13:23 -0400 Subject: Re: [PATCH v3 1/3] tpm: vtpm_proxy: Implement new ioctl to get supported flags To: Jason Gunthorpe References: <1493909787-1848-1-git-send-email-stefanb@linux.vnet.ibm.com> <1493909787-1848-2-git-send-email-stefanb@linux.vnet.ibm.com> <20170504153416.GA15930@obsidianresearch.com> Cc: tpmdd-devel@lists.sourceforge.net, linux-security-module@vger.kernel.org, jarkko.sakkinen@linux.intel.com, linux-kernel@vger.kernel.org From: Stefan Berger Date: Thu, 4 May 2017 13:13:18 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20170504153416.GA15930@obsidianresearch.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 17050417-0052-0000-0000-000001F31B73 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007021; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000209; SDB=6.00856219; UDB=6.00423839; IPR=6.00635383; BA=6.00005326; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00015306; XFM=3.00000014; UTC=2017-05-04 17:13:20 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17050417-0053-0000-0000-0000507149C5 Message-Id: <56703d75-b238-0bad-386a-5b6963e250a1@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-05-04_11:,, 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-1703280000 definitions=main-1705040256 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/04/2017 11:34 AM, Jason Gunthorpe wrote: > On Thu, May 04, 2017 at 10:56:25AM -0400, Stefan Berger wrote: >> Implement VTPM_PROXY_IOC_GET_SUPT_FLAGS ioctl to get the bitmask >> of flags that the vtpm_proxy driver supports in the >> VTPM_PROXY_IOC_NEW_DEV ioctl. This helps user space in deciding >> which flags to set in that ioctl. > you might be better off just having a VTPM_PROXY_IO_ENABLE_FEATURE > .feature = LOCALITY Do you have an example driver that shows how to do this ? Can user space query that feature? > > If that fails then the feature is not supported, no real need for the > query in that case. > > Not sure about Jarkko's point on request/release locality.. Is there a > scenario where the emulator should fail the request locality? We could filter localities 5 and higher on the level of the driver (patch 2/3) since basically there are only 5 localities (0-4) in any TPM interface today. The typical hardware locality 4 would be filtered by the emulator per policy passed via command line, but I would allow it on the level of this driver. An error message would be returned for any command executed in that locality, unless the 'policy' allows it. Localities 0-3 should just be selectable. The TPM TIS (in the hardware) implements some complicated scheme when it comes to allowing the selection of a locality and I would say we need none of that but just tell the vTPM proxy driver the locality (patch 2/3) in which the next command will be executed. > > Jason >