crypto: rockchip: v2: akcipher: prevent input data overflow

Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: I39442e8e8ad1897b454da451090fbe867d6b26d6
This commit is contained in:
Lin Jinhan
2022-03-11 15:04:20 +08:00
committed by Tao Huang
parent 1e2b2b5aec
commit 23c9526f86

View File

@@ -149,6 +149,9 @@ static int rk_rsa_calc(struct akcipher_request *req, bool encypt)
return -EOVERFLOW;
}
if (req->src_len > key_byte_size)
return -EINVAL;
in = rk_bn_alloc(key_byte_size);
if (!in)
goto exit;