From: Jarkko Sakkinen <jarkko@kernel.org>
To: Denis Aleksandrov <daleksan@redhat.com>
Cc: peterhuewe@gmx.de, jgg@ziepe.ca, linux-integrity@vger.kernel.org,
Jan Stancek <jstancek@redhat.com>
Subject: Re: [PATCH] tpm: prevents local DOS via tpm/tpm0/ppi/*operations
Date: Mon, 18 Aug 2025 20:40:02 +0300 [thread overview]
Message-ID: <aKNlck45-FF_p40t@kernel.org> (raw)
In-Reply-To: <CAG+gbFcgfZALHCAxaMmWkNQX2sKgkc-HBJrYXdmehsqLidG_tA@mail.gmail.com>
On Fri, Aug 08, 2025 at 02:32:02PM -0400, Denis Aleksandrov wrote:
> Ping.
>
> Just checking in on this patch.
> It has received a "Reviewed-by" tag, and I was wondering if there is
> anything else needed from my side for it to be picked up.
"This bug is not seen on most machines. Reads on tpm/tpm0/ppi/*operations
can become very long on misconfigured systems. Reading the TPM is a
blocking operation, thus a user could effectively trigger a DOS.
Resolve this by restricting unprivileged user from reading the
above-mentioned device files."
OK I took some time to revisit this. I think the symptom is correct but
it should not be fixed the way it is done here. I.e. the fix works as
a bug report but not as a right type of fix because it will also
change uapi behavior w/o strong enough reasons to do so.
What you should do instead would be to cache the result.
I.e. first declare this as static global:
static const char *tpm_ppi_info[] = {
"Not implemented",
"BIOS only",
"Blocked for OS by BIOS",
"User required",
"User not required",
};
Then declare a spinlock:
static DEFINE_SPINLOCK(tpm_ppi_lock);
And finally static arrays that contain indexes to tpm_ppi_info e.g.,
tpm_ppi_tcg_operations and tpm_ppi_vs_operations.
Then on first request populate them and after that the results are
cached.
> Thanks,
> Denis
BR, Jarkko
next prev parent reply other threads:[~2025-08-18 17:40 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-02 20:28 [PATCH] tpm: prevents local DOS via tpm/tpm0/ppi/*operations Denis Aleksandrov
2025-07-02 22:46 ` Jarkko Sakkinen
[not found] ` <CAG+gbFfKLCQND-TT8DEZ09T=Nhb39_CJfM5imv341Pen03bHjw@mail.gmail.com>
2025-07-03 12:00 ` Denis Aleksandrov
2025-08-08 18:32 ` Denis Aleksandrov
2025-08-09 10:51 ` Jarkko Sakkinen
2025-08-12 16:03 ` Jarkko Sakkinen
[not found] ` <CAG+gbFfY=YZZ24dZpBtShc+4ypGJgngsz7X32XKaHZ90s3okFg@mail.gmail.com>
2025-08-13 7:48 ` Jarkko Sakkinen
2025-08-13 13:13 ` Denis Aleksandrov
2025-08-14 7:37 ` Jarkko Sakkinen
2025-08-14 14:35 ` Denis Aleksandrov
2025-08-18 17:40 ` Jarkko Sakkinen [this message]
2025-08-18 19:12 ` Denis Aleksandrov
2025-08-19 22:38 ` 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=aKNlck45-FF_p40t@kernel.org \
--to=jarkko@kernel.org \
--cc=daleksan@redhat.com \
--cc=jgg@ziepe.ca \
--cc=jstancek@redhat.com \
--cc=linux-integrity@vger.kernel.org \
--cc=peterhuewe@gmx.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.