Jason Gunthorpe <[email protected]> wrote on 02/09/2016 
01:20:13 PM:


> Subject: Re: [tpmdd-devel] [PATCH v5 4/5] Initialize TPM and get 
> durations and timeouts
> 
> On Tue, Feb 09, 2016 at 01:11:58PM -0500, Stefan Berger wrote:
> 
> > :-( User space will just pass the fd to another process, which is the 
TPM
> > emulator, and that thing then starts failing on the broken file 
descriptor.
> 
> .. and then it exits like any other failure and the caller has to sort
> it out, which it already has to handle.
> 
> > Either way, I don't see how the TPM emulator can be fully operational 
before
> > tpm_chip_register() is called.
> 
> You still haven't said what is wrong with doing all the work in a work
> queue so user space can respond normally without all this ugly hacking.

It doesn't seem right to simply close the file descriptor on the process 
if something goes wrong. The process couldn't close() on it since another 
thread could have gotten the same fd number for something else. I haven't 
seen a file descriptor that one must not close() in user space.

It doesn't seem to work to only close the file (fput()) in case something 
goes wrong while sending the commands to the TPM and before the 
tpm_chip_register(). In that case I see the message 'VFS: Close: file 
count is 0' once the application closes the fd.

Do you have any insights?

   Stefan


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
tpmdd-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tpmdd-devel

Reply via email to