[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <47e684fa24ef3fc209c7045579c43405a9183427.camel@perches.com>
Date: Fri, 30 Jan 2026 22:33:11 -0800
From: Joe Perches <joe@...ches.com>
To: Ella Ma <alansnape3058@...il.com>, thomas.lendacky@....com,
john.allen@....com, herbert@...dor.apana.org.au, davem@...emloft.net,
arnd@...db.de
Cc: linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
julia.lawall@...ia.fr, Markus.Elfring@....de, Tom Lendacky
<thomas.lendacky@...il.com>, Matthew Brost <matthew.brost@...el.com>,
Thomas Hellström <thomas.hellstrom@...ux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@...el.com>, David Airlie <airlied@...il.com>,
Simona Vetter <simona@...ll.ch>
Subject: Re: [PATCH v2] crypto: ccp - Fix a crash due to incorrect cleanup
usage of kfree
On Fri, 2026-01-09 at 16:17 +0100, Ella Ma wrote:
> Annotating a local pointer variable, which will be assigned with the
> kmalloc-family functions, with the `__cleanup(kfree)` attribute will
> make the address of the local variable, rather than the address returned
> by kmalloc, passed to kfree directly and lead to a crash due to invalid
> deallocation of stack address. According to other places in the repo,
> the correct usage should be `__free(kfree)`. The code coincidentally
> compiled because the parameter type `void *` of kfree is compatible with
> the desired type `struct { ... } **`.
>
> Fixes: a71475582ada ("crypto: ccp - reduce stack usage in ccp_run_aes_gcm_cmd")
Perhaps this one too?
drivers/gpu/drm/xe/xe_guc_ct.c: char *buf __cleanup(kfree) = kmalloc(SZ_4K, GFP_NOWAIT);
Powered by blists - more mailing lists