[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d58a046a-e559-55be-16ba-64db43a06568@web.de>
Date: Tue, 26 May 2020 09:03:21 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: "Longpeng(Mike)" <longpeng2@...wei.com>,
linux-crypto@...r.kernel.org,
virtualization@...ts.linux-foundation.org
Cc: Corentin Labbe <clabbe@...libre.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
"Michael S. Tsirkin" <mst@...hat.com>,
Jason Wang <jasowang@...hat.com>,
"David S. Miller" <davem@...emloft.net>,
Gonglei <arei.gonglei@...wei.com>, linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Subject: Re: [PATCH v2 1/2] crypto: virtio: Fix src/dst scatterlist
calculation in __virtio_crypto_skcipher_do_req()
> Fix it by sg_next() on calculation of src/dst scatterlist.
Wording adjustment:
… by calling the function “sg_next” …
…
> +++ b/drivers/crypto/virtio/virtio_crypto_algs.c
> @@ -350,13 +350,18 @@ __virtio_crypto_skcipher_do_req(struct virtio_crypto_sym_request *vc_sym_req,
…
> src_nents = sg_nents_for_len(req->src, req->cryptlen);
> + if (src_nents < 0) {
> + pr_err("Invalid number of src SG.\n");
> + return src_nents;
> + }
> +
> dst_nents = sg_nents(req->dst);
…
I suggest to move the addition of such input parameter validation
to a separate update step.
Regards,
Markus
Powered by blists - more mailing lists