Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp5637988pxb; Sun, 7 Nov 2021 16:57:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJy94hO7ZlwIYIl35hBWMFnzanTT0iFdyUwcYT9WplAHYu+HoXzdONO3ur0ojBo1tSE7masO X-Received: by 2002:a17:906:a14a:: with SMTP id bu10mr92619300ejb.540.1636333073642; Sun, 07 Nov 2021 16:57:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636333073; cv=none; d=google.com; s=arc-20160816; b=kaCr+eQ+OceKXqKNWpBn3EU0DtY+vUJoYSV4ULz60WWgv6siLqR7Ffpoh14aNZinrO oMP+3SBHXKcrRrY+a/hI8kRlS1MmBB7e/byEmD35L6UQOkb5Gk57qr2H6dfXjBuotXHO r1/XWJ89fOEQLqsZoGDhK1jmo+8//gTPoHSSjPWLeNnOlsTmeEuQpcK8OSafosNT08Qa 6aacZhtELSgujaLAK1FO0vP74aqRmJZeP68ibg0jMB/35fFS+xxiCXbucU9qnlzpQV/j W81G8OyUbXLWZj55am3NCVbRY1Yb1QWIudvYaUFo8iIBJJNWJLMW7Lb1HOboWr6m12li mOIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=vvhHrDlviXEtiu42f9Ed4TiIZsHPlHHchTgbcPhjOC4=; b=v05Hvqf9wrjqfG/B69UAGeTqiBbPfOgQYZYB46k2Sv+mi+ODGk1fxryeIg3jVQwRmZ T/bdP//CXP0dYmaN9f3z7A8FJhbfcW5wYi+6yAY0+G/Eldb0hzSIy1S3EMzMLhYU1ecU zhTJZLmS98WRp+M2e+cep8aBRJDWBDlGVu7ttvrgyzjRcpu8YmoXi3gV6SOHwtO4IES0 R6JCdLe2zO7Evys4eekwHPBlcNARGkD2HUrI0gNyeNfOSvJ1LyGFXK6KNhUCegOgtN41 zuFycm/ZlJ2EIN/0tTrc7oipG7RLzKr4zobHaOanL6QjjI4e9p1+5u62S4fBdqA+hBhT Y7kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@axtens.net header.s=google header.b=DKLtpSmb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id sc20si45452162ejc.61.2021.11.07.16.57.30; Sun, 07 Nov 2021 16:57:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@axtens.net header.s=google header.b=DKLtpSmb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232540AbhKGWVw (ORCPT + 99 others); Sun, 7 Nov 2021 17:21:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234236AbhKGWVs (ORCPT ); Sun, 7 Nov 2021 17:21:48 -0500 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3CF1C061714 for ; Sun, 7 Nov 2021 14:19:00 -0800 (PST) Received: by mail-pf1-x436.google.com with SMTP id o4so181246pfp.13 for ; Sun, 07 Nov 2021 14:19:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=vvhHrDlviXEtiu42f9Ed4TiIZsHPlHHchTgbcPhjOC4=; b=DKLtpSmbwJwijOvRDAEnE4ouv7I+PdkspcRptedwiQW+s7ock1jLZ//bfUU3KqVhBO bBQUAl9KcJ1Q6mAns3nLRjQIQf8hjG69ijlsXDi7sqJ5OokTU1fTXsCKgltrRRuLpfRp 92fkj1s+7TZaU7a4cKiYGeze0dqq2qCOcVosc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=vvhHrDlviXEtiu42f9Ed4TiIZsHPlHHchTgbcPhjOC4=; b=cQDZWhHVEWmw+IP4CyZF+3oEg483XiiVsRCIEQKJHK5mlt+82s6I8jPLrQ1IB9aeXb ky/Ig6A8iHUbmwy9bpMAdtcKMl/jQfm4Md0RwnLjeXzW0SIFOFGciDkzoKCzFynHnulu GNUqMTdgxrqfLbXbswpaAZyp0ROlofzSf0eMz6QK6eMM05nQJ7XmMX9vS4ia82n15kDO mpfnUQA0Dq7Ay/WNFmMu7SkFsBedXcte8Rbr+ODaGrSilR1NPgFlE/Doma4jJKe2DvZ8 DXX+6ASRJt6SxY68eNuI0m5Abxql3EJfglWTXOJ7FaDZSlEAsz0CSaTkcHNr0zCS/A+I soKA== X-Gm-Message-State: AOAM53117GiBmcObHzHsX8g+EeEbfMNxhRMBQxc0lFI2Byy97PoVF77g MGZXt3UA54ZFWbTjk4+D0qFuaw== X-Received: by 2002:a05:6a00:8c4:b0:44c:9827:16cc with SMTP id s4-20020a056a0008c400b0044c982716ccmr76290901pfu.7.1636323540309; Sun, 07 Nov 2021 14:19:00 -0800 (PST) Received: from localhost ([2001:4479:e000:e400:9243:f22c:33ee:c8cf]) by smtp.gmail.com with ESMTPSA id d17sm13127106pfo.40.2021.11.07.14.18.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 14:18:59 -0800 (PST) From: Daniel Axtens To: Michal =?utf-8?Q?Such=C3=A1nek?= , Mimi Zohar Cc: keyrings@vger.kernel.org, Rob Herring , linux-s390@vger.kernel.org, Vasily Gorbik , Lakshmi Ramasubramanian , Heiko Carstens , Jessica Yu , linux-kernel@vger.kernel.org, David Howells , Christian Borntraeger , Luis Chamberlain , Paul Mackerras , Hari Bathini , Alexander Gordeev , linuxppc-dev@lists.ozlabs.org, Frank van der Linden , Thiago Jung Bauermann Subject: Re: [PATCH 0/3] KEXEC_SIG with appended signature In-Reply-To: <20211105131401.GL11195@kunlun.suse.cz> References: <87czneeurr.fsf@dja-thinkpad.axtens.net> <20211105131401.GL11195@kunlun.suse.cz> Date: Mon, 08 Nov 2021 09:18:56 +1100 Message-ID: <87a6ifehin.fsf@dja-thinkpad.axtens.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Michal Such=C3=A1nek writes: > On Fri, Nov 05, 2021 at 09:55:52PM +1100, Daniel Axtens wrote: >> Michal Suchanek writes: >>=20 >> > S390 uses appended signature for kernel but implements the check >> > separately from module loader. >> > >> > Support for secure boot on powerpc with appended signature is planned - >> > grub patches submitted upstream but not yet merged. >>=20 >> Power Non-Virtualised / OpenPower already supports secure boot via kexec >> with signature verification via IMA. I think you have now sent a >> follow-up series that merges some of the IMA implementation, I just >> wanted to make sure it was clear that we actually already have support > > So is IMA_KEXEC and KEXEC_SIG redundant? > > I see some architectures have both. I also see there is a lot of overlap > between the IMA framework and the KEXEC_SIG and MODULE_SIg. Mimi would be much better placed than me to answer this. The limits of my knowledge are basically that signature verification for modules and kexec kernels can be enforced by IMA policies. For example a secure booted powerpc kernel with module support will have the following IMA policy set at the arch level: "appraise func=3DKEXEC_KERNEL_CHECK appraise_flag=3Dcheck_blacklist apprais= e_type=3Dimasig|modsig", (in arch/powerpc/kernel/ima_arch.c) Module signature enforcement can be set with either IMA (policy like "appraise func=3DMODULE_CHECK appraise_flag=3Dcheck_blacklist appraise_type= =3Dimasig|modsig" ) or with CONFIG_MODULE_SIG_FORCE/module.sig_enforce=3D1. Sometimes this leads to arguably unexpected interactions - for example commit fa4f3f56ccd2 ("powerpc/ima: Fix secure boot rules in ima arch policy"), so it might be interesting to see if we can make things easier to understand. I suspect another amusing interaction is that if the IMA verification is used, the signature could be in an xattr rather than an appended signature. Kind regards, Daniel