All of lore.kernel.org
 help / color / mirror / Atom feed
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: Thu, 3 Jul 2025 01:46:25 +0300	[thread overview]
Message-ID: <aGW2wabMXtdBEQxR@kernel.org> (raw)
In-Reply-To: <20250702202851.33344-1-daleksan@redhat.com>

On Wed, Jul 02, 2025 at 04:28:51PM -0400, Denis Aleksandrov wrote:
> 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.

I suppose we can do this. I'm going to holiday for one week next
week so I'll hold for additional feedback for that period and
apply this if nothing comes up.

There's no use case for unprivileged user, or app that stops
working because of this. If you cut hairs, with patch shifting
uapi you have to we always prepared that tree falls down
somewhere but I'm willing to take risk with this :-)


Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>

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

BR, Jarkko

  reply	other threads:[~2025-07-02 22:46 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 [this message]
     [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

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=aGW2wabMXtdBEQxR@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.