Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1652812

Re: [PATCH RFC] tpm: migrate pubek_show to struct tpm_buf

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH RFC] tpm: migrate pubek_show to struct tpm_buf
Date Tue, 30 May 2017 07:00:02 +0200
Message-ID <tMHqa-2qm-11@gated-at.bofh.it> (permalink)
References <tL8kN-51l-3@gated-at.bofh.it> <tL8kN-51l-1@gated-at.bofh.it> <tL9qy-5KR-21@gated-at.bofh.it> <tL9JT-5SC-1@gated-at.bofh.it>
X-Original-To Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
X-Extloop1 1
X-Ironport-Av E=Sophos;i="5.38,417,1491289200"; d="scan'208";a="106897170"
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
Organization Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo
User-Agent NeoMutt/20170113 (1.7.2)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 29
X-Original-Cc tpmdd-devel@lists.sourceforge.net, linux-security-module@vger.kernel.org, Peter Huewe <peterhuewe@gmx.de>, Marcel Selhorst <tpmdd@selhorst.net>, open list <linux-kernel@vger.kernel.org>
X-Original-Date Tue, 30 May 2017 07:52:08 +0300
X-Original-Message-ID <20170530045208.vqnik6t3zulp4mxe@intel.com>
X-Original-References <20170525211105.843-1-jarkko.sakkinen@linux.intel.com> <20170525211613.GA14802@obsidianresearch.com> <20170525222801.mayost6gxcggurjo@intel.com> <20170525224050.GA15715@obsidianresearch.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1652812

Show key headers only | View raw


On Thu, May 25, 2017 at 04:40:50PM -0600, Jason Gunthorpe wrote:
> On Thu, May 25, 2017 at 03:28:01PM -0700, Jarkko Sakkinen wrote:
> > On Thu, May 25, 2017 at 03:16:13PM -0600, Jason Gunthorpe wrote:
> > > On Thu, May 25, 2017 at 02:11:04PM -0700, Jarkko Sakkinen wrote:
> > > >  	struct tpm_chip *chip = to_tpm_chip(dev);
> > > > +	char anti_replay[20];
> > > >  
> > > > -	tpm_cmd.header.in = tpm_readpubek_header;
> > > > -	err = tpm_transmit_cmd(chip, NULL, &tpm_cmd, READ_PUBEK_RESULT_SIZE,
> > > > +	rc = tpm_buf_init(&tpm_buf, TPM_TAG_RQU_COMMAND, TPM_ORD_READPUBEK);
> > > > +	if (rc)
> > > > +		return rc;
> > > > +
> > > > +	/* The checksum is ignored so it doesn't matter what the contents are.
> > > > +	 */
> > > > +	tpm_buf_append(&tpm_buf, anti_replay, sizeof(anti_replay));
> > > 
> > > It does matter, we do not want to leak random kernel memory incase it
> > > has something sensitive. Zero anti_replay.
> > 
> > If there was a leak it has existed before this change as tpm_cmd was
> > also allocated from stack. And there is not leak because the checksum is
> > not printed.
> 
> It leaks stack memory to the TPM which is not OK.

Right, of course, vtpm_tpm_proxy.

/Jarkko

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: [PATCH RFC] tpm: migrate pubek_show to struct tpm_buf Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2017-05-25 23:20 +0200
  Re: [PATCH RFC] tpm: migrate pubek_show to struct tpm_buf Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-05-26 00:30 +0200
    Re: [PATCH RFC] tpm: migrate pubek_show to struct tpm_buf Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2017-05-26 00:50 +0200
      Re: [PATCH RFC] tpm: migrate pubek_show to struct tpm_buf Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-05-30 07:00 +0200

csiph-web