search for: free_iv

Displaying 20 results from an estimated 23 matches for "free_iv".

2016 Dec 01
0
[PATCH v5 1/1] crypto: add virtio-crypto driver
...[num_out + num_in++] = &status_sg; + + vc_req->sgs = sgs; + + spin_lock_irqsave(&vcrypto->lock, flags); + err = virtqueue_add_sgs(data_vq->vq, sgs, num_out, + num_in, vc_req, GFP_ATOMIC); + spin_unlock_irqrestore(&vcrypto->lock, flags); + if (unlikely(err < 0)) + goto free_iv; + + return 0; + +free_iv: + kzfree(iv); +free: + kzfree(req_data); + kfree(sgs); + return err; +} + +static int virtio_crypto_ablkcipher_encrypt(struct ablkcipher_request *req) +{ + struct crypto_ablkcipher *atfm = crypto_ablkcipher_reqtfm(req); + struct virtio_crypto_ablkcipher_ctx *ctx = crypto_...
2016 Dec 08
0
[PATCH v6 2/2] crypto: add virtio-crypto driver
...[num_out + num_in++] = &status_sg; + + vc_req->sgs = sgs; + + spin_lock_irqsave(&vcrypto->lock, flags); + err = virtqueue_add_sgs(data_vq->vq, sgs, num_out, + num_in, vc_req, GFP_ATOMIC); + spin_unlock_irqrestore(&vcrypto->lock, flags); + if (unlikely(err < 0)) + goto free_iv; + + return 0; + +free_iv: + kzfree(iv); +free: + kzfree(req_data); + kfree(sgs); + return err; +} + +static int virtio_crypto_ablkcipher_encrypt(struct ablkcipher_request *req) +{ + struct crypto_ablkcipher *atfm = crypto_ablkcipher_reqtfm(req); + struct virtio_crypto_ablkcipher_ctx *ctx = crypto_...
2016 Dec 14
0
[PATCH v7 1/1] crypto: add virtio-crypto driver
...[num_out + num_in++] = &status_sg; + + vc_req->sgs = sgs; + + spin_lock_irqsave(&vcrypto->lock, flags); + err = virtqueue_add_sgs(data_vq->vq, sgs, num_out, + num_in, vc_req, GFP_ATOMIC); + spin_unlock_irqrestore(&vcrypto->lock, flags); + if (unlikely(err < 0)) + goto free_iv; + + return 0; + +free_iv: + kzfree(iv); +free: + kzfree(req_data); + kfree(sgs); + return err; +} + +static int virtio_crypto_ablkcipher_encrypt(struct ablkcipher_request *req) +{ + struct crypto_ablkcipher *atfm = crypto_ablkcipher_reqtfm(req); + struct virtio_crypto_ablkcipher_ctx *ctx = crypto_...
2016 Dec 15
0
[PATCH v8 1/1] crypto: add virtio-crypto driver
..._sg; + + vc_req->sgs = sgs; + + spin_lock_irqsave(&data_vq->lock, flags); + err = virtqueue_add_sgs(data_vq->vq, sgs, num_out, + num_in, vc_req, GFP_ATOMIC); + virtqueue_kick(data_vq->vq); + spin_unlock_irqrestore(&data_vq->lock, flags); + if (unlikely(err < 0)) + goto free_iv; + + return 0; + +free_iv: + kzfree(iv); +free: + kzfree(req_data); + kfree(sgs); + return err; +} + +static int virtio_crypto_ablkcipher_encrypt(struct ablkcipher_request *req) +{ + struct crypto_ablkcipher *atfm = crypto_ablkcipher_reqtfm(req); + struct virtio_crypto_ablkcipher_ctx *ctx = crypto_...
2016 Dec 08
4
[PATCH v6 0/2] virtio-crypto: add Linux driver
v6: - add patch 1/2 to make sparc architecture happy. [Sam] - close created sessions previousely when rekeying. - convert the priority of virtio crypto algs from 4001 to 501 which is enough. v5: - add comments for algs_lock and table_lock. [Stefan] - use kzfree instead of kfree for key material security. [Stefan] - drop unnecessary spin_lock for struct virtio_crypto_ablkcipher_ctx. -
2016 Dec 08
4
[PATCH v6 0/2] virtio-crypto: add Linux driver
v6: - add patch 1/2 to make sparc architecture happy. [Sam] - close created sessions previousely when rekeying. - convert the priority of virtio crypto algs from 4001 to 501 which is enough. v5: - add comments for algs_lock and table_lock. [Stefan] - use kzfree instead of kfree for key material security. [Stefan] - drop unnecessary spin_lock for struct virtio_crypto_ablkcipher_ctx. -
2016 Dec 06
2
[PATCH v5 1/1] crypto: add virtio-crypto driver
...> + vc_req->sgs = sgs; > + > + spin_lock_irqsave(&vcrypto->lock, flags); > + err = virtqueue_add_sgs(data_vq->vq, sgs, num_out, > + num_in, vc_req, GFP_ATOMIC); > + spin_unlock_irqrestore(&vcrypto->lock, flags); > + if (unlikely(err < 0)) > + goto free_iv; > + > + return 0; > + > +free_iv: > + kzfree(iv); > +free: > + kzfree(req_data); > + kfree(sgs); > + return err; > +} > + > +static int virtio_crypto_ablkcipher_encrypt(struct ablkcipher_request *req) > +{ > + struct crypto_ablkcipher *atfm = crypto_ablkci...
2016 Dec 06
2
[PATCH v5 1/1] crypto: add virtio-crypto driver
...> + vc_req->sgs = sgs; > + > + spin_lock_irqsave(&vcrypto->lock, flags); > + err = virtqueue_add_sgs(data_vq->vq, sgs, num_out, > + num_in, vc_req, GFP_ATOMIC); > + spin_unlock_irqrestore(&vcrypto->lock, flags); > + if (unlikely(err < 0)) > + goto free_iv; > + > + return 0; > + > +free_iv: > + kzfree(iv); > +free: > + kzfree(req_data); > + kfree(sgs); > + return err; > +} > + > +static int virtio_crypto_ablkcipher_encrypt(struct ablkcipher_request *req) > +{ > + struct crypto_ablkcipher *atfm = crypto_ablkci...
2016 Dec 01
3
[PATCH v5 0/1] virtio-crypto: add Linux driver
v5: - add comments for algs_lock and table_lock. [Stefan] - use kzfree instead of kfree for key material security. [Stefan] - drop unnecessary spin_lock for struct virtio_crypto_ablkcipher_ctx. - dynamically allocated memory for iv in order to avoid to do DMA from the stack memory in __virtio_crypto_ablkcipher_do_req(). - add logs for error path in virtio_crypto_alg_validate_key(). - add
2016 Dec 01
3
[PATCH v5 0/1] virtio-crypto: add Linux driver
v5: - add comments for algs_lock and table_lock. [Stefan] - use kzfree instead of kfree for key material security. [Stefan] - drop unnecessary spin_lock for struct virtio_crypto_ablkcipher_ctx. - dynamically allocated memory for iv in order to avoid to do DMA from the stack memory in __virtio_crypto_ablkcipher_do_req(). - add logs for error path in virtio_crypto_alg_validate_key(). - add
2016 Dec 12
2
[PATCH v6 2/2] crypto: add virtio-crypto driver
...> + vc_req->sgs = sgs; > + > + spin_lock_irqsave(&vcrypto->lock, flags); > + err = virtqueue_add_sgs(data_vq->vq, sgs, num_out, > + num_in, vc_req, GFP_ATOMIC); > + spin_unlock_irqrestore(&vcrypto->lock, flags); > + if (unlikely(err < 0)) > + goto free_iv; > + > + return 0; > + > +free_iv: > + kzfree(iv); > +free: > + kzfree(req_data); > + kfree(sgs); > + return err; > +} > + > +static int virtio_crypto_ablkcipher_encrypt(struct ablkcipher_request *req) > +{ > + struct crypto_ablkcipher *atfm = crypto_ablkci...
2016 Dec 12
2
[PATCH v6 2/2] crypto: add virtio-crypto driver
...> + vc_req->sgs = sgs; > + > + spin_lock_irqsave(&vcrypto->lock, flags); > + err = virtqueue_add_sgs(data_vq->vq, sgs, num_out, > + num_in, vc_req, GFP_ATOMIC); > + spin_unlock_irqrestore(&vcrypto->lock, flags); > + if (unlikely(err < 0)) > + goto free_iv; > + > + return 0; > + > +free_iv: > + kzfree(iv); > +free: > + kzfree(req_data); > + kfree(sgs); > + return err; > +} > + > +static int virtio_crypto_ablkcipher_encrypt(struct ablkcipher_request *req) > +{ > + struct crypto_ablkcipher *atfm = crypto_ablkci...
2016 Dec 15
2
[PATCH v8 0/1] virtio-crypto: add Linux driver
v8: - use per virtqueue lock instead of a whole device lock for data virtuqueue. [Halil & Xin] v7: - fix "BUG: smp_processor_id() in preemptible [00000000] code" reported by Halil, using get_cpu/put_cpu instead of calling smp_processor_id() directly. - fix a possible spinlock recursion in virtcrypto_dataq_callback(), we should release the spinlock before invoking the
2016 Dec 15
2
[PATCH v8 0/1] virtio-crypto: add Linux driver
v8: - use per virtqueue lock instead of a whole device lock for data virtuqueue. [Halil & Xin] v7: - fix "BUG: smp_processor_id() in preemptible [00000000] code" reported by Halil, using get_cpu/put_cpu instead of calling smp_processor_id() directly. - fix a possible spinlock recursion in virtcrypto_dataq_callback(), we should release the spinlock before invoking the
2016 Dec 14
2
[PATCH v7 0/1] virtio-crypto: add Linux driver
v7: - fix "BUG: smp_processor_id() in preemptible [00000000] code" reported by Halil, using get_cpu/put_cpu instead of calling smp_processor_id() directly. - fix a possible spinlock recursion in virtcrypto_dataq_callback(), we should release the spinlock before invoking the callback. - rebase on the latest kernel master tree. v6: - add patch 1/2 to make sparc architecture
2016 Dec 14
2
[PATCH v7 0/1] virtio-crypto: add Linux driver
v7: - fix "BUG: smp_processor_id() in preemptible [00000000] code" reported by Halil, using get_cpu/put_cpu instead of calling smp_processor_id() directly. - fix a possible spinlock recursion in virtcrypto_dataq_callback(), we should release the spinlock before invoking the callback. - rebase on the latest kernel master tree. v6: - add patch 1/2 to make sparc architecture
2020 Jun 16
0
[PATCH v5 2/2] mm, treewide: Rename kzfree() to kfree_sensitive()
...-197,7 +197,7 @@ static int virtio_crypto_alg_skcipher_init_session( spin_unlock(&vcrypto->ctrl_lock); - kzfree(cipher_key); + kfree_sensitive(cipher_key); return 0; } @@ -472,9 +472,9 @@ __virtio_crypto_skcipher_do_req(struct virtio_crypto_sym_request *vc_sym_req, return 0; free_iv: - kzfree(iv); + kfree_sensitive(iv); free: - kzfree(req_data); + kfree_sensitive(req_data); kfree(sgs); return err; } @@ -583,7 +583,7 @@ static void virtio_crypto_skcipher_finalize_req( scatterwalk_map_and_copy(req->iv, req->dst, req->cryptlen - AES_BLOCK_SIZE, AES...
2020 Apr 13
0
[PATCH 1/2] mm, treewide: Rename kzfree() to kfree_sensitive()
...-197,7 +197,7 @@ static int virtio_crypto_alg_skcipher_init_session( spin_unlock(&vcrypto->ctrl_lock); - kzfree(cipher_key); + kfree_sensitive(cipher_key); return 0; } @@ -466,9 +466,9 @@ __virtio_crypto_skcipher_do_req(struct virtio_crypto_sym_request *vc_sym_req, return 0; free_iv: - kzfree(iv); + kfree_sensitive(iv); free: - kzfree(req_data); + kfree_sensitive(req_data); kfree(sgs); return err; } @@ -579,7 +579,7 @@ static void virtio_crypto_skcipher_finalize_req( AES_BLOCK_SIZE, 0); crypto_finalize_skcipher_request(vc_sym_req->base.dataq->engine,...
2020 Jun 16
0
[PATCH v4 2/3] mm, treewide: Rename kzfree() to kfree_sensitive()
...-197,7 +197,7 @@ static int virtio_crypto_alg_skcipher_init_session( spin_unlock(&vcrypto->ctrl_lock); - kzfree(cipher_key); + kfree_sensitive(cipher_key); return 0; } @@ -472,9 +472,9 @@ __virtio_crypto_skcipher_do_req(struct virtio_crypto_sym_request *vc_sym_req, return 0; free_iv: - kzfree(iv); + kfree_sensitive(iv); free: - kzfree(req_data); + kfree_sensitive(req_data); kfree(sgs); return err; } @@ -583,7 +583,7 @@ static void virtio_crypto_skcipher_finalize_req( scatterwalk_map_and_copy(req->iv, req->dst, req->cryptlen - AES_BLOCK_SIZE, AES...
2020 Jun 16
3
[PATCH v5 0/2] mm, treewide: Rename kzfree() to kfree_sensitive()
v5: - Break the btrfs patch out as a separate patch to be processed independently. - Update the commit log of patch 1 to make it less scary. - Add a kzfree backward compatibility macro in patch 2. v4: - Break out the memzero_explicit() change as suggested by Dan Carpenter so that it can be backported to stable. - Drop the "crypto: Remove unnecessary