From: Stefan Berger <stefanb@linux.ibm.com>
To: 铮 <fengaojigui88@gmail.com>
Cc: Jarkko Sakkinen <jarkko@kernel.org>,
peterhuewe@gmx.de, Jason Gunthorpe <jgg@ziepe.ca>,
linux-integrity@vger.kernel.org, syzkaller@googlegroups.com,
linux-kernel@vger.kernel.org
Subject: Re: [BUG] tpm: prolonged stall in vtpm_proxy_fops_release() on Linux 7.3
Date: Tue, 10 Nov 2026 10:30:33 -0500 [thread overview]
Message-ID: <5552ccf5-87aa-4d29-b6f6-01e48674d443@linux.ibm.com> (raw)
In-Reply-To: <404c3349-1a9f-4bd3-b75a-187407855a39@linux.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 606 bytes --]
>
> On 11/10/26 1:42 AM, 铮 wrote:
>> Hi Stefan,
>>
>> Thank you for your question about closing the server-side fd.
>>
>> Short answer: yes, the server-side fds are released when the
>> reproducer exits, and the hang occurs during that release. The hang
>> reproduced in 4/4 recorded exit-time release attempts (three with N=32
>> and one with N=4). However, our separate tests that explicitly call
>> close() on every ioctl-returned fd did NOT reproduce the hang.
>
Thanks, your supplied C-program made reproducing this issue
straight-forward. A patch resolving this issue is attached.
Stefan
[-- Attachment #2: 0001-tpm-tpm_vtpm_proxy-Try-to-disable-queued-work-before.patch --]
[-- Type: text/x-patch, Size: 1782 bytes --]
From 6c4ee84a29d652c65714dc06f3cef674f6ac6127 Mon Sep 17 00:00:00 2001
From: Stefan Berger <stefanb@linux.ibm.com>
Date: Tue, 10 Nov 2026 09:05:54 -0600
Subject: [PATCH] tpm: tpm_vtpm_proxy: Try to disable queued work before
flushing it
If an application opens multiple server-side TPM file descriptors using the
ioctl() on /dev/tpmx and does not close them in the order they were opened,
then the closing of a file descriptor will run into flush_work() and be
blocked there behind other pending work and currently active work. As a
consequence, the currently active work, that is waiting for a response to
its TPM request, will have to wait for the command to time out since its
STATE_OPENED_FLAG will not be reset. To resolve this issue, try to disable
pending work first before flushing it. The disable_work() returns quickly
and unqueues work for most of the closing file descriptors. If it returns
false, then run flush_work(), which makes sure that ongoing work ends,
which also happens quickly since its STATE_OPENED_FLAG was cleared.
Fixes: 6f99612e2500 ("tpm: Proxy driver for supporting multiple emulated TPMs")
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
---
drivers/char/tpm/tpm_vtpm_proxy.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/char/tpm/tpm_vtpm_proxy.c b/drivers/char/tpm/tpm_vtpm_proxy.c
index 245a8f959bc7..c539183acb03 100644
--- a/drivers/char/tpm/tpm_vtpm_proxy.c
+++ b/drivers/char/tpm/tpm_vtpm_proxy.c
@@ -465,7 +465,8 @@ static void vtpm_proxy_work(struct work_struct *work)
static void vtpm_proxy_work_stop(struct proxy_dev *proxy_dev)
{
vtpm_proxy_fops_undo_open(proxy_dev);
- flush_work(&proxy_dev->work);
+ if (!disable_work(&proxy_dev->work))
+ flush_work(&proxy_dev->work);
}
/*
--
2.56.0
prev parent reply other threads:[~2026-11-10 15:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-01 1:22 铮
2026-11-01 17:36 ` Jarkko Sakkinen
2026-11-02 14:02 ` Stefan Berger
2026-11-02 17:37 ` 铮
2026-11-06 19:11 ` Stefan Berger
2026-11-08 17:15 ` 铮
2026-11-09 18:15 ` Stefan Berger
2026-11-10 6:42 ` 铮
[not found] ` <404c3349-1a9f-4bd3-b75a-187407855a39@linux.ibm.com>
2026-11-10 15:30 ` Stefan Berger [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5552ccf5-87aa-4d29-b6f6-01e48674d443@linux.ibm.com \
--to=stefanb@linux.ibm.com \
--cc=fengaojigui88@gmail.com \
--cc=jarkko@kernel.org \
--cc=jgg@ziepe.ca \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterhuewe@gmx.de \
--cc=syzkaller@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®