Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp77156pxp; Thu, 10 Mar 2022 23:02:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJwSqFGwFALzkpBfKtqBWCd4wVVKtXX6aJoN5qPQ1E1PKIxlePM2w5g04ojtrP9XEYM0SCd+ X-Received: by 2002:a17:902:db11:b0:151:fa7a:7d5e with SMTP id m17-20020a170902db1100b00151fa7a7d5emr9215766plx.125.1646982157056; Thu, 10 Mar 2022 23:02:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646982157; cv=none; d=google.com; s=arc-20160816; b=En6Qo0EtY+uTLd5ef0Wkb7Lme0ARXyip/EqVG/vXn6Gpil8+cUbisnMEPx9HDvWd7r E8xPFC6Ztr78GXGrv1o43/GUoNzvtdY0e/pna/MjUIwOM7SvVHoBL0SFwyuJ6QCNMeFY Ca/MTtV4wd5/xQNTlyVDqJbGPHeNoN3FQSBQ2qIU6MX/uZTXbMFD910LrKlKfkPZMoLx jvmsRHdXg7fHKIvoqoHzB0G9E+JmWDY5p3XnzjLugWVFJCd/qP9N6Ef/iO57qfZXwMRw B5y4SjgxGdOl7prtr3y6fdfzusr2haZwgIXcTcWKTqiup/Ne1qbm6qdfkiGblAXiVdBl atZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=AYdo1AQd1DukO1ZWiOzG32Xmaay+ti40BRN5Doqxxx8=; b=sKcvu19s1a5AZqsK9VmC9IEMCsZsB+luN8JiAhmu9+Oa1EuN9oZslLXvXqsjdcykLF X9Wbop0WyZPNZsdNErkRGrrsMAY+9R+xsISuIQX3ZQYIpaPA86HJOzV1XcmS/RI1d79/ BSQ6nw7e8AZXasXPHVo+qh0joKj5tRVgjf31O26PcE6Jt3izSGA/lh0rvPYT++URC3YD 6z2H/iPbVeq5i6e3F8lgLJSlmn1487EnEFPnruHQvpI10aLasgyxHlU2vXG9DC8xG+Me Eqcjg8XtvgK5Orp3Icbg0vViz9ziyOfXSvkbQ8eEiDMGRCJjw6QDwO0k3tQKCCeyHWEN GQ8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=ghF9dOAr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i12-20020a17090acf8c00b001bf37e05b24si4194850pju.130.2022.03.10.23.02.01; Thu, 10 Mar 2022 23:02:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=ghF9dOAr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344054AbiCJVq1 (ORCPT + 99 others); Thu, 10 Mar 2022 16:46:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234231AbiCJVqZ (ORCPT ); Thu, 10 Mar 2022 16:46:25 -0500 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DAA2159289; Thu, 10 Mar 2022 13:45:23 -0800 (PST) Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 22AKVSq8030636; Thu, 10 Mar 2022 21:45:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : mime-version; s=pp1; bh=AYdo1AQd1DukO1ZWiOzG32Xmaay+ti40BRN5Doqxxx8=; b=ghF9dOArRhBc9solvCGhR+w/sJ3T7GAAJHjuMkEMu5IeCej0HTrmrmnED0ZMHQ3zl9or CBIQvrHwl1DjWli2xg26NP5zFYzxBTQKiyhZF8dmt+inQGT8cYqQ/9sIJIxnHokkJx1B WZcfgTYp/EPau3NNRGhK8adBsQSQq0itrithIT6o2i//eB8HI0qHcvH6gctU872czGCA hsp1WPyUHos5iEOuskE7NUjojTzdesZKjeOhf8F186wL77srRJzGcSXxnqfWl1VNy1Zw DEbGKHwYpqTWNVJDoMRoBRMosOs/mtCyW4InAE4jhZVBQCMQ9jgc01AP4OfTTSZUgjT1 LA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3epwxfkayc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 10 Mar 2022 21:45:18 +0000 Received: from m0098421.ppops.net (m0098421.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 22ALEiqm025309; Thu, 10 Mar 2022 21:45:18 GMT Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 3epwxfkaxt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 10 Mar 2022 21:45:17 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 22ALi3gu006200; Thu, 10 Mar 2022 21:45:16 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma04ams.nl.ibm.com with ESMTP id 3enqgnr658-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 10 Mar 2022 21:45:16 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 22ALjDSx54854010 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 10 Mar 2022 21:45:13 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EBD53A4040; Thu, 10 Mar 2022 21:45:12 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E4EFCA404D; Thu, 10 Mar 2022 21:45:09 +0000 (GMT) Received: from li-4b5937cc-25c4-11b2-a85c-cea3a66903e4.ibm.com.com (unknown [9.211.53.50]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 10 Mar 2022 21:45:09 +0000 (GMT) From: Nayna Jain To: linux-integrity@vger.kernel.org, keyrings@vger.kernel.org Cc: dhowells@redhat.com, zohar@linux.ibm.com, jarkko@kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, dimitri.ledkov@canonical.com, seth@forshee.me, rnsastry@linux.ibm.com, Masahiro Yamada , Nayna Jain Subject: [PATCH v11 0/4] integrity: support including firmware ".platform" keys at build time Date: Thu, 10 Mar 2022 16:44:46 -0500 Message-Id: <20220310214450.676505-1-nayna@linux.ibm.com> X-Mailer: git-send-email 2.27.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: DTJNzB91RNcxH9fF-9zWCHvF_D0PKpQo X-Proofpoint-ORIG-GUID: BCVqt7ZZFljSIHWFVcIUlmRB0L0WHxJ8 Content-Transfer-Encoding: 8bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-03-10_09,2022-03-09_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 clxscore=1011 impostorscore=0 phishscore=0 adultscore=0 malwarescore=0 suspectscore=0 mlxscore=0 spamscore=0 bulkscore=0 priorityscore=1501 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2203100107 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some firmware support secure boot by embedding static keys to verify the Linux kernel during boot. However, these firmware do not expose an interface for the kernel to load firmware keys onto the ".platform" keyring, preventing the kernel from verifying the kexec kernel image signature. This patchset exports load_certificate_list() and defines a new function load_builtin_platform_cert() to load compiled in certificates onto the ".platform" keyring. Changelog: v11: * Added a new patch to conditionally build extract-cert if PLATFORM_KEYRING is enabled. v10: * Fixed the externs warning for Patch 3. v9: * Rebased on Jarkko's repo - git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git v8: * Includes Jarkko's feedback on patch description and removed Reported-by for Patch 1. v7: * Incldues Jarkko's feedback on patch description for Patch 1 and 3. v6: * Includes Jarkko's feedback: * Split Patch 2 into two. * Update Patch description. v5: * Renamed load_builtin_platform_cert() to load_platform_certificate_list() and config INTEGRITY_PLATFORM_BUILTIN_KEYS to INTEGRITY_PLATFORM_KEYS, as suggested by Mimi Zohar. v4: * Split into two patches as per Mimi Zohar and Dimitri John Ledkov recommendation. v3: * Included Jarkko's feedback ** updated patch description to include approach. ** removed extern for function declaration in the .h file. * Included load_certificate_list() within #ifdef CONFIG_KEYS condition. v2: * Fixed the error reported by kernel test robot * Updated patch description based on Jarkko's feedback. Nayna Jain (4): certs: export load_certificate_list() to be used outside certs/ integrity: make integrity_keyring_from_id() non-static certs: conditionally build extract-cert if platform keyring is enabled integrity: support including firmware ".platform" keys at build time certs/Makefile | 9 ++++++-- certs/blacklist.c | 1 - certs/common.c | 2 +- certs/common.h | 9 -------- certs/system_keyring.c | 1 - include/keys/system_keyring.h | 6 +++++ security/integrity/Kconfig | 10 ++++++++ security/integrity/Makefile | 15 +++++++++++- security/integrity/digsig.c | 2 +- security/integrity/integrity.h | 9 ++++++++ .../integrity/platform_certs/platform_cert.S | 23 +++++++++++++++++++ .../platform_certs/platform_keyring.c | 23 +++++++++++++++++++ 12 files changed, 94 insertions(+), 16 deletions(-) delete mode 100644 certs/common.h create mode 100644 security/integrity/platform_certs/platform_cert.S base-commit: fb5abce6b2bb5cb3d628aaa63fa821da8c4600f9 -- 2.27.0