mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
crypto: akcipher - Do not copy dst if it is NULL
As signature verification has a NULL destination buffer, the pointer
needs to be checked before the memcpy is done.
Fixes: addde1f2c9
("crypto: akcipher - Add sync interface without SG lists")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
891ebfdfa3
commit
486bfb0591
1 changed files with 2 additions and 1 deletions
|
@ -234,7 +234,8 @@ EXPORT_SYMBOL_GPL(crypto_akcipher_sync_prep);
|
||||||
int crypto_akcipher_sync_post(struct crypto_akcipher_sync_data *data, int err)
|
int crypto_akcipher_sync_post(struct crypto_akcipher_sync_data *data, int err)
|
||||||
{
|
{
|
||||||
err = crypto_wait_req(err, &data->cwait);
|
err = crypto_wait_req(err, &data->cwait);
|
||||||
memcpy(data->dst, data->buf, data->dlen);
|
if (data->dst)
|
||||||
|
memcpy(data->dst, data->buf, data->dlen);
|
||||||
data->dlen = data->req->dst_len;
|
data->dlen = data->req->dst_len;
|
||||||
kfree_sensitive(data->req);
|
kfree_sensitive(data->req);
|
||||||
return err;
|
return err;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue