[PATCH] crypto: arm64/aes-neonbs: transition to kmalloc_obj()

From: Manuel Ebner

Date: Sun Aug 30 2026 - 06:25:15 EST


Convert to type aware allocation as suggested in commit 2932ba8d9c99
("slab: Introduce kmalloc_obj() and family")

CC: Kees Cook <kees@xxxxxxxxxx>
Fixes: 652a3017c485 ("crypto: arm64/aes-neonbs - Move key expansion off the stack")
Signed-off-by: Manuel Ebner <manuelebnerli@xxxxxxxxxxx>
---
I have a couple similar patches lined up but they could be automated or maybe
the script is already made by Kees.
Kees can you make a script assisted commit (again)?
---
arch/arm64/crypto/aes-neonbs-glue.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/crypto/aes-neonbs-glue.c b/arch/arm64/crypto/aes-neonbs-glue.c
index 5bcbac979..7cb1aede9 100644
--- a/arch/arm64/crypto/aes-neonbs-glue.c
+++ b/arch/arm64/crypto/aes-neonbs-glue.c
@@ -66,7 +66,7 @@ static int aesbs_setkey(struct crypto_skcipher *tfm, const u8 *in_key,
struct crypto_aes_ctx *rk;
int err;

- rk = kmalloc(sizeof(*rk), GFP_KERNEL);
+ rk = kmalloc_obj(*rk);
if (!rk)
return -ENOMEM;

@@ -128,7 +128,7 @@ static int aesbs_cbc_ctr_setkey(struct crypto_skcipher *tfm, const u8 *in_key,
struct crypto_aes_ctx *rk;
int err;

- rk = kmalloc(sizeof(*rk), GFP_KERNEL);
+ rk = kmalloc_obj(*rk);
if (!rk)
return -ENOMEM;

--
2.54.0