Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757845AbYHKVOG (ORCPT ); Mon, 11 Aug 2008 17:14:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754582AbYHKVNz (ORCPT ); Mon, 11 Aug 2008 17:13:55 -0400 Received: from e1.ny.us.ibm.com ([32.97.182.141]:57346 "EHLO e1.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754173AbYHKVNy (ORCPT ); Mon, 11 Aug 2008 17:13:54 -0400 In-Reply-To: <20080809184622.GA22905@infradead.org> References: <20080808184349.999902616@linux.vnet.ibm.com> <1218221718.4444.11.camel@localhost.localdomain> <20080809184622.GA22905@infradead.org> To: Christoph Hellwig Cc: James Morris , linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, Randy Dunlap , safford@watson.ibm.com, sailer@watson.ibm.com, Stephen Smalley , serue@linux.vnet.ibm.com, Al Viro , Debora Velarde , Mimi Zohar , Kenneth Goldman MIME-Version: 1.0 Subject: Re: [PATCH 1/4] integrity: TPM internel kernel interface X-KeepSent: 9A2A62B8:D4E0AE57-852574A2:006CEDC6; type=4; name=$KeepSent X-Mailer: Lotus Notes Release 8.0.1 February 07, 2008 Message-ID: From: Mimi Zohar Date: Mon, 11 Aug 2008 17:13:51 -0400 X-MIMETrack: Serialize by Router on D01ML604/01/M/IBM(Build V85_M1_05262008|May 26, 2008) at 08/11/2008 17:13:51, Serialize complete at 08/11/2008 17:13:51 Content-Type: text/plain; charset="US-ASCII" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1220 Lines: 38 Christoph Hellwig 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/