linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tpm: prevents local DOS via tpm/tpm0/ppi/*operations
@ 2025-07-02 20:28 Denis Aleksandrov
  2025-07-02 22:46 ` Jarkko Sakkinen
  0 siblings, 1 reply; 13+ messages in thread
From: Denis Aleksandrov @ 2025-07-02 20:28 UTC (permalink / raw)
  To: peterhuewe, jarkko; +Cc: jgg, linux-integrity, Denis Aleksandrov, Jan Stancek

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.

Reported-by: Jan Stancek <jstancek@redhat.com>
Signed-off-by: Denis Aleksandrov <daleksan@redhat.com>
---

Running scripts/checkpatch.pl suggested that the permissions be
changed to octal format. What do the maintainers think of this?
The rest of the permissions in the file are macros.

Lastly, this bug was reproduced and the fix was tested accordingly.

 drivers/char/tpm/tpm_ppi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/char/tpm/tpm_ppi.c b/drivers/char/tpm/tpm_ppi.c
index bc7b1b4501b3..ac6e0aee566e 100644
--- a/drivers/char/tpm/tpm_ppi.c
+++ b/drivers/char/tpm/tpm_ppi.c
@@ -347,8 +347,8 @@ static DEVICE_ATTR(request, S_IRUGO | S_IWUSR | S_IWGRP,
 static DEVICE_ATTR(transition_action, S_IRUGO,
 		   tpm_show_ppi_transition_action, NULL);
 static DEVICE_ATTR(response, S_IRUGO, tpm_show_ppi_response, NULL);
-static DEVICE_ATTR(tcg_operations, S_IRUGO, tpm_show_ppi_tcg_operations, NULL);
-static DEVICE_ATTR(vs_operations, S_IRUGO, tpm_show_ppi_vs_operations, NULL);
+static DEVICE_ATTR(tcg_operations, S_IRUSR | S_IRGRP, tpm_show_ppi_tcg_operations, NULL);
+static DEVICE_ATTR(vs_operations, S_IRUSR | S_IRGRP, tpm_show_ppi_vs_operations, NULL);
 
 static struct attribute *ppi_attrs[] = {
 	&dev_attr_version.attr,
-- 
2.48.1


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

end of thread, other threads:[~2025-08-19 22:38 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2025-08-18 19:12           ` Denis Aleksandrov
2025-08-19 22:38             ` Jarkko Sakkinen

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).