linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mimi Zohar <zohar@linux.ibm.com>
To: jarkko@kernel.org, linux-integrity@vger.kernel.org
Cc: stable@vger.kernel.org,
	"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
	David Howells <dhowells@redhat.com>,
	Kent Yoder <key@linux.vnet.ibm.com>,
	James Bottomley <jejb@linux.ibm.com>,
	James Morris <jmorris@namei.org>,
	"Serge E. Hallyn" <serge@hallyn.com>,
	David Safford <safford@linux.vnet.ibm.com>,
	"H. Peter Anvin" <hpa@linux.intel.com>
Subject: Re: [PATCH v5 1/3] KEYS: trusted: Fix incorrect handling of tpm_get_random()
Date: Sun, 31 Jan 2021 07:45:41 -0500	[thread overview]
Message-ID: <aac6952a639f85176e84d2e8b2c504069b093847.camel@linux.ibm.com> (raw)
In-Reply-To: <20210128235621.127925-2-jarkko@kernel.org>

On Fri, 2021-01-29 at 01:56 +0200, jarkko@kernel.org wrote:
> From: Jarkko Sakkinen <jarkko@kernel.org>
> 
> When tpm_get_random() was introduced, it defined the following API for the
> return value:
> 
> 1. A positive value tells how many bytes of random data was generated.
> 2. A negative value on error.
> 
> However, in the call sites the API was used incorrectly, i.e. as it would
> only return negative values and otherwise zero. Returning he positive read
> counts to the user space does not make any possible sense.
> 
> Fix this by returning -EIO when tpm_get_random() returns a positive value.
> 
> Fixes: 41ab999c80f1 ("tpm: Move tpm_get_random api into the TPM device driver")
> Cc: stable@vger.kernel.org
> Cc: Mimi Zohar <zohar@linux.ibm.com>
> Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
> Cc: David Howells <dhowells@redhat.com>
> Cc: Kent Yoder <key@linux.vnet.ibm.com>
> Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>

thanks,

Reviewed-by: Mimi Zohar <zohar@linux.ibm.com>


  reply	other threads:[~2021-01-31 15:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-28 23:56 [PATCH v5 0/3] KEYS, trusted: a bunch of bug fixes jarkko
2021-01-28 23:56 ` [PATCH v5 1/3] KEYS: trusted: Fix incorrect handling of tpm_get_random() jarkko
2021-01-31 12:45   ` Mimi Zohar [this message]
2021-01-28 23:56 ` [PATCH v5 2/3] KEYS: trusted: Fix migratable=1 failing jarkko
2021-01-28 23:56 ` [PATCH v5 3/3] KEYS: trusted: Reserve TPM for seal and unseal operations jarkko
     [not found]   ` <CAFA6WYOAbHV=sOxuUdJq91sZbKDMbo6D5KXcSp9ix0PWLpSdaA@mail.gmail.com>
2021-01-30 21:27     ` Jarkko Sakkinen
     [not found]   ` <6459b955f8cb05dae7d15a233f26ff9c9501b839.camel@linux.ibm.com>
2021-01-30 21:28     ` Jarkko Sakkinen
2021-01-31 12:52       ` Mimi Zohar
2021-02-02 16:29         ` 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=aac6952a639f85176e84d2e8b2c504069b093847.camel@linux.ibm.com \
    --to=zohar@linux.ibm.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=dhowells@redhat.com \
    --cc=hpa@linux.intel.com \
    --cc=jarkko@kernel.org \
    --cc=jejb@linux.ibm.com \
    --cc=jmorris@namei.org \
    --cc=key@linux.vnet.ibm.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=safford@linux.vnet.ibm.com \
    --cc=serge@hallyn.com \
    --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).