linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Avoiding EBUSY on TPM writes
@ 2023-06-15 21:09 Matthew Garrett
  2023-06-15 23:38 ` James Bottomley
  0 siblings, 1 reply; 3+ messages in thread
From: Matthew Garrett @ 2023-06-15 21:09 UTC (permalink / raw)
  To: linux-integrity; +Cc: peterhuewe, jarkko, jgg

We're running into a situation where concurrent TPM accesses can trigger 
EBUSY on write due to there either being a queued command or a response 
not yet having been read. Obviously one approach would be to retry, but 
that involves us either spinning or waiting for an arbitrary amount of 
time between attempts, which doesn't seem ideal. There's a poll 
interface that tells us whether there's a response to read but (a) that 
doesn't help in the enqueued command situation and (b) this would still 
be racy - we could be notified that the response has been read, be 
preempted, and have another process perform a write before we get the 
opportunity to.

What's the right way to fix this? One approach would simply be to 
replace the EBUSY with an interruptible sleep and wake the process when 
the TPM is available, but that feels like it's technically an ABI break.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-06-15 23:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-15 21:09 Avoiding EBUSY on TPM writes Matthew Garrett
2023-06-15 23:38 ` James Bottomley
2023-06-15 23:54   ` Matthew Garrett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).