Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 36992C54EBC for ; Tue, 10 Jan 2023 21:43:08 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6C12D85011; Tue, 10 Jan 2023 22:43:06 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.b="Vl+H2uXL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1A25D8549A; Tue, 10 Jan 2023 22:43:05 +0100 (CET) Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0E5EE82131 for ; Tue, 10 Jan 2023 22:43:01 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=eajames@linux.ibm.com Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30AKOwv5018201; Tue, 10 Jan 2023 21:42:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=WU7nnDZfDD3apAVTiFjBwLBxW8TAl3/aSCpDvEKocwg=; b=Vl+H2uXLoTZmty4AExtCWd7BsbTluukSTBTmPhNQgZpPegvlqytIfZIMweTGBFkeEJTx rL+BDxFqaeRKAEvkmjXeWdvBwDqpgMeMpZ2xTntMBGuBDaGgOMG10p2aPlX7KjVo3bHN xIZIbfEQj6bwZZjjNKCaAXmFeixoHy1kjcf1Gi0AnxvaEhjf7u5rRRAS90Izg1myxSVh xeAwGl0lfLCRZoJG+v/Q3s18SL8FUkvIW9RDYy8uuCeQHY/anGZyU0YSkuH6Q87OQ9Kv LGdHDyMAAESf2H033W0DyJnvLte3TT6QFGe0CE4+v+y7MeufTW6sy/4ds5gzSpQ7Q86q Vg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3n1f1nhjhd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Jan 2023 21:42:59 +0000 Received: from m0127361.ppops.net (m0127361.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 30AL0cLt024535; Tue, 10 Jan 2023 21:42:58 GMT Received: from ppma04wdc.us.ibm.com (1a.90.2fa9.ip4.static.sl-reverse.com [169.47.144.26]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3n1f1nhjh7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Jan 2023 21:42:58 +0000 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 30AIZCHb013430; Tue, 10 Jan 2023 21:42:57 GMT Received: from smtprelay03.dal12v.mail.ibm.com ([9.208.130.98]) by ppma04wdc.us.ibm.com (PPS) with ESMTPS id 3my0c7c38p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Jan 2023 21:42:57 +0000 Received: from smtpav06.wdc07v.mail.ibm.com (smtpav06.wdc07v.mail.ibm.com [10.39.53.233]) by smtprelay03.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 30ALguZh7537178 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Jan 2023 21:42:57 GMT Received: from smtpav06.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DB55158054; Tue, 10 Jan 2023 21:42:56 +0000 (GMT) Received: from smtpav06.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4264C5803F; Tue, 10 Jan 2023 21:42:56 +0000 (GMT) Received: from [9.65.226.208] (unknown [9.65.226.208]) by smtpav06.wdc07v.mail.ibm.com (Postfix) with ESMTP; Tue, 10 Jan 2023 21:42:56 +0000 (GMT) Message-ID: <0279d066-b0ff-64f9-a4d2-7d908af5b747@linux.ibm.com> Date: Tue, 10 Jan 2023 15:42:55 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH v2 0/5] tpm: Support boot measurements To: Heinrich Schuchardt Cc: ilias.apalodimas@linaro.org, sjg@chromium.org, u-boot@lists.denx.de References: <20230109215525.79046-1-eajames@linux.ibm.com> Content-Language: en-US From: Eddie James In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: jWE6Imel3QuE_AAdDc8O9GimwzSSuzJr X-Proofpoint-GUID: mk5Us0ats6BKjlw6Dj_uN7qZjBIHMiTG X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-10_09,2023-01-10_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 malwarescore=0 priorityscore=1501 bulkscore=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 impostorscore=0 mlxlogscore=999 phishscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301100143 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean On 1/9/23 17:35, Heinrich Schuchardt wrote: > On 1/9/23 22:55, Eddie James wrote: >> This series adds support for measuring the boot images more generically >> than the existing EFI support. Several EFI functions have been moved to >> the TPM layer. The series includes optional measurement from the bootm >> command. >> A new test case has been added for the bootm measurement to test the new >> path, and the sandbox TPM2 driver has been updated to support this use >> case. >> >> Changes since v1: >>   - Refactor TPM layer functions to allow EFI system to use them, and >>     remove duplicate EFI functions. >>   - Add test case >>   - Drop #ifdefs for bootm >>   - Add devicetree measurement config option >>   - Update sandbox TPM driver > > This looks like a useful feature to me. Some questions remain: > > How about the booti and bootz commands. Are they covered by the change? No, not yet. > > What are the consequences of your changes for UEFI FIT images (cf. > CONFIG_BOOTM_EFI)? I suppose the image would be measured twice, but only if the user selected both of the relevant config options. > >> >> Eddie James (5): >>    tpm: Fix spelling for tpmu_ha union >>    tpm: Support boot measurements >>    bootm: Support boot measurement >>    tpm: sandbox: Update for needed TPM2 capabilities >>    test: Add sandbox TPM boot measurement > > I am missing the documentation changes. These should describe which > changes in the device-tree and in the configuration are needed to enable > measurements. This should be in doc/usage/ Sure. Thanks, Eddie > > @Ilias: > Could you contribute the UEFI part for the document, please. > > Best regards > > Heinrich > >> >>   arch/sandbox/dts/test.dts      |  12 + >>   boot/Kconfig                   |  23 ++ >>   boot/bootm.c                   |  64 +++ >>   cmd/bootm.c                    |   2 + >>   configs/sandbox_defconfig      |   1 + >>   drivers/tpm/tpm2_tis_sandbox.c | 100 +++-- >>   include/bootm.h                |   2 + >>   include/efi_tcg2.h             |  44 -- >>   include/image.h                |   1 + >>   include/test/suites.h          |   1 + >>   include/tpm-v2.h               | 215 +++++++++- >>   lib/efi_loader/efi_tcg2.c      | 362 +---------------- >>   lib/tpm-v2.c                   | 708 +++++++++++++++++++++++++++++++++ >>   test/boot/Makefile             |   1 + >>   test/boot/measurement.c        |  66 +++ >>   test/cmd_ut.c                  |   2 + >>   16 files changed, 1187 insertions(+), 417 deletions(-) >>   create mode 100644 test/boot/measurement.c >> >