[PATCH] crypto: sun8i-ce - Fix use after free in unprepare.

Andrey Skvortsov andrej.skvortzov at gmail.com
Wed Feb 28 12:46:12 PST 2024


Hi Herbert,
On 24-02-28 17:18, Herbert Xu wrote:
> On Tue, Feb 27, 2024 at 12:53:57AM +0300, Andrey Skvortsov wrote:
> > sun8i_ce_cipher_unprepare should be called before
> > crypto_finalize_skcipher_request, because client callbacks may
> > immediately free memory, that isn't needed anymore. But it will be
> > used by unprepare after free. Before removing prepare/unprepare
> > callbacks it was handled by crypto engine in crypto_finalize_request.
> > 
> > Usually that results in a pointer dereference problem during a in
> > crypto selftest.
> >  Unable to handle kernel NULL pointer dereference at
> >                                       virtual address 0000000000000030
...
> > 
> > Signed-off-by: Andrey Skvortsov <andrej.skvortzov at gmail.com>
> > Fixes: 4136212ab18e ("crypto: sun8i-ce - Remove prepare/unprepare request")
> > ---
> >  .../allwinner/sun8i-ce/sun8i-ce-cipher.c      | 34 +++++++++----------
> >  1 file changed, 17 insertions(+), 17 deletions(-)
> 
> Patch applied.  Thanks.

You marked your rockchip fix for backport to stable releases.
  Cc: <stable at vger.kernel.org>

I think it makes sense to do the same for the sun8i-ce fix as well. 

-- 
Best regards,
Andrey Skvortsov



More information about the linux-arm-kernel mailing list