Re: [PATCH] tpm2: fix off-by-one comparison and out-of-bounds read error

2017-03-23 Thread Jarkko Sakkinen
On Thu, Mar 23, 2017 at 07:42:09PM +0300, Dan Carpenter wrote: > On Thu, Mar 23, 2017 at 05:53:58PM +0200, Jarkko Sakkinen wrote: > > On Wed, Mar 22, 2017 at 04:12:49PM +0300, Dan Carpenter wrote: > > > On Wed, Mar 22, 2017 at 11:45:37AM +, Colin Ian King wrote: > > > > On 22/03/17 11:42,

Re: [PATCH] tpm2: fix off-by-one comparison and out-of-bounds read error

2017-03-23 Thread Jarkko Sakkinen
On Thu, Mar 23, 2017 at 07:42:09PM +0300, Dan Carpenter wrote: > On Thu, Mar 23, 2017 at 05:53:58PM +0200, Jarkko Sakkinen wrote: > > On Wed, Mar 22, 2017 at 04:12:49PM +0300, Dan Carpenter wrote: > > > On Wed, Mar 22, 2017 at 11:45:37AM +, Colin Ian King wrote: > > > > On 22/03/17 11:42,

Re: [PATCH] tpm2: fix off-by-one comparison and out-of-bounds read error

2017-03-23 Thread Dan Carpenter
On Thu, Mar 23, 2017 at 05:53:58PM +0200, Jarkko Sakkinen wrote: > On Wed, Mar 22, 2017 at 04:12:49PM +0300, Dan Carpenter wrote: > > On Wed, Mar 22, 2017 at 11:45:37AM +, Colin Ian King wrote: > > > On 22/03/17 11:42, Jarkko Sakkinen wrote: > > > > On Mon, Mar 20, 2017 at 02:23:36PM +,

Re: [PATCH] tpm2: fix off-by-one comparison and out-of-bounds read error

2017-03-23 Thread Dan Carpenter
On Thu, Mar 23, 2017 at 05:53:58PM +0200, Jarkko Sakkinen wrote: > On Wed, Mar 22, 2017 at 04:12:49PM +0300, Dan Carpenter wrote: > > On Wed, Mar 22, 2017 at 11:45:37AM +, Colin Ian King wrote: > > > On 22/03/17 11:42, Jarkko Sakkinen wrote: > > > > On Mon, Mar 20, 2017 at 02:23:36PM +,

Re: [PATCH] tpm2: fix off-by-one comparison and out-of-bounds read error

2017-03-23 Thread Jarkko Sakkinen
On Thu, Mar 23, 2017 at 05:53:58PM +0200, Jarkko Sakkinen wrote: > On Wed, Mar 22, 2017 at 04:12:49PM +0300, Dan Carpenter wrote: > > On Wed, Mar 22, 2017 at 11:45:37AM +, Colin Ian King wrote: > > > On 22/03/17 11:42, Jarkko Sakkinen wrote: > > > > On Mon, Mar 20, 2017 at 02:23:36PM +,

Re: [PATCH] tpm2: fix off-by-one comparison and out-of-bounds read error

2017-03-23 Thread Jarkko Sakkinen
On Thu, Mar 23, 2017 at 05:53:58PM +0200, Jarkko Sakkinen wrote: > On Wed, Mar 22, 2017 at 04:12:49PM +0300, Dan Carpenter wrote: > > On Wed, Mar 22, 2017 at 11:45:37AM +, Colin Ian King wrote: > > > On 22/03/17 11:42, Jarkko Sakkinen wrote: > > > > On Mon, Mar 20, 2017 at 02:23:36PM +,

Re: [PATCH] tpm2: fix off-by-one comparison and out-of-bounds read error

2017-03-23 Thread Jarkko Sakkinen
On Wed, Mar 22, 2017 at 04:12:49PM +0300, Dan Carpenter wrote: > On Wed, Mar 22, 2017 at 11:45:37AM +, Colin Ian King wrote: > > On 22/03/17 11:42, Jarkko Sakkinen wrote: > > > On Mon, Mar 20, 2017 at 02:23:36PM +, Colin King wrote: > > >> From: Colin Ian King >

Re: [PATCH] tpm2: fix off-by-one comparison and out-of-bounds read error

2017-03-23 Thread Jarkko Sakkinen
On Wed, Mar 22, 2017 at 04:12:49PM +0300, Dan Carpenter wrote: > On Wed, Mar 22, 2017 at 11:45:37AM +, Colin Ian King wrote: > > On 22/03/17 11:42, Jarkko Sakkinen wrote: > > > On Mon, Mar 20, 2017 at 02:23:36PM +, Colin King wrote: > > >> From: Colin Ian King > > >> > > >> The comparison

Re: [PATCH] tpm2: fix off-by-one comparison and out-of-bounds read error

2017-03-23 Thread Jarkko Sakkinen
On Wed, Mar 22, 2017 at 11:45:37AM +, Colin Ian King wrote: > On 22/03/17 11:42, Jarkko Sakkinen wrote: > > On Mon, Mar 20, 2017 at 02:23:36PM +, Colin King wrote: > >> From: Colin Ian King > >> > >> The comparison of an out of range index into space->context_tbl

Re: [PATCH] tpm2: fix off-by-one comparison and out-of-bounds read error

2017-03-23 Thread Jarkko Sakkinen
On Wed, Mar 22, 2017 at 11:45:37AM +, Colin Ian King wrote: > On 22/03/17 11:42, Jarkko Sakkinen wrote: > > On Mon, Mar 20, 2017 at 02:23:36PM +, Colin King wrote: > >> From: Colin Ian King > >> > >> The comparison of an out of range index into space->context_tbl is > >> off-by-one and

Re: [PATCH] tpm2: fix off-by-one comparison and out-of-bounds read error

2017-03-22 Thread Dan Carpenter
On Wed, Mar 22, 2017 at 11:45:37AM +, Colin Ian King wrote: > On 22/03/17 11:42, Jarkko Sakkinen wrote: > > On Mon, Mar 20, 2017 at 02:23:36PM +, Colin King wrote: > >> From: Colin Ian King > >> > >> The comparison of an out of range index into space->context_tbl

Re: [PATCH] tpm2: fix off-by-one comparison and out-of-bounds read error

2017-03-22 Thread Dan Carpenter
On Wed, Mar 22, 2017 at 11:45:37AM +, Colin Ian King wrote: > On 22/03/17 11:42, Jarkko Sakkinen wrote: > > On Mon, Mar 20, 2017 at 02:23:36PM +, Colin King wrote: > >> From: Colin Ian King > >> > >> The comparison of an out of range index into space->context_tbl is > >> off-by-one and

Re: [PATCH] tpm2: fix off-by-one comparison and out-of-bounds read error

2017-03-22 Thread Jarkko Sakkinen
On Mon, Mar 20, 2017 at 02:23:36PM +, Colin King wrote: > From: Colin Ian King > > The comparison of an out of range index into space->context_tbl is > off-by-one and should be using >= rather than > in the comparison. > > Detected by CoverityScan, CID#1419694

Re: [PATCH] tpm2: fix off-by-one comparison and out-of-bounds read error

2017-03-22 Thread Jarkko Sakkinen
On Mon, Mar 20, 2017 at 02:23:36PM +, Colin King wrote: > From: Colin Ian King > > The comparison of an out of range index into space->context_tbl is > off-by-one and should be using >= rather than > in the comparison. > > Detected by CoverityScan, CID#1419694 ("Out-of-bounds read") > >

Re: [PATCH] tpm2: fix off-by-one comparison and out-of-bounds read error

2017-03-22 Thread Colin Ian King
On 22/03/17 11:42, Jarkko Sakkinen wrote: > On Mon, Mar 20, 2017 at 02:23:36PM +, Colin King wrote: >> From: Colin Ian King >> >> The comparison of an out of range index into space->context_tbl is >> off-by-one and should be using >= rather than > in the comparison.

Re: [PATCH] tpm2: fix off-by-one comparison and out-of-bounds read error

2017-03-22 Thread Colin Ian King
On 22/03/17 11:42, Jarkko Sakkinen wrote: > On Mon, Mar 20, 2017 at 02:23:36PM +, Colin King wrote: >> From: Colin Ian King >> >> The comparison of an out of range index into space->context_tbl is >> off-by-one and should be using >= rather than > in the comparison. >> >> Detected by

[PATCH] tpm2: fix off-by-one comparison and out-of-bounds read error

2017-03-20 Thread Colin King
From: Colin Ian King The comparison of an out of range index into space->context_tbl is off-by-one and should be using >= rather than > in the comparison. Detected by CoverityScan, CID#1419694 ("Out-of-bounds read") Fixes: 849246e7ce9ce ("tpm2: add session handle

[PATCH] tpm2: fix off-by-one comparison and out-of-bounds read error

2017-03-20 Thread Colin King
From: Colin Ian King The comparison of an out of range index into space->context_tbl is off-by-one and should be using >= rather than > in the comparison. Detected by CoverityScan, CID#1419694 ("Out-of-bounds read") Fixes: 849246e7ce9ce ("tpm2: add session handle context saving and restoring