tpmdd-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] tpm: fix type of a local variable in tpm2_get_cc_attrs_tbl()
@ 2017-09-13 17:26 Jarkko Sakkinen
  2017-09-13 18:14 ` Jason Gunthorpe
  0 siblings, 1 reply; 3+ messages in thread
From: Jarkko Sakkinen @ 2017-09-13 17:26 UTC (permalink / raw)
  To: tpmdd-devel
  Cc: linux-security-module, Jarkko Sakkinen, Peter Huewe,
	Marcel Selhorst, Jason Gunthorpe, open list

The local variable 'attrs' should have the type __be32 instead of u32.

Fixes: 58472f5cd4f6 ("tpm: validate TPM 2.0 commands")
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
---
 drivers/char/tpm/tpm2-cmd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/char/tpm/tpm2-cmd.c b/drivers/char/tpm/tpm2-cmd.c
index 70ee32816c48..f40d20671a78 100644
--- a/drivers/char/tpm/tpm2-cmd.c
+++ b/drivers/char/tpm/tpm2-cmd.c
@@ -980,7 +980,7 @@ static int tpm2_get_cc_attrs_tbl(struct tpm_chip *chip)
 {
 	struct tpm_buf buf;
 	u32 nr_commands;
-	u32 *attrs;
+	__be32 *attrs;
 	u32 cc;
 	int i;
 	int rc;
@@ -1020,7 +1020,7 @@ static int tpm2_get_cc_attrs_tbl(struct tpm_chip *chip)
 
 	chip->nr_commands = nr_commands;
 
-	attrs = (u32 *)&buf.data[TPM_HEADER_SIZE + 9];
+	attrs = (__be32 *)&buf.data[TPM_HEADER_SIZE + 9];
 	for (i = 0; i < nr_commands; i++, attrs++) {
 		chip->cc_attrs_tbl[i] = be32_to_cpup(attrs);
 		cc = chip->cc_attrs_tbl[i] & 0xFFFF;
-- 
2.14.1

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

* Re: [PATCH 1/3] tpm: fix type of a local variable in tpm2_get_cc_attrs_tbl()
  2017-09-13 17:26 [PATCH 1/3] tpm: fix type of a local variable in tpm2_get_cc_attrs_tbl() Jarkko Sakkinen
@ 2017-09-13 18:14 ` Jason Gunthorpe
  2017-09-13 23:04   ` Jarkko Sakkinen
  0 siblings, 1 reply; 3+ messages in thread
From: Jason Gunthorpe @ 2017-09-13 18:14 UTC (permalink / raw)
  To: Jarkko Sakkinen
  Cc: tpmdd-devel, linux-security-module, Peter Huewe, Marcel Selhorst,
	open list

On Wed, Sep 13, 2017 at 10:26:20AM -0700, Jarkko Sakkinen wrote:
> The local variable 'attrs' should have the type __be32 instead of u32.
> 
> Fixes: 58472f5cd4f6 ("tpm: validate TPM 2.0 commands")
> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

All 3 look good to me:

Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>

Jason

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

* Re: [PATCH 1/3] tpm: fix type of a local variable in tpm2_get_cc_attrs_tbl()
  2017-09-13 18:14 ` Jason Gunthorpe
@ 2017-09-13 23:04   ` Jarkko Sakkinen
  0 siblings, 0 replies; 3+ messages in thread
From: Jarkko Sakkinen @ 2017-09-13 23:04 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: tpmdd-devel, linux-security-module, Peter Huewe, Marcel Selhorst,
	open list

On Wed, Sep 13, 2017 at 12:14:21PM -0600, Jason Gunthorpe wrote:
> On Wed, Sep 13, 2017 at 10:26:20AM -0700, Jarkko Sakkinen wrote:
> > The local variable 'attrs' should have the type __be32 instead of u32.
> > 
> > Fixes: 58472f5cd4f6 ("tpm: validate TPM 2.0 commands")
> > Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> 
> All 3 look good to me:
> 
> Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
> 
> Jason

Thanks!

/Jarkko

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

end of thread, other threads:[~2017-09-13 23:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-13 17:26 [PATCH 1/3] tpm: fix type of a local variable in tpm2_get_cc_attrs_tbl() Jarkko Sakkinen
2017-09-13 18:14 ` Jason Gunthorpe
2017-09-13 23:04   ` 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).