From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9689AC433DF for ; Tue, 13 Oct 2020 17:01:25 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A564E25308 for ; Tue, 13 Oct 2020 17:01:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="BVgO/RpF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A564E25308 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4C9hds5cMzzDqZ3 for ; Wed, 14 Oct 2020 04:01:21 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=198.145.29.99; helo=mail.kernel.org; envelope-from=ardb@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=default header.b=BVgO/RpF; dkim-atps=neutral Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (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 4C9hbr6M9DzDqSk for ; Wed, 14 Oct 2020 03:59:36 +1100 (AEDT) Received: from mail-oi1-f175.google.com (mail-oi1-f175.google.com [209.85.167.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7013625309 for ; Tue, 13 Oct 2020 16:59:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602608373; bh=osZ8tJsN1XJAdwSi1ibvFjOI4ppbEHzl507BtoRa3RY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=BVgO/RpFUbXU0rUhiHQ4PV7seCBjZCA5VZpjLt9fb7pnoZxE7/J2v8gFkpMq7al/x NMjFN0+OeJ/sVOOsN2LLPY3YNMD8GoZ5ncaUEdxxceVdpuik78E54GRrZLBAYex/Fk VhTmOSSHk5b6rOkFbDuFk7NR3TEllYJasaYjeEQ4= Received: by mail-oi1-f175.google.com with SMTP id h10so112334oie.5 for ; Tue, 13 Oct 2020 09:59:33 -0700 (PDT) X-Gm-Message-State: AOAM530tTOJcKFr87dlfDRWhLQEkQMRQ6Ll/8SM4yZNqkam4/DYjSDzB veeMgynRKSmJ5sPbZCG1IfIktTaYyameQ8jRYP4= X-Google-Smtp-Source: ABdhPJyCyAZiLNWtZEpxTAWgjVYup7xXC2n8Dw2lOiZtXYQDhs3t2O/klyNtVYYJ8v1GO87o7QPqDtWtI4WZYBPYbfs= X-Received: by 2002:aca:d845:: with SMTP id p66mr382549oig.47.1602608372672; Tue, 13 Oct 2020 09:59:32 -0700 (PDT) MIME-Version: 1.0 References: <20201013081804.17332-1-ardb@kernel.org> In-Reply-To: From: Ard Biesheuvel Date: Tue, 13 Oct 2020 18:59:21 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] ima: defer arch_ima_get_secureboot() call to IMA init time To: Mimi Zohar Content-Type: text/plain; charset="UTF-8" X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-efi , Dmitry Kasatkin , James Morris , Chester Lin , linux-security-module@vger.kernel.org, linux-integrity , "open list:LINUX FOR POWERPC \(32-BIT AND 64-BIT\)" , "Serge E. Hallyn" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Tue, 13 Oct 2020 at 18:46, Mimi Zohar wrote: > > [Cc'ing linuxppc-dev@lists.ozlabs.org] > > On Tue, 2020-10-13 at 10:18 +0200, Ard Biesheuvel wrote: > > Chester reports that it is necessary to introduce a new way to pass > > the EFI secure boot status between the EFI stub and the core kernel > > on ARM systems. The usual way of obtaining this information is by > > checking the SecureBoot and SetupMode EFI variables, but this can > > only be done after the EFI variable workqueue is created, which > > occurs in a subsys_initcall(), whereas arch_ima_get_secureboot() > > is called much earlier by the IMA framework. > > > > However, the IMA framework itself is started as a late_initcall, > > and the only reason the call to arch_ima_get_secureboot() occurs > > so early is because it happens in the context of a __setup() > > callback that parses the ima_appraise= command line parameter. > > > > So let's refactor this code a little bit, by using a core_param() > > callback to capture the command line argument, and deferring any > > reasoning based on its contents to the IMA init routine. > > > > Cc: Chester Lin > > Cc: Mimi Zohar > > Cc: Dmitry Kasatkin > > Cc: James Morris > > Cc: "Serge E. Hallyn" > > Link: https://lore.kernel.org/linux-arm-kernel/20200904072905.25332-2-clin@suse.com/ > > Signed-off-by: Ard Biesheuvel > > --- > > v2: rebase onto series 'integrity: improve user feedback for invalid bootparams' > > Thanks, Ard. Based on my initial, limited testing on Power, it looks > good, but I'm hesistant to include it in the integrity 5.10 pull > request without it having been in linux-next and some additional > testing. It's now queued in the next-integrity-testing branch awaiting > some tags. > Thanks. No rush as far as I am concerned, although I suppose Chester may want to rebase his arm64 IMA enablement series on this. Suggestion: can we take the get_sb_mode() code from ima_arch.c in arch/x86, and generalize it for all EFI architectures? That way, we can enable 32-bit ARM and RISC-V seamlessly once someone gets around to enabling IMA on those platforms. In fact, get_sb_mode() itself should probably be factored out into a generic helper for use outside of IMA as well (Xen/x86 has code that does roughly the same already)