Re: [tpmdd-devel] [PATCH 6/6] tpm2: add session handle context saving and restoring to the space code

2017-02-10 Thread Jarkko Sakkinen
On Fri, Feb 10, 2017 at 11:12:15AM -0800, James Bottomley wrote: > On Fri, 2017-02-10 at 21:10 +0200, Jarkko Sakkinen wrote: > > On Fri, Feb 10, 2017 at 08:17:11AM -0800, James Bottomley wrote: > > > On Fri, 2017-02-10 at 14:32 +0200, Jarkko Sakkinen wrote: > > > > On Wed, Feb 08, 2017 at 01:07:08P

Re: [tpmdd-devel] [PATCH 6/6] tpm2: add session handle context saving and restoring to the space code

2017-02-10 Thread James Bottomley
On Fri, 2017-02-10 at 21:10 +0200, Jarkko Sakkinen wrote: > On Fri, Feb 10, 2017 at 08:17:11AM -0800, James Bottomley wrote: > > On Fri, 2017-02-10 at 14:32 +0200, Jarkko Sakkinen wrote: > > > On Wed, Feb 08, 2017 at 01:07:08PM +0200, Jarkko Sakkinen wrote: > > > > From: James Bottomley > > [...]

Re: [PATCH 6/6] tpm2: add session handle context saving and restoring to the space code

2017-02-10 Thread Jarkko Sakkinen
On Fri, Feb 10, 2017 at 08:17:11AM -0800, James Bottomley wrote: > On Fri, 2017-02-10 at 14:32 +0200, Jarkko Sakkinen wrote: > > On Wed, Feb 08, 2017 at 01:07:08PM +0200, Jarkko Sakkinen wrote: > > > From: James Bottomley > [...] > > > +static int tpm2_session_add(struct tpm_chip *chip, u32 handl

Re: [PATCH 6/6] tpm2: add session handle context saving and restoring to the space code'

2017-02-10 Thread Jarkko Sakkinen
On Fri, Feb 10, 2017 at 08:11:18AM -0800, James Bottomley wrote: > On Fri, 2017-02-10 at 10:52 +0200, Jarkko Sakkinen wrote: > > On Wed, Feb 08, 2017 at 01:07:08PM +0200, Jarkko Sakkinen wrote: > > > + rc = tpm2_load_context(chip, space->session_buf, > > > +&

Re: [PATCH 6/6] tpm2: add session handle context saving and restoring to the space code

2017-02-10 Thread James Bottomley
On Fri, 2017-02-10 at 10:52 +0200, Jarkko Sakkinen wrote: > On Wed, Feb 08, 2017 at 01:07:08PM +0200, Jarkko Sakkinen wrote: > > + rc = tpm2_load_context(chip, space->session_buf, > > + &offset, &handle); > > + if (rc == -ENOENT) { > > +

Re: [PATCH 6/6] tpm2: add session handle context saving and restoring to the space code

2017-02-10 Thread James Bottomley
On Fri, 2017-02-10 at 14:32 +0200, Jarkko Sakkinen wrote: > On Wed, Feb 08, 2017 at 01:07:08PM +0200, Jarkko Sakkinen wrote: > > From: James Bottomley [...] > > +static int tpm2_session_add(struct tpm_chip *chip, u32 handle) > > +{ > > + struct tpm_space *space = &chip->work_space; > > + int

Re: [PATCH 6/6] tpm2: add session handle context saving and restoring to the space code

2017-02-10 Thread Jarkko Sakkinen
On Wed, Feb 08, 2017 at 01:07:08PM +0200, Jarkko Sakkinen wrote: > From: James Bottomley > > Sessions are different from transient objects in that their handles > may not be virtualized (because they're used for some hmac > calculations). Additionally when a session is context saved, a > vestigi

Re: [PATCH 6/6] tpm2: add session handle context saving and restoring to the space code

2017-02-10 Thread Jarkko Sakkinen
On Wed, Feb 08, 2017 at 01:07:08PM +0200, Jarkko Sakkinen wrote: > + rc = tpm2_load_context(chip, space->session_buf, > +&offset, &handle); > + if (rc == -ENOENT) { > + /* load failed, just forget session */ > +

[PATCH 6/6] tpm2: add session handle context saving and restoring to the space code

2017-02-08 Thread Jarkko Sakkinen
From: James Bottomley Sessions are different from transient objects in that their handles may not be virtualized (because they're used for some hmac calculations). Additionally when a session is context saved, a vestigial memory remains in the TPM and if it is also flushed, that will be lost and