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

Manuel Ebner manuelebnerli at mailbox.org
Thu Sep 3 00:36:02 PDT 2026


On Wed, 2026-09-02 at 13:17 -0700, Kees Cook wrote:
> On Sun, Aug 30, 2026 at 12:17:14PM +0200, Manuel Ebner wrote:
> > 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)?
> 
> This lead me down quite a long path to try to figure out why the existing
> Coccinelle script (scripts/coccinelle/api/kmalloc_objs.cocci) didn't
> catch these. The answer is the cleanup.h macros and poor interaction
> with Coccinelle. I think I've got a work-around built now, and I'll send
> a new tree-wide change to Linus before -rc2 gets cut.
> 
> Thanks for noticing these got missed!

I think they got introduced after the big '+_obj' commit, this commit 652a3017c485
("crypto: arm64/aes-neonbs - Move key expansion off the stack") is from Mar 6 2026.

I did git checkout this commit and run checkpatch.pl (from Mar 6) over the commit:

WARNING: Prefer kmalloc_obj over kmalloc with sizeof
#37: FILE: arch/arm64/crypto/aes-neonbs-glue.c:82:
+       rk = kmalloc(sizeof(*rk), GFP_KERNEL);

So the recommended workflow should have caught this.

Thanks for handling this.
 Manuel

> -Kees



More information about the linux-arm-kernel mailing list