lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200801051354.37843.dds@google.com>
Date:	Sat, 5 Jan 2008 13:54:36 +0900
From:	David Smith <dds@...gle.com>
To:	Pavel Machek <pavel@....cz>
Cc:	Kent Yoder <shpedoikal@...il.com>,
	Marcel Selhorst <tpm@...horst.net>,
	Andrew Morton <akpm@...l.org>,
	TPM Device Driver List <tpmdd-devel@...ts.sourceforge.net>,
	linux-kernel@...r.kernel.org
Subject: Re: [tpmdd-devel] [PATCH] - TPM save state before suspending to ram

> On Fri 2008-01-04 14:09:01, Kent Yoder wrote:
> > On Jan 4, 2008 10:39 AM, Pavel Machek <pavel@....cz> wrote:
> > > On Thu 2008-01-03 21:44:15, Marcel Selhorst wrote:
> > > > Dear list,
> > > >
> > > > this patch fixes a bug, that prevents the TPM chip to resume
> > > > correctly from a suspended state.
> > > >
> > > > Signed-off-by: Marcel Selhorst <tpm@...horst.net>
> >
> > [cut]
> >
> > > I'm not sure if we want to use variable-size array on stack. What
> > > hacks are you doing with max_t/max?
> > >                                                                        
> > > Pavel
> >
> > Hi Pavel,
> >
> >   Here's an alternate solution from David, signoffs pending --
> >
> > commit 058f1e3c4d4e2de5a7188608a1c2e0722498fd4b
> > Author: David Smith <davidsmith@....org>
> > Date:   Fri Jan 4 03:33:11 2008 +0900
> >
> >     Fix for TPM suspend/resume failure
> >
> > diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
> > index 9bb5429..79d2fd5 100644
> > --- a/drivers/char/tpm/tpm.c
> > +++ b/drivers/char/tpm/tpm.c
> > @@ -1046,12 +1046,6 @@ void tpm_remove_hardware(struct device *dev)
> >  }
> >  EXPORT_SYMBOL_GPL(tpm_remove_hardware);
> >
> > -static u8 savestate[] = {
> > -	0, 193,			/* TPM_TAG_RQU_COMMAND */
> > -	0, 0, 0, 10,		/* blob length (in bytes) */
> > -	0, 0, 0, 152		/* TPM_ORD_SaveState */
> > -};
> > -
> >  /*
> >   * We are about to suspend. Save the TPM state
> >   * so that it can be restored.
> > @@ -1059,8 +1053,14 @@ static u8 savestate[] = {
> >  int tpm_pm_suspend(struct device *dev, pm_message_t pm_state)
> >  {
> >  	struct tpm_chip *chip = dev_get_drvdata(dev);
> > +        u8 savestate[] = {
> > +          0, 193,		/* TPM_TAG_RQU_COMMAND */
> > +          0, 0, 0, 10,		/* blob length (in bytes) */
> > +          0, 0, 0, 152		/* TPM_ORD_SaveState */
> > +        };
> > +
> >  	if (chip == NULL)
> > -		return -ENODEV;
> > +          return -ENODEV;
> >
> >  	tpm_transmit(chip, savestate, sizeof(savestate));
> >  	return 0;
>
> Yep, but please fix the whitespace.
> 									Pavel

OK, attached.
-- 
man perl | tail -6 | head -2

View attachment "tpm-suspend.patch" of type "text/x-diff" (1280 bytes)

Download attachment "signature.asc " of type "application/pgp-signature" (482 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ