From: Joe Perches <joe@perches.com>
To: Ella Ma <alansnape3058@gmail.com>,
thomas.lendacky@amd.com, john.allen@amd.com,
herbert@gondor.apana.org.au, davem@davemloft.net, arnd@arndb.de
Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
julia.lawall@inria.fr, Markus.Elfring@web.de,
"Tom Lendacky" <thomas.lendacky@gmail.com>,
"Matthew Brost" <matthew.brost@intel.com>,
"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>
Subject: Re: [PATCH v2] crypto: ccp - Fix a crash due to incorrect cleanup usage of kfree
Date: Fri, 30 Jan 2026 22:33:11 -0800 [thread overview]
Message-ID: <47e684fa24ef3fc209c7045579c43405a9183427.camel@perches.com> (raw)
In-Reply-To: <20260109151724.58799-1-alansnape3058@gmail.com>
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);
prev parent reply other threads:[~2026-01-31 6:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-08 15:29 [PATCH] drivers/crypto/ccp/ccp-ops.c: " Ella Ma
2026-01-08 17:06 ` Markus Elfring
2026-01-08 20:12 ` Tom Lendacky
2026-01-09 15:17 ` [PATCH v2] crypto: ccp - " Ella Ma
2026-01-31 2:48 ` Herbert Xu
2026-01-31 6:33 ` Joe Perches [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47e684fa24ef3fc209c7045579c43405a9183427.camel@perches.com \
--to=joe@perches.com \
--cc=Markus.Elfring@web.de \
--cc=airlied@gmail.com \
--cc=alansnape3058@gmail.com \
--cc=arnd@arndb.de \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=john.allen@amd.com \
--cc=julia.lawall@inria.fr \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew.brost@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=simona@ffwll.ch \
--cc=thomas.hellstrom@linux.intel.com \
--cc=thomas.lendacky@amd.com \
--cc=thomas.lendacky@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®