Commit 71dc7a7b authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior Committed by Yongqiang Liu
Browse files

crypto: scompress - return proper error code for allocation failure

stable inclusion
from stable-v4.19.306
commit 1915874d67287ba1ab71825ae6a4efbb2a0e2b11
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I970CO


CVE: NA

--------------------------------

[ Upstream commit 6a4d1b18 ]

If scomp_acomp_comp_decomp() fails to allocate memory for the
destination then we never copy back the data we compressed.
It is probably best to return an error code instead 0 in case of
failure.
I haven't found any user that is using acomp_request_set_params()
without the `dst' buffer so there is probably no harm.

Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Stable-dep-of: 744e1885922a ("crypto: scomp - fix req->dst buffer overflow")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
parent 1ab96c4b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment