[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2c53b5f9-cba8-48a8-a9ad-9c72656b7479@stanley.mountain>
Date: Mon, 28 Oct 2024 11:48:50 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Christian Marangi <ansuelsmth@...il.com>
Cc: Herbert Xu <herbert@...dor.apana.org.au>,
"David S. Miller" <davem@...emloft.net>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Antoine Tenart <atenart@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>, Will Deacon <will@...nel.org>,
Waiman Long <longman@...hat.com>, Boqun Feng <boqun.feng@...il.com>,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Bill Wendling <morbo@...gle.com>,
Justin Stitt <justinstitt@...gle.com>, linux-crypto@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
llvm@...ts.linux.dev, upstream@...oha.com,
Richard van Schagen <vschagen@...oud.com>
Subject: Re: [PATCH v4 3/3] crypto: Add Mediatek EIP-93 crypto engine support
On Fri, Oct 25, 2024 at 11:47:24AM +0200, Christian Marangi wrote:
> +static void eip93_hash_free_data_blocks(struct ahash_request *req)
> +{
> + struct eip93_hash_reqctx *rctx = ahash_request_ctx(req);
> + struct mkt_hash_block *block;
> +
> + list_for_each_entry(block, &rctx->blocks, list) {
> + dma_unmap_single(rctx->mtk->dev, block->data_dma,
> + SHA256_BLOCK_SIZE, DMA_TO_DEVICE);
> + kfree(block);
You need to use list_for_each_entry_safe() to avoid a use after free.
> + }
> +}
regards,
dan carpenter
Powered by blists - more mailing lists