[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdYyB=-UnE1bmdVszSSB5ReECZ0fUoWJX6XtYbKHEe52tA@mail.gmail.com>
Date: Thu, 23 Feb 2023 10:52:17 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: Herbert Xu <herbert@...dor.apana.org.au>,
Lionel Debieve <lionel.debieve@...s.st.com>
Cc: Li kunyu <kunyu@...china.com>, davem@...emloft.net,
linux-arm-kernel@...ts.infradead.org, linux-crypto@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com, mcoquelin.stm32@...il.com
Subject: Re: [PATCH] stm32: stm32-hash: Add kmalloc_array allocation check
On Thu, Feb 23, 2023 at 10:33 AM Herbert Xu <herbert@...dor.apana.org.au> wrote:
> On Sat, Feb 25, 2023 at 07:14:29AM +0800, Li kunyu wrote:
> >
> > hello senior:
> > 'rctx->hw_context' is a member of the rctx pointer array object and will pass 'memcpy(out, rctx, sizeof(*rctx)) at the end of the function; ', copied to the out pointer memory, it cannot be released, I think this patch does an allocation check on the 'rctx->hw_context' pointer should help a bit.
>
> Ugh that's completely broken. You can't export pointers.
>
> I guess this driver needs to be disabled.
Added Lionel to the To: line so he can look at this, I guess we should
also add an entry to MAINTAINERS so that the reports come to the right
address.
Can we fix the actual problem? It seems to have been there since the
initial submission in 2017.
I guess the right fix is to export the *actual* hardware state into "out"
and read it back from there instead of copying out the rctx struct.
Also .statesize needs to be fixed to correspond to that.
I can just use a roof:ed constant size for this.
If Lionel does not have time to look at it I can try to come up with a
quick fix.
Yours,
Linus Walleij
Powered by blists - more mailing lists