Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1715369rdb; Mon, 2 Oct 2023 20:44:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE7ow8rD3toag2IttGF2DPaWA+bh272vdYqPjcP1gS6yYzIJwAQaSYvJpmd3fklct79udDU X-Received: by 2002:a17:90b:4b4b:b0:271:78a0:8ab2 with SMTP id mi11-20020a17090b4b4b00b0027178a08ab2mr2134545pjb.24.1696304684637; Mon, 02 Oct 2023 20:44:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696304684; cv=none; d=google.com; s=arc-20160816; b=Kys9cy03EWccXOXgpvnfKTabld4thIm60Vb7ABZvwI2qSmkV1js/lXhZ0Mcw8JG0q4 qIwbAsSBSZ3poQuB9pNvwEZQLHGJOOTSkx1U9TwYw9uv37Vmf13otaBfogaPv7VEz0HV S93fyUEcKR0P1vL60K8nC9ov8XjQ+QPvvTMarJyvfK6bUsRKYu3vEp4dFToiO7nAU2+4 JYT0v/039kP17/BcaYilfcGw+zwY8L+kO94Qn7BjoC/o25g1GxTYmowr5aJ16yah2zrQ vJHPhnb8NDuKWxiRoQ9Nb7t0EuXezwJaoxwUyzqaKZYdahDPRMVV6FYHoblkRBNTuHZv Q7Rg== 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=d8Zw/TgKRikiM8WzlsdwpHaSh3lV0scqdGsrjdeagKE=; fh=l82EBe4859Giv8r8zr9oFIexxRwnYkkBFWiaDDuu954=; b=KXmc76M4FgyiFldX79XCWUE7b4P7L67lOIbMpbdPKZa2PgDCzlkt6G4Y+RllN5sIdB AUKt5hikvC1V+pCMevHNI1edvaZB8cf9u1kcwCIfpwjBZdijFn9SrvwV9n8an2fpu6Fj 1Mdfd79YiGKhxocS8LtZSp3R3QAXPJ+C7wIdxwcalOPqQcWlurx+SCQhuvLrPOKGbmxQ a0VFdlk+GgdOkTtftDPtiJg8CeVi5hlReQQTK+dALLtheFRb5ir4YUT8ZwO7dvtfXBHU o+0FGFunzaNd/DlTIVuV2VS+nk3UYpc/8nbrKouPjHiPf+N6In6GcdceUG36UuW8K49J KWpA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id y37-20020a634965000000b00564b99f128dsi516419pgk.656.2023.10.02.20.44.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 20:44:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id AB5AC80C4D6F; Mon, 2 Oct 2023 20:44:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230093AbjJCDoo (ORCPT + 99 others); Mon, 2 Oct 2023 23:44:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230103AbjJCDom (ORCPT ); Mon, 2 Oct 2023 23:44:42 -0400 Received: from abb.hmeau.com (abb.hmeau.com [144.6.53.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17237B7 for ; Mon, 2 Oct 2023 20:44:40 -0700 (PDT) Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1qnWKp-002wQq-4N; Tue, 03 Oct 2023 11:44:36 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Tue, 03 Oct 2023 11:44:39 +0800 From: Herbert Xu To: Linux Crypto Mailing List Cc: Shinichiro Kawasaki , Herbert Xu Subject: [PATCH 04/16] crypto: cryptd - Only access common skcipher fields on spawn Date: Tue, 3 Oct 2023 11:43:21 +0800 Message-Id: <20231003034333.1441826-5-herbert@gondor.apana.org.au> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231003034333.1441826-1-herbert@gondor.apana.org.au> References: <20231003034333.1441826-1-herbert@gondor.apana.org.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 02 Oct 2023 20:44:43 -0700 (PDT) As skcipher spawns may be of the type lskcipher, only the common fields may be accessed. This was already the case but use the correct helpers to make this more obvious. Signed-off-by: Herbert Xu --- crypto/cryptd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crypto/cryptd.c b/crypto/cryptd.c index 194a92d677b9..31d022d47f7a 100644 --- a/crypto/cryptd.c +++ b/crypto/cryptd.c @@ -377,7 +377,7 @@ static int cryptd_create_skcipher(struct crypto_template *tmpl, { struct skcipherd_instance_ctx *ctx; struct skcipher_instance *inst; - struct skcipher_alg *alg; + struct skcipher_alg_common *alg; u32 type; u32 mask; int err; @@ -396,17 +396,17 @@ static int cryptd_create_skcipher(struct crypto_template *tmpl, if (err) goto err_free_inst; - alg = crypto_spawn_skcipher_alg(&ctx->spawn); + alg = crypto_spawn_skcipher_alg_common(&ctx->spawn); err = cryptd_init_instance(skcipher_crypto_instance(inst), &alg->base); if (err) goto err_free_inst; inst->alg.base.cra_flags |= CRYPTO_ALG_ASYNC | (alg->base.cra_flags & CRYPTO_ALG_INTERNAL); - inst->alg.ivsize = crypto_skcipher_alg_ivsize(alg); - inst->alg.chunksize = crypto_skcipher_alg_chunksize(alg); - inst->alg.min_keysize = crypto_skcipher_alg_min_keysize(alg); - inst->alg.max_keysize = crypto_skcipher_alg_max_keysize(alg); + inst->alg.ivsize = alg->ivsize; + inst->alg.chunksize = alg->chunksize; + inst->alg.min_keysize = alg->min_keysize; + inst->alg.max_keysize = alg->max_keysize; inst->alg.base.cra_ctxsize = sizeof(struct cryptd_skcipher_ctx); -- 2.39.2