Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752493Ab0K3Oc2 (ORCPT ); Tue, 30 Nov 2010 09:32:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46783 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752094Ab0K3Oc0 (ORCPT ); Tue, 30 Nov 2010 09:32:26 -0500 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <20101124023238.GA26540@tiny> References: <20101124023238.GA26540@tiny> <1290552635-3356-1-git-send-email-zohar@linux.vnet.ibm.com> <1290556456.2604.14.camel@localhost.localdomain> To: kjhall@us.ibm.com, Serge Hallyn , Mimi Zohar , tpmdd-devel@lists.sourceforge.net Cc: dhowells@redhat.com, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, keyrings@linux-nfs.org, linux-crypto@vger.kernel.org, Jason Gunthorpe , James Morris , David Safford , Rajiv Andrade Subject: Re: [PATCH v1.5 3/5] key: add tpm_send command Date: Tue, 30 Nov 2010 14:32:00 +0000 Message-ID: <19268.1291127520@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 987 Lines: 26 Serge Hallyn wrote: > > +int tpm_send(u32 chip_num, void *cmd, size_t buflen) > > Hate to nit-pick, but any particular reason you're not following the > rest of the file and using 'struct tpm_cmd_t *cmd' here? Ummm... Something else I've just noticed... static ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf, size_t bufsiz) would suggest that buf is read-only, but tpm_transit() keeps casting it away, and especially, casts it away before passing it to chip->vendor.recv()... This would seem to indicate a logic error somewhere. Certainly, tpm_atml_recv() modifies the buffer it is given to... I suspect the argument and reply buffer pointers should be passed separately. David -- 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/