Re: [PATCH 1/4] integrity: TPM internel kernel interface

From: Mimi Zohar
Date: Mon Aug 11 2008 - 17:14:09 EST


Christoph Hellwig <hch@xxxxxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/