Re: [tpmdd-devel] [PATCH] tpm: Check the bios_dir entry for NULL before accessing it

2016-11-16 Thread Jason Gunthorpe
On Wed, Nov 16, 2016 at 02:06:33PM -0800, Jarkko Sakkinen wrote: > > > > Nope, this must be is_err_or_null, we store err ptrs in this array. > > " > err: > chip->bios_dir[cnt] = NULL; > " > > There is assignment to NULL so this should be fine. Oh good, I'm glad that made it in Jason

Re: [tpmdd-devel] [PATCH] tpm: drop chip->is_open and chip->duration_adjusted

2016-11-16 Thread Jarkko Sakkinen
On Tue, Nov 15, 2016 at 10:28:32PM -0700, Jason Gunthorpe wrote: > On Mon, Nov 14, 2016 at 09:11:54PM -0800, Jarkko Sakkinen wrote: > > > How strong is your opposition here? I do not see any exceptional damage > > done but see some subtle but still significant benefits. > > It seems OK, but I

Re: [tpmdd-devel] [PATCH] tpm: Check the bios_dir entry for NULL before accessing it

2016-11-16 Thread Jarkko Sakkinen
On Wed, Nov 16, 2016 at 02:06:33PM -0800, Jarkko Sakkinen wrote: > On Wed, Nov 16, 2016 at 01:38:53PM -0700, Jason Gunthorpe wrote: > > On Wed, Nov 16, 2016 at 08:56:13AM -0500, Stefan Berger wrote: > > > Check the bios_dir entry for NULL before accessing it. Currently > > > this crashes the

Re: [tpmdd-devel] [PATCH] tpm: Check the bios_dir entry for NULL before accessing it

2016-11-16 Thread Jason Gunthorpe
On Wed, Nov 16, 2016 at 08:56:13AM -0500, Stefan Berger wrote: > Check the bios_dir entry for NULL before accessing it. Currently > this crashes the driver when a TPM 2 is attached and the entries > are NULL. Yep > for (i = (TPM_NUM_EVENT_LOG_FILES - 1); i >= 0; i--) { > -

Re: [tpmdd-devel] [PATCH] tpm: vtpm_proxy: Do not access host's event log

2016-11-16 Thread Jason Gunthorpe
On Wed, Nov 16, 2016 at 12:07:23PM -0500, Stefan Berger wrote: > The culprit seems to be 'tpm: fix the missing .owner in > tpm_bios_measurements_ops' That is unlikely, it is probably the patch before which calls read_log unconditionally now. That suggests the crashing is a little random..

Re: [tpmdd-devel] [PATCH] tpm: vtpm_proxy: Do not access host's event log

2016-11-16 Thread Stefan Berger
On 11/16/2016 10:41 AM, Stefan Berger wrote: > On 11/16/2016 10:37 AM, Jarkko Sakkinen wrote: >> On Wed, Nov 16, 2016 at 09:24:05AM -0500, Stefan Berger wrote: >>> The virtual TPM driver must not access the hosts's event log, >>> otherwise we get crashes from that. >>> >>> Signed-off-by: Stefan

[tpmdd-devel] [PATCH 2/4 v2] tpm/tpm2-chip: fix kdoc errors

2016-11-16 Thread Tomas Winkler
Use correct kdoc format, describe correct parameters and return values. Signed-off-by: Tomas Winkler --- V2: rework and rebase of tpm_transmit_cmd kdoc fix drivers/char/tpm/tpm2-cmd.c | 104 1 file changed, 57 insertions(+),

Re: [tpmdd-devel] [PATCH] tpm: Check the bios_dir entry for NULL before accessing it

2016-11-16 Thread Jarkko Sakkinen
On Wed, Nov 16, 2016 at 08:28:30PM +0530, Nayna wrote: > > > On 11/16/2016 07:26 PM, Stefan Berger wrote: > > Check the bios_dir entry for NULL before accessing it. Currently > > this crashes the driver when a TPM 2 is attached and the entries > > are NULL. > > Thanks Stefan !! I think it would

Re: [tpmdd-devel] [patch] tpm: uninitialized variable in read_log_of()

2016-11-16 Thread Jarkko Sakkinen
On Wed, Nov 16, 2016 at 05:12:21PM +0300, Dan Carpenter wrote: > "np" is supposed to be set to NULL at the start. > > Fixes: 4a45d9669ac1 ("tpm: replace of_find_node_by_name() with dev of_node > propert") > Signed-off-by: Dan Carpenter Colid King submitted a patch to

Re: [tpmdd-devel] [PATCH] tpm: Check the bios_dir entry for NULL before accessing it

2016-11-16 Thread Nayna
On 11/16/2016 07:26 PM, Stefan Berger wrote: > Check the bios_dir entry for NULL before accessing it. Currently > this crashes the driver when a TPM 2 is attached and the entries > are NULL. Thanks Stefan !! I think it would be good to also add Fixes in commit description here. Fixes:

[tpmdd-devel] [PATCH] tpm: vtpm_proxy: Do not access host's event log

2016-11-16 Thread Stefan Berger
The virtual TPM driver must not access the hosts's event log, otherwise we get crashes from that. Signed-off-by: Stefan Berger --- drivers/char/tpm/tpm_eventlog.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/char/tpm/tpm_eventlog.c

[tpmdd-devel] [PATCH] tpm: Check the bios_dir entry for NULL before accessing it

2016-11-16 Thread Stefan Berger
Check the bios_dir entry for NULL before accessing it. Currently this crashes the driver when a TPM 2 is attached and the entries are NULL. Signed-off-by: Stefan Berger --- drivers/char/tpm/tpm_eventlog.c | 12 +++- 1 file changed, 7 insertions(+), 5