This push contains the following changes:

- Fix lockdep warning regression in rhashtable.
 - Fix default authsize in rfc4309.
 - Fix gcm cryptlen calculation in tegra.
 - Fix qce registration error-path bug.
 - Fix incorrect use of sg_dma_len before mapping in starfive.
 - Allow cbc(paes) to be used with af_alg.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEn51F/lCuNhUwmDeSxycdCkmxi6cFAmpsT0oACgkQxycdCkmx
 i6daNA/+J02CNtbzTpBDOJX/mwY6W3QZFqslzoaywgterDAC72o3tkg9/bEtqbih
 2y1UDh5RTzGoMdoB2BV9Fw8TbwSEFgzNIY7IBzvSxLu0Fu1CWvJmiJkFpY9waVBq
 mj4iCe2U1i3QFXXBd61GDoS1WGMt2exm2QWSxn9tiADwz76w13+84mEH5i+1cn5S
 Ufyz4312hZaeNBYsON2bQ4xeuMbZuxcyE+eIZQ849G2CvjMVbgrE+wNN77n2a6wo
 UI+XHkT/XpiTCYkbFA5ATTWKn/fyEnGQ0IofqdGdj+75Ch1wrswXwb697WzMQwf5
 VrxgWIFhHgzpUjJFlZNx6yd1zs978dyjw3VonILuBKUeris3yQhoYGQ1r89dshrD
 2oL8SFjHR5iSjqtowthO02kWwl9w6U4LnNGNBsXyRz5aYJJtG9ctxchqcIZe8kA5
 YQ2UnQHIfGAYIlSCcpijBGUGXCPJiDXo5ovt7PcNgtkB+/tedPhCWrznRio2ECD3
 Ebi8d48fp3cx9eS5t4C91YP+wG9T7mEgICec6H9xMLhu3MPh0oyP/i2A1e64QPv8
 VVzPbsJMvJRU5wa0/+FkJ922WLp9OkHfcGU8FUx49/zjkskMAhjTcuIEwlqOm7TI
 tsa9AlM6PrNT122WauCvnxDQ4PglsKeuYnAEhqrsbmfpJumd9kM=
 =rHls
 -----END PGP SIGNATURE-----

Merge tag 'v7.2-p3' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6

Pull crypto fixes from Herbert Xu:

 - Fix lockdep warning regression in rhashtable

 - Fix default authsize in rfc4309

 - Fix gcm cryptlen calculation in tegra

 - Fix qce registration error-path bug

 - Fix incorrect use of sg_dma_len before mapping in starfive

 - Allow cbc(paes) to be used with af_alg

* tag 'v7.2-p3' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: af_alg - Allow cbc(paes)
  crypto: starfive - use scatterlist length before DMA mapping
  crypto: qce - fix error path in devm_qce_register_algs
  rhashtable: fix false-positive lockdep splat on rhltable destruction
  crypto: tegra - fix rctx->cryptlen calculation in tegra_gcm_do_one_req()
  crypto: ccm - Set rfc4309 maxauthsize from child
This commit is contained in:
Linus Torvalds 2026-08-10 08:36:22 -07:00
commit 5eabf07a0b
6 changed files with 14 additions and 24 deletions

View File

@ -32,6 +32,7 @@
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/net.h>
#include <linux/string.h>
#include <net/sock.h>
static int skcipher_sendmsg(struct socket *sock, struct msghdr *msg,
@ -309,7 +310,12 @@ static struct proto_ops algif_skcipher_ops_nokey = {
static void *skcipher_bind(const char *name)
{
return crypto_alloc_skcipher(name, 0, AF_ALG_CRYPTOAPI_MASK);
u32 mask = AF_ALG_CRYPTOAPI_MASK;
if (strcmp(name, "cbc(paes)") == 0)
mask = 0;
return crypto_alloc_skcipher(name, 0, mask);
}
static void skcipher_release(void *private)

View File

@ -747,7 +747,7 @@ static int crypto_rfc4309_create(struct crypto_template *tmpl,
inst->alg.ivsize = 8;
inst->alg.chunksize = crypto_aead_alg_chunksize(alg);
inst->alg.maxauthsize = 16;
inst->alg.maxauthsize = crypto_aead_alg_maxauthsize(alg);
inst->alg.base.cra_ctxsize = sizeof(struct crypto_rfc4309_ctx);

View File

@ -58,7 +58,7 @@ static int devm_qce_register_algs(struct qce_device *qce)
ret = ops->register_algs(qce);
if (ret) {
for (j = i - 1; j >= 0; j--)
ops->unregister_algs(qce);
qce_ops[j]->unregister_algs(qce);
return ret;
}
}

View File

@ -677,7 +677,7 @@ static int starfive_aes_aead_do_one_req(struct crypto_engine *engine, void *areq
if (cryp->total_in)
sg_zero_buffer(rctx->in_sg, sg_nents(rctx->in_sg),
sg_dma_len(rctx->in_sg) - cryp->total_in,
rctx->in_sg->length - cryp->total_in,
cryp->total_in);
ctx->rctx = rctx;

View File

@ -45,7 +45,6 @@ struct tegra_aes_reqctx {
struct tegra_aead_ctx {
struct tegra_se *se;
unsigned int authsize;
u32 alg;
u32 key_id;
u32 keylen;
@ -1290,7 +1289,7 @@ static int tegra_gcm_do_one_req(struct crypto_engine *engine, void *areq)
if (rctx->encrypt)
rctx->cryptlen = req->cryptlen;
else
rctx->cryptlen = req->cryptlen - ctx->authsize;
rctx->cryptlen = req->cryptlen - rctx->authsize;
memcpy(rctx->iv, req->iv, GCM_AES_IV_SIZE);
rctx->iv[3] = (1 << 24);
@ -1394,8 +1393,6 @@ static int tegra_aead_cra_init(struct crypto_aead *tfm)
static int tegra_ccm_setauthsize(struct crypto_aead *tfm, unsigned int authsize)
{
struct tegra_aead_ctx *ctx = crypto_aead_ctx(tfm);
switch (authsize) {
case 4:
case 6:
@ -1404,28 +1401,15 @@ static int tegra_ccm_setauthsize(struct crypto_aead *tfm, unsigned int authsize
case 12:
case 14:
case 16:
break;
return 0;
default:
return -EINVAL;
}
ctx->authsize = authsize;
return 0;
}
static int tegra_gcm_setauthsize(struct crypto_aead *tfm, unsigned int authsize)
{
struct tegra_aead_ctx *ctx = crypto_aead_ctx(tfm);
int ret;
ret = crypto_gcm_check_authsize(authsize);
if (ret)
return ret;
ctx->authsize = authsize;
return 0;
return crypto_gcm_check_authsize(authsize);
}
static void tegra_aead_cra_exit(struct crypto_aead *tfm)

View File

@ -1261,7 +1261,7 @@ static void rhashtable_free_one(struct rhashtable *ht, struct rhash_head *obj,
list = container_of(obj, struct rhlist_head, rhead);
do {
obj = &list->rhead;
list = rht_dereference(list->next, ht);
list = rcu_dereference_raw(list->next);
free_fn(rht_obj(ht, obj), arg);
} while (list);
}