Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp1634532rwe; Sat, 15 Apr 2023 03:13:58 -0700 (PDT) X-Google-Smtp-Source: AKy350YECf/ge+Mn7RX+mzaazPa12kCtOx2Ofce2AYh/tN4yDTnn3pWsjmdBdE0tKCt2+g655gRr X-Received: by 2002:a05:6a20:2448:b0:e3:6fdb:f6c6 with SMTP id t8-20020a056a20244800b000e36fdbf6c6mr7355893pzc.6.1681553638452; Sat, 15 Apr 2023 03:13:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681553638; cv=none; d=google.com; s=arc-20160816; b=b/KMDqk9v4RI5f3zH/cvysnWWnKUqUtGGMQWd+pjRw4zcFEdvgTJn9CF5l8Ey9Va1Y HAMfNVEcPJqNvyKVeRGabfpkKvZW0bU0lWulgiERJmHd9AVcWtpvwHsgDjY4nUI3Te+P vtE9BfXYga0UveNMh67ENwjUHfoVKJ8g7f+6qDC0M2yBdU5n6Ina/PPZp53zCx9iyTi3 jCLEHKYRApeKXmQpTYXAfODB3Zpd/UYDso2tagpcgDVXxjlAc+0y8sWvFA1shNxpCSEE QAvVM7qKDXwP5gtrImNA277YIJ/T7pCmVHEvOXOcnd90AP+v9WkiWNDDe3ehCro30YQu e0+Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=XjzPL4pVr9DXNAauIzFLMgKXm2Q0BIJYAV4PQoDzOBk=; b=qowchP6Z4Towa98FIU9P0GpU3mxJMAQMS1/Qflc7zq9d9i6U/+EvrgXof0YdtfEsxq JZKMmF1e5BPgEPFzcYSWjgX8bpUmW+XBnzQRBqGwnnHo7QSq0EIE6cU4iv/D6QyJDUEr AFznR0PxpCqA6jTewj1hL1Rxa2yf5l8RWdoqkY7a7mlXDpIq6Y2TsCR9gQx13CQm/5y9 fcrZr8MKVFdJaYhWjAH4+s+4gPeKX1ZndKKYwjpMakVEBcY3WKWb4WGVj2y/G2aCs6MP G7dYP3cfgHHiX/kXpMQF36rjJPSEQxINyuYrds4qEgeBIYlO6IQe0cVbjSeRXsNuKSZp JCzg== 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f12-20020a63f74c000000b005197bd3c17csi6918597pgk.544.2023.04.15.03.13.44; Sat, 15 Apr 2023 03:13:58 -0700 (PDT) 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229772AbjDOKMG (ORCPT + 99 others); Sat, 15 Apr 2023 06:12:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229760AbjDOKMD (ORCPT ); Sat, 15 Apr 2023 06:12:03 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10307358C; Sat, 15 Apr 2023 03:12:02 -0700 (PDT) Received: from kwepemi500012.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Pz8CV3xsRz17SYK; Sat, 15 Apr 2023 18:08:22 +0800 (CST) Received: from cgs.huawei.com (10.244.148.83) by kwepemi500012.china.huawei.com (7.221.188.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Sat, 15 Apr 2023 18:12:00 +0800 From: Gaosheng Cui To: , CC: , , , Subject: [PATCH 5.10 4/4] crypto: api - Fix boot-up crash when crypto manager is disabled Date: Sat, 15 Apr 2023 18:11:58 +0800 Message-ID: <20230415101158.1648486-5-cuigaosheng1@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230415101158.1648486-1-cuigaosheng1@huawei.com> References: <20230415101158.1648486-1-cuigaosheng1@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.244.148.83] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemi500012.china.huawei.com (7.221.188.12) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,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-crypto@vger.kernel.org From: Herbert Xu When the crypto manager is disabled, we need to explicitly set the crypto algorithms' tested status so that they can be used. Fixes: cad439fc040e ("crypto: api - Do not create test larvals if...") Reported-by: Geert Uytterhoeven Reported-by: Ido Schimmel Reported-by: Guenter Roeck Signed-off-by: Herbert Xu Tested-by: Ido Schimmel Tested-by: Geert Uytterhoeven Signed-off-by: Gaosheng Cui --- crypto/algapi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crypto/algapi.c b/crypto/algapi.c index f6481cb79946..0d0c3e937e36 100644 --- a/crypto/algapi.c +++ b/crypto/algapi.c @@ -284,6 +284,8 @@ static struct crypto_larval *__crypto_register_alg(struct crypto_alg *alg) if (larval) list_add(&larval->alg.cra_list, &crypto_alg_list); + else + alg->cra_flags |= CRYPTO_ALG_TESTED; crypto_stats_init(alg); -- 2.25.1