From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753694AbdFWNmr (ORCPT ); Fri, 23 Jun 2017 09:42:47 -0400 Received: from lhrrgout.huawei.com ([194.213.3.17]:29213 "EHLO lhrrgout.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751231AbdFWNmp (ORCPT ); Fri, 23 Jun 2017 09:42:45 -0400 From: Roberto Sassu To: CC: , , , Roberto Sassu Subject: [PATCH 0/2] Update PCR read code Date: Fri, 23 Jun 2017 15:41:55 +0200 Message-ID: <20170623134157.30399-1-roberto.sassu@huawei.com> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.204.65.245] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.594D1AD3.01A3,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 28a69effb6fd47e43a3b9087cb791d9a Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch set updates tpm2_pcr_read(), to build the PCR read command buffer with tpm_buf functions, which offer protection against buffer overflow. It also removes duplicate code in tpm2_do_selftest(), and replaces it with a call to tpm2_pcr_read(). The previous version of the patches can be found at the URLs: https://sourceforge.net/p/tpmdd/mailman/message/35905413/ https://sourceforge.net/p/tpmdd/mailman/message/35905415/ The version number has not been incremented from 3 to 4, since this is considered as a new patch set, not providing the same functionality of the set the patches were originally part of. Changelog - PCR code changes are applied directly to tpm2_pcr_read() - removed tpm2_pcr_read_in structure - modified size of digest array in tpm2_pcr_read_out structure Roberto Sassu (2): tpm: use tpm_buf functions in tpm2_pcr_read() tpm: use tpm2_pcr_read() in tpm2_do_selftest() drivers/char/tpm/tpm2-cmd.c | 89 +++++++++++++++------------------------------ 1 file changed, 30 insertions(+), 59 deletions(-) -- 2.9.3