On Fri Apr 5, 2024 at 3:24 AM EEST, William Brown wrote: > > > > On 5 Apr 2024, at 01:06, Jarkko Sakkinen <jarkko@xxxxxxxxxx> wrote: > > > > Since the code is accessing /dev/tpm0 and not /dev/tpmrm0 this issue > > should be mitigated by the user space resource manager. > > My code is operating via /dev/tpmrm0, not /dev/tpm0. And after each iteration, all sessions are cleared and removed. > > If I operate on /dev/tpm0 the issue goes away. So the error is actually in the resource manager itself. Ah, my previous response about kprobe hook is still relevant. Kernel RM can cause context gap error if user space leaves a stall session long enough. Before making any decisions we should be aware first what are the exact conditions in this case. Sorry for late response. I was sick for most of last wee. BR, Jarkko