Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1336138rwb; Sun, 6 Nov 2022 23:54:53 -0800 (PST) X-Google-Smtp-Source: AMsMyM5CWxJYamOqnA9hF8a483BhrHWsD/j4ebbIk1eKAyUAK8iQ96WS1WGQ9PKAo9Xcysq82625 X-Received: by 2002:a05:6402:4511:b0:45c:b2b4:3e69 with SMTP id ez17-20020a056402451100b0045cb2b43e69mr48959228edb.339.1667807693150; Sun, 06 Nov 2022 23:54:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667807693; cv=none; d=google.com; s=arc-20160816; b=ALwW10v7Z68t95NozGJG4GYwubyGFXhZPvDuZdfRD0Jqa6dFErdjJgEt/S+UacbaU5 O16iVG6sMz19DGeY7qTRQAIPbhrqpGGPPhDkON9rnjEV5zqKN0XoLLLNU4l9TU4Qr98I aULY08A7RI1a8rQb2Ee4D3CR4USP3MQF3w+CUmGXpWhyQ/b+8Uc71jclDzDfSHA2WTBN +Z8VlGJNnL8Oq4Wy3seCl1BhnySF4UHzXfn26if3zs1OXC4HO/+gCcv2YYZ116MXl8wj WFUdhsaTK1AWHzmdwVlJCQZs+79O+YbfxqsyYaPvT2CnmHXxQByhqLMiXM7wjSCYzSr7 I6RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date; bh=wXbTGMTozj+pemauUhx9Gy3i0dPOl0TDifIhlKqsz4Q=; b=F/gNwZKzm1LGN7IWw80ihuYLQ4A+VKfJt3Uc6SSPGZNTgxQfWLMEQaDyUgwktPigyb J4hPRjLyyHJ5MFULTQ6RWqD/5L/GObMou7EejIgTUkk3IkS/dnOKYVJFOh897aLL7NJM amcKNcsUGpGy7/qJITNRF7nFCAi23EBnyk7oWP9oSGxGU1apW+r6aeVKaeX30vueHec9 q6lku5uQdzSrWj7WkpJ8rvbd0hh5+Vx3hdP+zzxISIUd51LF87Rtla+ExG+u5KjpkuIy qZruY7ri/hNVccKbq+rlyuPNTo9Jpl7HCF0VrI56woxVK2m0pNonOLAda9+lXOp2PXIo 3YjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wy8-20020a170906fe0800b0073d5f9aa5e9si8295762ejb.327.2022.11.06.23.54.24; Sun, 06 Nov 2022 23:54:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-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; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231149AbiKGHpG (ORCPT + 99 others); Mon, 7 Nov 2022 02:45:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231460AbiKGHpF (ORCPT ); Mon, 7 Nov 2022 02:45:05 -0500 Received: from mail.steuer-voss.de (mail.steuer-voss.de [85.183.69.95]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AF49120BB; Sun, 6 Nov 2022 23:45:00 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at mail.steuer-voss.de Received: by mail.steuer-voss.de (Postfix, from userid 1000) id 16C5416C1; Mon, 7 Nov 2022 08:44:55 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail.steuer-voss.de (Postfix) with ESMTP id 141F4ADA; Mon, 7 Nov 2022 08:44:55 +0100 (CET) Date: Mon, 7 Nov 2022 08:44:55 +0100 (CET) From: Nikolaus Voss To: Herbert Xu cc: =?ISO-8859-2?Q?Horia_Geant=E3?= , Pankaj Gupta , Gaurav Jain , "David S. Miller" , Ahmad Fatoum , David Gstir , Steffen Trumtrar , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Jarkko Sakkinen Subject: Re: [PATCH] crypto: caam: blob_gen.c: warn if key is insecure In-Reply-To: Message-ID: References: <20221019134706.E52E71D10@mail.steuer-voss.de> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE 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-crypto@vger.kernel.org On Fri, 4 Nov 2022, Herbert Xu wrote: > On Wed, Oct 19, 2022 at 02:44:56PM +0200, Nikolaus Voss wrote: >> >> @@ -62,11 +63,13 @@ int caam_process_blob(struct caam_blob_priv *priv, >> struct caam_blob_info *info, bool encap) >> { >> struct caam_blob_job_result testres; >> + const struct caam_drv_private *ctrlpriv; > > Please keep the declarations sorted by length in reverse. ok! > >> @@ -100,6 +103,11 @@ int caam_process_blob(struct caam_blob_priv *priv, >> goto out_unmap_in; >> } >> >> + ctrlpriv = dev_get_drvdata(jrdev->parent); >> + moo = FIELD_GET(CSTA_MOO, ctrlpriv->ctrl->perfmon.status); >> + if (moo != CSTA_MOO_SECURE && moo != CSTA_MOO_TRUSTED) >> + dev_warn(jrdev, "using insecure test key!\n"); > > Who is the audience of this warning? Is it possible for this warning > to be too frequent? The warning is issued every time the non-volatile hardware test key is used to seal/unseal data. This way, the association to the operation is strong and is less likely to be ignored by mistake. Further, the system security monitor can transition to a non-secure state any time, so one warning during boot-up doesn't suffice. IMO, on a typical system, the warning occurs with very low frequency, only a few times during e.g. authenication or mounting of encrypted volumes. The audience is the developer who forgets to enable secure boot (HAB) or even doesn't know she has to enable HAB to employ the device's unique hardware key instead of the test key. Niko