mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
crypto: zstd - Fix compression bug caused by truncation
commit81c1a15eb4upstream. Use size_t for the return value of zstd_compress_cctx as otherwise negative errors will be truncated to a positive value. Reported-by: Han Xu <han.xu@nxp.com> Fixes:f5ad93ffb5("crypto: zstd - convert to acomp") Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Reviewed-by: David Sterba <dsterba@suse.com> Tested-by: Han Xu <han.xu@nxp.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
75fcc07c8c
commit
15ea288e1d
@@ -83,7 +83,7 @@ static void zstd_exit(struct crypto_acomp *acomp_tfm)
|
||||
static int zstd_compress_one(struct acomp_req *req, struct zstd_ctx *ctx,
|
||||
const void *src, void *dst, unsigned int *dlen)
|
||||
{
|
||||
unsigned int out_len;
|
||||
size_t out_len;
|
||||
|
||||
ctx->cctx = zstd_init_cctx(ctx->wksp, ctx->wksp_size);
|
||||
if (!ctx->cctx)
|
||||
|
||||
Reference in New Issue
Block a user