Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp351769rwb; Mon, 26 Sep 2022 20:32:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7KBPPWSkySZYSV+P0vBKpIPnmqgCn/iPuYS1jjXp8EGAd9PrfUxX4aNe11QIq6XcQYHqCz X-Received: by 2002:a17:903:2452:b0:178:1c88:4a50 with SMTP id l18-20020a170903245200b001781c884a50mr25555052pls.113.1664249579638; Mon, 26 Sep 2022 20:32:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664249579; cv=none; d=google.com; s=arc-20160816; b=b5kbUdIstZIYrlGyqcAB19QA41KUGxkCnOCA+JlnOogNPqCozNUfM6K/pxSProG2Xw Ft0qIIM22SgEP3sX854KNT6bo0R6x/XGabD1FlQrF3Q+BlV4Mm/VRDmIIMFciEx+BD5W JYdWsifdp5DFn9gzIz60dg3ZY0NZrS4SxIi/UtZvUN64srJX8U1E1dZw65kvgIgOUMVg YGRDTBRKY8hemZZrYTy4ralECgxpxebezXc3BJwndBTRd6b866htVahP+/R4ZS4iGa1m cezHOm2TagJ12o0J3XhEibAbyhFmVaM78HYILe1vkEnyeVczo4woBOIm1gc8WCZfBrsg GQIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=V8M4eGg3gaCQZE6o72RB5TOdPiGCPoyqG6tJ9FqxFAs=; b=JfWfWZm2zbeyhmamdIA0tsECm1btISPrbls4bVHqxnLg271Iy3h2vmSXiWvBz6+F9l b56MksnSu4IwRplgNaIm0O4rJpweh1SpWquz9KwLLbZiaNU9Mu42mwAeXhLB7QFrNT2t ENX5UN+F/2P30sK39hT295epNETpmWO1LqiRyfvwdM8VsNO0fPL+p5tPgFjnTW/8NkY/ x0iR1933jSgR9O8ARqh33AKbpBEN/V80/40rAxcWF7EBKRcVMKTPADbR7GiR7Jm1GnmA PIHfnkm6IoFKPV8GxcCmiCgcyQ4+dcFNVkJFD0+bMTEVoinTQvGFTFR52IT2xydYDUWF Bvqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MRYnGiyG; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e17-20020a17090a4a1100b002009ed52bf6si522069pjh.19.2022.09.26.20.32.47; Mon, 26 Sep 2022 20:32:59 -0700 (PDT) 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=@linaro.org header.s=google header.b=MRYnGiyG; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229747AbiI0CkJ (ORCPT + 99 others); Mon, 26 Sep 2022 22:40:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229545AbiI0CkH (ORCPT ); Mon, 26 Sep 2022 22:40:07 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04DCC9F749 for ; Mon, 26 Sep 2022 19:40:04 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id c24so7901135plo.3 for ; Mon, 26 Sep 2022 19:40:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date:from:to:cc:subject:date; bh=V8M4eGg3gaCQZE6o72RB5TOdPiGCPoyqG6tJ9FqxFAs=; b=MRYnGiyGQzAlQYCTGUTcEAcktEcLJHH7qTRBTxWQAbCpG3ywr6mwuBCNXi9xbv61Qp T5efRWUQRkpxvfkxyDtfKKxy2R41uCAHqVvSK3vNqoRUwVqVUywP3p0k61kxKKM2DznB fi3D5K9hrECwmWmAPj232bfprA2GiCcfznZ9dnioj0HGAi/5gbEJRd5EPaFolfVw4krz GpGKeczFd65BMaKa33nKHpfzkBsaoL0QnLjxOge4vLRzLbBo5XSzEcajxxgMLexMZ4ad qt0jW7DRonlwaOsj1cMyFyMNCWybcVliKgdJNUQLp90VyFThq1qVRPqwAPF5/xPtySgO qi1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date:x-gm-message-state:from:to:cc:subject:date; bh=V8M4eGg3gaCQZE6o72RB5TOdPiGCPoyqG6tJ9FqxFAs=; b=JAwK07fKd6wHmfSeEQ6GgACFGc3Pnv8sTUiM7fXInpLUQRnFRU9FZAaAtaEDG7mHNP J5hobqiqeuVhrehkCUYrWsk9HBhJVhq38au6NQ63dgRAxXVdNsdOFPy5E6GpXYqjIxyV sjMf3YfN4VoKHqFbbYs2TFvJd07O36Bn8BgeaRM7C4FQdKCT88fVC6MGAhLBr1gKzt25 3za6AhzbktBu1fQ1Dg/Cf1e8yDMmposKnQ7zB75zqA/jbddxqiZHw47A0e7X7TanJc16 OLQRTWWO6MNyVRwVWH80BgFmjI9r63G0VG1jxrGP5x0KxyP+1NzyqZnQ65shzo16kBTN 2t3A== X-Gm-Message-State: ACrzQf2a8r7uDNBSIl9YVgBM4JdNkpeeAreFbfX6H4LIML2YhV6oAgVe T+kFowcZ6SfTp1bsNt8Esflf/w== X-Received: by 2002:a17:902:f688:b0:179:e82e:2dec with SMTP id l8-20020a170902f68800b00179e82e2decmr1943916plg.25.1664246403786; Mon, 26 Sep 2022 19:40:03 -0700 (PDT) Received: from laputa ([2400:4050:c3e1:100:835a:afba:269b:b6fb]) by smtp.gmail.com with ESMTPSA id w11-20020aa79a0b000000b0052d4b0d0c74sm245374pfj.70.2022.09.26.19.39.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Sep 2022 19:40:02 -0700 (PDT) Date: Tue, 27 Sep 2022 11:39:52 +0900 From: AKASHI Takahiro To: Michal Such??nek Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Alexander Gordeev , Sven Schnelle , Philipp Rudo , Sasha Levin , Baoquan He , Alexander Egorenkov , "open list:S390" , Catalin Marinas , Will Deacon , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "H. Peter Anvin" , Eric Biederman , Mimi Zohar , "Naveen N. Rao" , Andrew Morton , "moderated list:ARM64 PORT (AARCH64 ARCHITECTURE)" , "open list:LINUX FOR POWERPC (32-BIT AND 64-BIT)" , "open list:KEXEC" , Coiby Xu , keyrings@vger.kernel.org, linux-security-module@vger.kernel.org, James Morse Subject: Re: [PATCH 5.15 0/6] arm64: kexec_file: use more system keyrings to verify kernel image signature + dependencies Message-ID: <20220927023952.GB34139@laputa> Mail-Followup-To: AKASHI Takahiro , Michal Such??nek , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Alexander Gordeev , Sven Schnelle , Philipp Rudo , Sasha Levin , Baoquan He , Alexander Egorenkov , "open list:S390" , Catalin Marinas , Will Deacon , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "H. Peter Anvin" , Eric Biederman , Mimi Zohar , "Naveen N. Rao" , Andrew Morton , "moderated list:ARM64 PORT (AARCH64 ARCHITECTURE)" , "open list:LINUX FOR POWERPC (32-BIT AND 64-BIT)" , "open list:KEXEC" , Coiby Xu , keyrings@vger.kernel.org, linux-security-module@vger.kernel.org, James Morse References: <20220924094521.GY28810@kitsune.suse.cz> <20220924115523.GZ28810@kitsune.suse.cz> <20220926074024.GD28810@kitsune.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220926074024.GD28810@kitsune.suse.cz> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 On Mon, Sep 26, 2022 at 09:40:25AM +0200, Michal Such??nek wrote: > On Mon, Sep 26, 2022 at 08:47:32AM +0200, Greg Kroah-Hartman wrote: > > On Sat, Sep 24, 2022 at 01:55:23PM +0200, Michal Suchánek wrote: > > > On Sat, Sep 24, 2022 at 12:13:34PM +0200, Greg Kroah-Hartman wrote: > > > > On Sat, Sep 24, 2022 at 11:45:21AM +0200, Michal Suchánek wrote: > > > > > On Sat, Sep 24, 2022 at 11:19:19AM +0200, Greg Kroah-Hartman wrote: > > > > > > On Fri, Sep 23, 2022 at 07:10:28PM +0200, Michal Suchanek wrote: > > > > > > > Hello, > > > > > > > > > > > > > > this is backport of commit 0d519cadf751 > > > > > > > ("arm64: kexec_file: use more system keyrings to verify kernel image signature") > > > > > > > to table 5.15 tree including the preparatory patches. > > > > > > > > > > > > This feels to me like a new feature for arm64, one that has never worked > > > > > > before and you are just making it feature-parity with x86, right? > > > > > > > > > > > > Or is this a regression fix somewhere? Why is this needed in 5.15.y and > > > > > > why can't people who need this new feature just use a newer kernel > > > > > > version (5.19?) > > > > > > > > > > It's half-broken implementation of the kexec kernel verification. At the time > > > > > it was implemented for arm64 we had the platform and secondary keyrings > > > > > and x86 was using them but on arm64 the initial implementation ignores > > > > > them. > > > > > > > > Ok, so it's something that never worked. Adding support to get it to > > > > work doesn't really fall into the stable kernel rules, right? > > > > > > Not sure. It was defective, not using the facilities available at the > > > time correctly. Which translates to kernels that can be kexec'd on x86 > > > failing to kexec on arm64 without any explanation (signed with same key, > > > built for the appropriate arch). > > > > Feature parity across architectures is not a "regression", but rather a > > "this feature is not implemented for this architecture yet" type of > > thing. > > That depends on the view - before kexec verification you could boot any > kernel, now you can boot some kernels signed with a valid key, but not > others - the initial implementation is buggy, probably because it > is based on an old version of the x86 code. Buggy? The feature of supporting platform ring had been slipped in just before I submitted the latest patch series which was eventually merged. (I should have noticed it though.) Looking at changes in the commit 278311e417be ("kexec, KEYS: Make use of platform keyring for signature verify"), it seems to be obvious that it is a new feature because it introduced a new Kconfig option, CONFIG_INTEGRITY_PLATFORM_KEYRING, which allows for enabling/disabling platform ring support. -Takahiro Akashi > > > > > > Again, what's wrong with 5.19 for anyone who wants this? Who does want > > > > this? > > > > > > Not sure, really. > > > > > > The final patch was repeatedly backported to stable and failed to build > > > because the prerequisites were missing. > > > > That's because it was tagged, but now that you show the full set of > > requirements, it's pretty obvious to me that this is not relevant for > > going this far back. > > That also works. > > Thanks > > Michal