search for: cipher_key

Displaying 20 results from an estimated 49 matches for "cipher_key".

2016 Nov 28
1
[PATCH v3] crypto: add virtio-crypto driver
...> + unsigned int num_out = 0, num_in = 0; >>> > > + >>> > > + /* >>> > > + * Avoid to do DMA from the stack, switch to using >>> > > + * dynamically-allocated for the key >>> > > + */ >>> > > + uint8_t *cipher_key = kmalloc(keylen, GFP_ATOMIC); >>> > > + >>> > > + if (!cipher_key) >>> > > + return -ENOMEM; >>> > > + >>> > > + memcpy(cipher_key, key, keylen); >>> > > + >>> > > + spin_lock(&vcrypto-&gt...
2016 Nov 28
1
[PATCH v3] crypto: add virtio-crypto driver
...> + unsigned int num_out = 0, num_in = 0; >>> > > + >>> > > + /* >>> > > + * Avoid to do DMA from the stack, switch to using >>> > > + * dynamically-allocated for the key >>> > > + */ >>> > > + uint8_t *cipher_key = kmalloc(keylen, GFP_ATOMIC); >>> > > + >>> > > + if (!cipher_key) >>> > > + return -ENOMEM; >>> > > + >>> > > + memcpy(cipher_key, key, keylen); >>> > > + >>> > > + spin_lock(&vcrypto-&gt...
2019 Jul 03
3
[PATCH v2 06/35] crypto: Use kmemdup rather than duplicating its implementation
...19205166b 100644 --- a/drivers/crypto/virtio/virtio_crypto_algs.c +++ b/drivers/crypto/virtio/virtio_crypto_algs.c @@ -129,13 +129,11 @@ static int virtio_crypto_alg_ablkcipher_init_session( * Avoid to do DMA from the stack, switch to using * dynamically-allocated for the key */ - uint8_t *cipher_key = kmalloc(keylen, GFP_ATOMIC); + uint8_t *cipher_key = kmemdup(key, keylen, GFP_ATOMIC); if (!cipher_key) return -ENOMEM; - memcpy(cipher_key, key, keylen); - spin_lock(&vcrypto->ctrl_lock); /* Pad ctrl header */ vcrypto->ctrl.header.opcode = -- 2.11.0
2019 Jul 03
3
[PATCH v2 06/35] crypto: Use kmemdup rather than duplicating its implementation
...19205166b 100644 --- a/drivers/crypto/virtio/virtio_crypto_algs.c +++ b/drivers/crypto/virtio/virtio_crypto_algs.c @@ -129,13 +129,11 @@ static int virtio_crypto_alg_ablkcipher_init_session( * Avoid to do DMA from the stack, switch to using * dynamically-allocated for the key */ - uint8_t *cipher_key = kmalloc(keylen, GFP_ATOMIC); + uint8_t *cipher_key = kmemdup(key, keylen, GFP_ATOMIC); if (!cipher_key) return -ENOMEM; - memcpy(cipher_key, key, keylen); - spin_lock(&vcrypto->ctrl_lock); /* Pad ctrl header */ vcrypto->ctrl.header.opcode = -- 2.11.0
2016 Nov 30
3
[PATCH v4 1/1] crypto: add virtio-crypto driver
...->vcrypto; > + int op = encrypt ? VIRTIO_CRYPTO_OP_ENCRYPT : VIRTIO_CRYPTO_OP_DECRYPT; > + int err; > + unsigned int num_out = 0, num_in = 0; > + > + /* > + * Avoid to do DMA from the stack, switch to using > + * dynamically-allocated for the key > + */ > + uint8_t *cipher_key = kmalloc(keylen, GFP_ATOMIC); > + > + if (!cipher_key) > + return -ENOMEM; > + > + memcpy(cipher_key, key, keylen); Are there any rules on handling key material in the kernel? This buffer is just kfreed later. Do you need to zero it out before freeing it? > + > + spin_loc...
2016 Nov 30
3
[PATCH v4 1/1] crypto: add virtio-crypto driver
...->vcrypto; > + int op = encrypt ? VIRTIO_CRYPTO_OP_ENCRYPT : VIRTIO_CRYPTO_OP_DECRYPT; > + int err; > + unsigned int num_out = 0, num_in = 0; > + > + /* > + * Avoid to do DMA from the stack, switch to using > + * dynamically-allocated for the key > + */ > + uint8_t *cipher_key = kmalloc(keylen, GFP_ATOMIC); > + > + if (!cipher_key) > + return -ENOMEM; > + > + memcpy(cipher_key, key, keylen); Are there any rules on handling key material in the kernel? This buffer is just kfreed later. Do you need to zero it out before freeing it? > + > + spin_loc...
2016 Dec 01
1
[PATCH v4 1/1] crypto: add virtio-crypto driver
..._OP_DECRYPT; > > > + int err; > > > + unsigned int num_out = 0, num_in = 0; > > > + > > > + /* > > > + * Avoid to do DMA from the stack, switch to using > > > + * dynamically-allocated for the key > > > + */ > > > + uint8_t *cipher_key = kmalloc(keylen, GFP_ATOMIC); > > > + > > > + if (!cipher_key) > > > + return -ENOMEM; > > > + > > > + memcpy(cipher_key, key, keylen); > > > > Are there any rules on handling key material in the kernel? This buffer > > is just kfre...
2016 Dec 01
1
[PATCH v4 1/1] crypto: add virtio-crypto driver
..._OP_DECRYPT; > > > + int err; > > > + unsigned int num_out = 0, num_in = 0; > > > + > > > + /* > > > + * Avoid to do DMA from the stack, switch to using > > > + * dynamically-allocated for the key > > > + */ > > > + uint8_t *cipher_key = kmalloc(keylen, GFP_ATOMIC); > > > + > > > + if (!cipher_key) > > > + return -ENOMEM; > > > + > > > + memcpy(cipher_key, key, keylen); > > > > Are there any rules on handling key material in the kernel? This buffer > > is just kfre...
2019 Jul 03
0
[PATCH 05/30] crypto: Use kmemdup rather than duplicating its implementation
...19205166b 100644 --- a/drivers/crypto/virtio/virtio_crypto_algs.c +++ b/drivers/crypto/virtio/virtio_crypto_algs.c @@ -129,13 +129,11 @@ static int virtio_crypto_alg_ablkcipher_init_session( * Avoid to do DMA from the stack, switch to using * dynamically-allocated for the key */ - uint8_t *cipher_key = kmalloc(keylen, GFP_ATOMIC); + uint8_t *cipher_key = kmemdup(key, keylen, GFP_ATOMIC); if (!cipher_key) return -ENOMEM; - memcpy(cipher_key, key, keylen); - spin_lock(&vcrypto->ctrl_lock); /* Pad ctrl header */ vcrypto->ctrl.header.opcode = -- 2.11.0
2019 Jul 03
0
[PATCH v2 06/35] crypto: Use kmemdup rather than duplicating its implementation
.../crypto/virtio/virtio_crypto_algs.c > +++ b/drivers/crypto/virtio/virtio_crypto_algs.c > @@ -129,13 +129,11 @@ static int virtio_crypto_alg_ablkcipher_init_session( > * Avoid to do DMA from the stack, switch to using > * dynamically-allocated for the key > */ > - uint8_t *cipher_key = kmalloc(keylen, GFP_ATOMIC); > + uint8_t *cipher_key = kmemdup(key, keylen, GFP_ATOMIC); > > if (!cipher_key) > return -ENOMEM; > > - memcpy(cipher_key, key, keylen); > - > spin_lock(&vcrypto->ctrl_lock); > /* Pad ctrl header */ > vcrypto->ct...
2016 Dec 01
0
[PATCH v4 1/1] crypto: add virtio-crypto driver
...O_CRYPTO_OP_ENCRYPT : > VIRTIO_CRYPTO_OP_DECRYPT; > > + int err; > > + unsigned int num_out = 0, num_in = 0; > > + > > + /* > > + * Avoid to do DMA from the stack, switch to using > > + * dynamically-allocated for the key > > + */ > > + uint8_t *cipher_key = kmalloc(keylen, GFP_ATOMIC); > > + > > + if (!cipher_key) > > + return -ENOMEM; > > + > > + memcpy(cipher_key, key, keylen); > > Are there any rules on handling key material in the kernel? This buffer > is just kfreed later. Do you need to zero it out be...
2016 Nov 28
5
[PATCH v3] crypto: add virtio-crypto driver
...nity(vcrypto, -1); > + > + vdev->config->del_vqs(vdev); > + > + virtcrypto_free_queues(vcrypto); > +} > + > +static int virtcrypto_probe(struct virtio_device *vdev) > +{ > + int err = -EFAULT; > + struct virtio_crypto *vcrypto; > + u32 max_data_queues = 0, max_cipher_key_len = 0; > + u32 max_auth_key_len = 0; > + u64 max_size = 0; > + > + if (!virtio_has_feature(vdev, VIRTIO_F_VERSION_1)) > + return -ENODEV; > + > + if (!vdev->config->get) { > + dev_err(&vdev->dev, "%s failure: config access disabled\n", > + __f...
2016 Nov 28
5
[PATCH v3] crypto: add virtio-crypto driver
...nity(vcrypto, -1); > + > + vdev->config->del_vqs(vdev); > + > + virtcrypto_free_queues(vcrypto); > +} > + > +static int virtcrypto_probe(struct virtio_device *vdev) > +{ > + int err = -EFAULT; > + struct virtio_crypto *vcrypto; > + u32 max_data_queues = 0, max_cipher_key_len = 0; > + u32 max_auth_key_len = 0; > + u64 max_size = 0; > + > + if (!virtio_has_feature(vdev, VIRTIO_F_VERSION_1)) > + return -ENODEV; > + > + if (!vdev->config->get) { > + dev_err(&vdev->dev, "%s failure: config access disabled\n", > + __f...
2016 Nov 29
2
[PATCH v4 0/1] virtio-crypto: add Linux driver
v4: - rework unknow status bit handler by calling virtio_break_device(). [Cornelia] - convert space to tab in Kconfig. [Stefan] - rename virtio_crypto.c to virtio_crypto_core.c and then make the moudle named virtio_crypto.ko for consistency. [Stefan] - don't call virtcrypto_dev_stop() on failure path. [Stefan] - don't add two empty lines. [Michael] - fix possible race by add
2016 Nov 29
2
[PATCH v4 0/1] virtio-crypto: add Linux driver
v4: - rework unknow status bit handler by calling virtio_break_device(). [Cornelia] - convert space to tab in Kconfig. [Stefan] - rename virtio_crypto.c to virtio_crypto_core.c and then make the moudle named virtio_crypto.ko for consistency. [Stefan] - don't call virtcrypto_dev_stop() on failure path. [Stefan] - don't add two empty lines. [Michael] - fix possible race by add
2016 Nov 27
2
[PATCH v2 2/2] crypto: add virtio-crypto driver
...crypto, -1); > + > + vdev->config->del_vqs(vdev); > + > + virtcrypto_free_queues(vcrypto); > +} > + > +static int virtcrypto_probe(struct virtio_device *vdev) > +{ > + int err = -EFAULT; > + struct virtio_crypto *vcrypto; > + __le32 max_data_queues_le = 0, max_cipher_key_len_le = 0; > + __le32 max_auth_key_len_le = 0; > + __le64 max_size_le = 0; > + Pls validate that it's a modern device (has VERSION_1 set). We should find a way to do it in a central place, but we don't have that now. > + if (!vdev->config->get) { > + dev_err(&vd...
2016 Nov 27
2
[PATCH v2 2/2] crypto: add virtio-crypto driver
...crypto, -1); > + > + vdev->config->del_vqs(vdev); > + > + virtcrypto_free_queues(vcrypto); > +} > + > +static int virtcrypto_probe(struct virtio_device *vdev) > +{ > + int err = -EFAULT; > + struct virtio_crypto *vcrypto; > + __le32 max_data_queues_le = 0, max_cipher_key_len_le = 0; > + __le32 max_auth_key_len_le = 0; > + __le64 max_size_le = 0; > + Pls validate that it's a modern device (has VERSION_1 set). We should find a way to do it in a central place, but we don't have that now. > + if (!vdev->config->get) { > + dev_err(&vd...
2016 Nov 28
0
[virtio-dev] Re: [PATCH v2 2/2] crypto: add virtio-crypto driver
...t;del_vqs(vdev); > > + > > + virtcrypto_free_queues(vcrypto); > > +} > > + > > +static int virtcrypto_probe(struct virtio_device *vdev) > > +{ > > + int err = -EFAULT; > > + struct virtio_crypto *vcrypto; > > + __le32 max_data_queues_le = 0, max_cipher_key_len_le = 0; > > + __le32 max_auth_key_len_le = 0; > > + __le64 max_size_le = 0; > > + > > Pls validate that it's a modern device (has VERSION_1 set). > We should find a way to do it in a central place, > but we don't have that now. > So what I will do is a...
2016 Nov 22
0
[PATCH v2 2/2] crypto: add virtio-crypto driver
...dev = vcrypto->vdev; + + virtcrypto_clean_affinity(vcrypto, -1); + + vdev->config->del_vqs(vdev); + + virtcrypto_free_queues(vcrypto); +} + +static int virtcrypto_probe(struct virtio_device *vdev) +{ + int err = -EFAULT; + struct virtio_crypto *vcrypto; + __le32 max_data_queues_le = 0, max_cipher_key_len_le = 0; + __le32 max_auth_key_len_le = 0; + __le64 max_size_le = 0; + + if (!vdev->config->get) { + dev_err(&vdev->dev, "%s failure: config access disabled\n", + __func__); + return -EINVAL; + } + + if (num_possible_nodes() > 1 && dev_to_node(&vdev->...
2016 Nov 28
0
[PATCH v3] crypto: add virtio-crypto driver
...ice *vdev = vcrypto->vdev; + + virtcrypto_clean_affinity(vcrypto, -1); + + vdev->config->del_vqs(vdev); + + virtcrypto_free_queues(vcrypto); +} + +static int virtcrypto_probe(struct virtio_device *vdev) +{ + int err = -EFAULT; + struct virtio_crypto *vcrypto; + u32 max_data_queues = 0, max_cipher_key_len = 0; + u32 max_auth_key_len = 0; + u64 max_size = 0; + + if (!virtio_has_feature(vdev, VIRTIO_F_VERSION_1)) + return -ENODEV; + + if (!vdev->config->get) { + dev_err(&vdev->dev, "%s failure: config access disabled\n", + __func__); + return -EINVAL; + } + + if (num_po...