search for: kfreed

Displaying 7 results from an estimated 7 matches for "kfreed".

Did you mean: kfree
2016 Nov 30
3
[PATCH v4 1/1] crypto: add virtio-crypto driver
...ng > + * 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_lock(&vcrypto->ctrl_lock); The QAT accelerator driver doesn't spin while talking to the device in virtio_crypto_alg_ablkcipher_init_session(). I didn't find any other driver examples in the kernel tree, but t...
2016 Nov 30
3
[PATCH v4 1/1] crypto: add virtio-crypto driver
...ng > + * 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_lock(&vcrypto->ctrl_lock); The QAT accelerator driver doesn't spin while talking to the device in virtio_crypto_alg_ablkcipher_init_session(). I didn't find any other driver examples in the kernel tree, but t...
2016 Dec 01
1
[PATCH v4 1/1] crypto: add virtio-crypto driver
..._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? > > > Good questions. For kernel crypto core, each cipher request should be freed > by skcipher_request_free(): zeroize and free request data structure. > > I need to use kzfree() for key as well. I'll also check other st...
2016 Dec 01
1
[PATCH v4 1/1] crypto: add virtio-crypto driver
..._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? > > > Good questions. For kernel crypto core, each cipher request should be freed > by skcipher_request_free(): zeroize and free request data structure. > > I need to use kzfree() for key as well. I'll also check other st...
2016 Dec 01
0
[PATCH v4 1/1] crypto: add virtio-crypto driver
...; > + */ > > + 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? > Good questions. For kernel crypto core, each cipher request should be freed by skcipher_request_free(): zeroize and free request data structure. I need to use kzfree() for key as well. I'll also check other stuffs. Thanks. > >...
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