Messages in this thread | | | Subject | Re: [PATCH 1/4] integrity: TPM internel kernel interface | From | Mimi Zohar <> | Date | Mon, 11 Aug 2008 17:13:51 -0400 |
| |
Christoph Hellwig <hch@infradead.org> wrote on 08/09/2008 02:46:22 PM:
> > +{ > > + struct tpm_chip *pos; > > + > > + spin_lock(&driver_lock); > > + list_for_each_entry(pos, &tpm_chip_list, list) { > > + if ((chip_num == TPM_ANY_NUM || pos->dev_num == chip_num) > > + && (chip_typ == TPM_ANY_TYPE)) { > > + spin_unlock(&driver_lock); > > + return pos; > > + } > > + } > > + > > + spin_unlock(&driver_lock); > > besides the usual coding style issues, what protects the chip from going > away afer you dropped the lock? >
I assume the concern here is that between looking up the chip and actually
using the chip, the TPM chip is disabled/deactivated. Based on discussions with Kenneth Goldman, the TCG main specification part2: structures, require that even if the TPM is disabled/deactivated, the command to extend the PCR will succeed, but the command to read the PCR will fail with an appropriate error code.
Mimi
| |