linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tadeusz Struk <tstruk@gmail.com>
To: Jarkko Sakkinen <jarkko@kernel.org>
Cc: Jason Gunthorpe <jgg@ziepe.ca>,
	linux-integrity@vger.kernel.org, stable@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] tpm: Fix error handling in async work
Date: Tue, 28 Dec 2021 16:08:42 -0800	[thread overview]
Message-ID: <3c835b05-b476-4ea9-929f-0131fa7a3446@gmail.com> (raw)
In-Reply-To: <YcuiIdorMLEjhJn6@iki.fi>

On 12/28/21 15:47, Jarkko Sakkinen wrote:
>> When an invalid (non existing) handle is used in a tpm command,
>> that uses the resource manager interface (/dev/tpmrm0) the resource
>> manager tries to load it from its internal cache, but fails and
>> returns an -EINVAL error to the caller. The existing async handler
>> doesn't handle these error cases currently and the condition in the
>> poll handler never returns mask with EPOLLIN set causing the userspace
>> code to get stack. Make sure that error conditions also contribute
>> to the poll mask so that a correct error code could passed back
>> to the caller.
> Can you instead describe a failure scenario? This is very cryptic.

The problem is that the poll call blocks and the application gets stuck
until the tpm_timeout_work() wakes it up after 120 sec (jiffies + (120 * HZ)).
I will update the description, fix all the typos, and resend it.

Thanks,
Tadeusz

  reply	other threads:[~2021-12-29  0:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-20 21:16 [PATCH 1/2] tpm: Fix error handling in async work Tadeusz Struk
2021-12-20 21:17 ` [PATCH 2/2] selftests: tpm: add async space test with noneexisting handle Tadeusz Struk
2021-12-28 23:47 ` [PATCH 1/2] tpm: Fix error handling in async work Jarkko Sakkinen
2021-12-29  0:08   ` Tadeusz Struk [this message]
2021-12-29  1:42     ` Jarkko Sakkinen

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=3c835b05-b476-4ea9-929f-0131fa7a3446@gmail.com \
    --to=tstruk@gmail.com \
    --cc=jarkko@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).