Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: virtio - Erase some sensitive memory when it is freed

virtcrypto_clear_request() does the same as the code here, but uses
kfree_sensitive() for one of the free operation.

So, better safe than sorry, use virtcrypto_clear_request() directly to
save a few lines of code and cleanly free the memory.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Tested-by: Lei Yang <leiyang@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Christophe JAILLET and committed by
Herbert Xu
fb14ef46 20238d49

+2 -4
+2 -4
drivers/crypto/virtio/virtio_crypto_core.c
··· 480 480 481 481 for (i = 0; i < vcrypto->max_data_queues; i++) { 482 482 vq = vcrypto->data_vq[i].vq; 483 - while ((vc_req = virtqueue_detach_unused_buf(vq)) != NULL) { 484 - kfree(vc_req->req_data); 485 - kfree(vc_req->sgs); 486 - } 483 + while ((vc_req = virtqueue_detach_unused_buf(vq)) != NULL) 484 + virtcrypto_clear_request(vc_req); 487 485 cond_resched(); 488 486 } 489 487 }