Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2765932pxb; Thu, 3 Feb 2022 13:56:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwIbgSURCLQa3B/JZZCwUMQv0QBDvcPldGLDIhv1BVJAnrKaqxsuaWeveIhWTCde/veQgce X-Received: by 2002:a05:6a00:1594:: with SMTP id u20mr64054pfk.75.1643925410044; Thu, 03 Feb 2022 13:56:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643925410; cv=none; d=google.com; s=arc-20160816; b=jjlkjdUq9EVIWKXtMHcE1HcdWjYc3GRRLrTUBhicdUjWGMSS34LY0EzlvxXLcjHeSH pTvGITR59ZAFc8iCNgLljb5TLVBkjfMKmA5XlLzj/iGe5eTcRjZfyOeR5XfnKmzItZLo pbOOet1lJnHCpNjpab6oqp8ILZfXKh+/EDU59EFX/jbmRqcByJgqO7Ei07QS0dTSsBxB a8MjbXkeOUpNe0km3poicBwfkTZWPPCR61qJTmn+Win5NFeRhJxkj3/Cq1jC0TSrXp1I OxcuxLe7GOzjwV2aWQXutRHDFT4TpMq7Z0Tu6pTc8k2jHQtA/+6yhC9JS9OOViUg6xoh 00mg== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1GA7e6azQ71Q/Pk7PvNK6H2CwoTwPPyoDKVlcVN5cKI=; b=MWdFfD4nPgLkiJY6uBrLsrnsviput/dGgKB7lr7qhCrYzIe6zWowev6033/omGeEb5 lnnIIQ01DlmxWOZXH+x3N1AWMd69vdyg7vtehQn9IIbl6q2e3jQqO4o+1/cMJtBSCcBp Gj5rZ/wP6nu9F4LH0lA7iodgiozwa6klHbA93SqwDugwks7WlV9GCT3wlp0UrKx/k0nE 0ADenapUJsjlYfEYbzE3CFDiYdQbAvbwaniTm65oLbW+rVDtbipzGWXbIAuzr7dpN+wc pmU8HUeucrj6dWscpXT04OE94SPaNPwEkwwEk4vtryMfCUjVMwMk42l7OmOPggQN4SGa NiNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="gkqLq/GT"; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 11si43228pgx.754.2022.02.03.13.56.38; Thu, 03 Feb 2022 13:56:50 -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=@redhat.com header.s=mimecast20190719 header.b="gkqLq/GT"; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348667AbiBCMLe (ORCPT + 99 others); Thu, 3 Feb 2022 07:11:34 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:46315 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346392AbiBCMLb (ORCPT ); Thu, 3 Feb 2022 07:11:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643890290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=1GA7e6azQ71Q/Pk7PvNK6H2CwoTwPPyoDKVlcVN5cKI=; b=gkqLq/GTYg6BwfSm+5WurRNZXa6jNeKP9BdN4K/GawHZgUZL8ikfXnTOdmyv1Zge6zI7jb GnRy3AGd1VZUTCa59AJUvnbgbjxJxX3KR+kW75bSE5qj0U3MAaB+sZ9fp3O948dAkCS5hm U6Iq9pglNeonwtlkdmgsOaG6DyZcthk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-449-n9p20QooOgCo9jBaiAHZ_w-1; Thu, 03 Feb 2022 07:11:26 -0500 X-MC-Unique: n9p20QooOgCo9jBaiAHZ_w-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 049A02F44; Thu, 3 Feb 2022 12:11:23 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.193.47]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F35456F16B; Thu, 3 Feb 2022 12:11:18 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 620E518000B2; Thu, 3 Feb 2022 13:11:17 +0100 (CET) Date: Thu, 3 Feb 2022 13:11:17 +0100 From: Gerd Hoffmann To: Dov Murik Cc: linux-efi@vger.kernel.org, Borislav Petkov , Ashish Kalra , Brijesh Singh , Tom Lendacky , Ard Biesheuvel , James Morris , "Serge E. Hallyn" , Andi Kleen , Greg KH , Andrew Scull , Dave Hansen , "Dr. David Alan Gilbert" , Lenny Szubowicz , Peter Gonda , James Bottomley , Tobin Feldman-Fitzthum , Jim Cadden , Daniele Buono , linux-coco@lists.linux.dev, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v7 4/5] efi: Load efi_secret module if EFI secret area is populated Message-ID: <20220203121117.aedtaxspnm5mbqhj@sirius.home.kraxel.org> References: <20220201124413.1093099-1-dovmurik@linux.ibm.com> <20220201124413.1093099-5-dovmurik@linux.ibm.com> <20220202084723.ushasiekb3cxami4@sirius.home.kraxel.org> <20220202143128.jgadmr7tzetlobt7@sirius.home.kraxel.org> <20220203061615.wwembqmmpmg77iyj@sirius.home.kraxel.org> <815ba487-a6c1-0daa-aead-a7f3a52df2a1@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <815ba487-a6c1-0daa-aead-a7f3a52df2a1@linux.ibm.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, > >> If we keep only the 'efi.coco_secret != EFI_INVALID_TABLE_ADDR' check, > >> we'll get errors from efi_secret for every VM launch that doesn't > >> undergo LAUNCH_SECRET. I don't think that's good. > > > > Well, if that is a common case the module could either print nothing or > > log KERN_INFO level instead of KERN_ERROR. > > What if the user doesn't inject a secret and doesn't include the > efi_secret module at all in the initrd? request_module("efi_secret") > will fail. > > I can ignore the error code of request_module("efi_secret") but that > feels bad. Looking at the error code returned by request_module should help to figure what happened (module load failed / no secret present / something else). But, yes, module load errors are harmless in case there is no secret present in the first place. Hmm, tricky. I don't see a way to solve that without duplicating the checks. I withdraw my objections. Reviewed-by: Gerd Hoffmann take care, Gerd