From patchwork Mon Oct 10 08:44:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stewart Smith X-Patchwork-Id: 680252 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ssv0V1g3lz9rvt for ; Mon, 10 Oct 2016 19:48:10 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3ssv0V0tn8zDsyD for ; Mon, 10 Oct 2016 19:48:10 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mx0a-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 lists.ozlabs.org (Postfix) with ESMTPS id 3sstwV5wjTzDrc8 for ; Mon, 10 Oct 2016 19:44:42 +1100 (AEDT) Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u9A8WcrE050927 for ; Mon, 10 Oct 2016 04:44:40 -0400 Received: from e36.co.us.ibm.com (e36.co.us.ibm.com [32.97.110.154]) by mx0b-001b2d01.pphosted.com with ESMTP id 2606sc2t32-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 10 Oct 2016 04:44:40 -0400 Received: from localhost by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 10 Oct 2016 02:44:39 -0600 Received: from d03dlp02.boulder.ibm.com (9.17.202.178) by e36.co.us.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 10 Oct 2016 02:44:37 -0600 Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id E17913E4003F for ; Mon, 10 Oct 2016 02:44:36 -0600 (MDT) Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u9A8ial716449822; Mon, 10 Oct 2016 01:44:36 -0700 Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id ACFED78047; Mon, 10 Oct 2016 02:44:36 -0600 (MDT) Received: from birb.localdomain (unknown [9.81.212.138]) by b03ledav004.gho.boulder.ibm.com (Postfix) with SMTP id A87C778043; Mon, 10 Oct 2016 02:44:35 -0600 (MDT) Received: by birb.localdomain (Postfix, from userid 1000) id 7C90D233520F; Mon, 10 Oct 2016 19:44:25 +1100 (AEDT) From: Stewart Smith To: skiboot@lists.ozlabs.org, cclaudio@linux.vnet.ibm.com Date: Mon, 10 Oct 2016 19:44:13 +1100 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1476089061-15197-1-git-send-email-stewart@linux.vnet.ibm.com> References: <1476089061-15197-1-git-send-email-stewart@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16101008-0020-0000-0000-000009FB4EBD X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00005885; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000186; SDB=6.00766372; UDB=6.00366537; IPR=6.00542488; BA=6.00004798; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00012933; XFM=3.00000011; UTC=2016-10-10 08:44:38 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16101008-0021-0000-0000-0000564FF762 Message-Id: <1476089061-15197-33-git-send-email-stewart@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-10-10_05:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1610100142 Subject: [Skiboot] [PATCH 32/40] core/init.c: measure event separator before handover to skiroot X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" From: Claudio Carvalho As defined in the TCG Platform Firmware Profile specification revision 00.21, the digest of 0xFFFFFFFF or 0x00000000 must be extended in PCR[0-7] and an EV_SEPARATOR event must be recorded in the event log for PCR[0-7] prior to the first invocation of the first Ready to Boot call. This calls stb_final() before the handover to petitboot kernel in order to have a clean handover. stb_final() implements the steps above and also deallocates the memory allocated for secure and trusted boot. Signed-off-by: Claudio Carvalho Signed-off-by: Stewart Smith --- core/init.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/init.c b/core/init.c index bde5637..13b6acb 100644 --- a/core/init.c +++ b/core/init.c @@ -45,6 +45,7 @@ #include #include #include +#include #include enum proc_gen proc_gen; @@ -379,6 +380,11 @@ static bool load_kernel(void) printf("INIT: Kernel loaded, size: %zu bytes (0 = unknown preload)\n", kernel_size); + /* + * Verify and measure the retrieved PNOR partition as part of the + * secure boot and trusted boot requirements + */ + stb_final(); if (kh->ei_ident != ELF_IDENT) { printf("INIT: ELF header not found. Assuming raw binary.\n");