<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/crypto/virtio, branch for-next</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=for-next</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=for-next'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2024-10-05T05:22:04Z</updated>
<entry>
<title>crypto: virtio - Drop sign/verify operations</title>
<updated>2024-10-05T05:22:04Z</updated>
<author>
<name>Lukas Wunner</name>
<email>lukas@wunner.de</email>
</author>
<published>2024-09-10T14:30:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5b553e06b3215fa97d222ebddc2bc964f1824c5b'/>
<id>urn:sha1:5b553e06b3215fa97d222ebddc2bc964f1824c5b</id>
<content type='text'>
The virtio crypto driver exposes akcipher sign/verify operations in a
user space ABI.  This blocks removal of sign/verify from akcipher_alg.

Herbert opines:

   "I would say that this is something that we can break.  Breaking it
    is no different to running virtio on a host that does not support
    these algorithms.  After all, a software implementation must always
    be present.

    I deliberately left akcipher out of crypto_user because the API
    is still in flux.  We should not let virtio constrain ourselves."
    https://lore.kernel.org/all/ZtqoNAgcnXnrYhZZ@gondor.apana.org.au/

   "I would remove virtio akcipher support in its entirety.  This API
    was never meant to be exposed outside of the kernel."
    https://lore.kernel.org/all/Ztqql_gqgZiMW8zz@gondor.apana.org.au/

Drop sign/verify support from virtio crypto.  There's no strong reason
to also remove encrypt/decrypt support, so keep it.

A key selling point of virtio crypto is to allow guest access to crypto
accelerators on the host.  So far the only akcipher algorithm supported
by virtio crypto is RSA.  Dropping sign/verify merely means that the
PKCS#1 padding is now always generated or verified inside the guest,
but the actual signature generation/verification (which is an RSA
decrypt/encrypt operation) may still use an accelerator on the host.

Generating or verifying the PKCS#1 padding is cheap, so a hardware
accelerator won't be of much help there.  Which begs the question
whether virtio crypto support for sign/verify makes sense at all.

It would make sense for the sign operation if the host has a security
chip to store asymmetric private keys.  But the kernel doesn't even
have an asymmetric_key_subtype yet for hardware-based private keys.
There's at least one rudimentary driver for such chips (atmel-ecc.c for
ATECC508A), but it doesn't implement the sign operation.  The kernel
would first have to grow support for a hardware asymmetric_key_subtype
and at least one driver implementing the sign operation before exposure
to guests via virtio makes sense.

Signed-off-by: Lukas Wunner &lt;lukas@wunner.de&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>virtio: rename virtio_find_vqs_info() to virtio_find_vqs()</title>
<updated>2024-07-17T09:20:58Z</updated>
<author>
<name>Jiri Pirko</name>
<email>jiri@nvidia.com</email>
</author>
<published>2024-07-08T07:48:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6c85d6b653caeba2ef982925703cbb4f2b3b3163'/>
<id>urn:sha1:6c85d6b653caeba2ef982925703cbb4f2b3b3163</id>
<content type='text'>
Since the original virtio_find_vqs() is no longer present, rename
virtio_find_vqs_info() back to virtio_find_vqs().

Signed-off-by: Jiri Pirko &lt;jiri@nvidia.com&gt;
Message-Id: &lt;20240708074814.1739223-20-jiri@resnulli.us&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio_crypto: convert to use virtio_find_vqs_info()</title>
<updated>2024-07-17T09:20:57Z</updated>
<author>
<name>Jiri Pirko</name>
<email>jiri@nvidia.com</email>
</author>
<published>2024-07-08T07:48:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=210a70f22dd09559c2fdc0135aecdd6fe01d724e'/>
<id>urn:sha1:210a70f22dd09559c2fdc0135aecdd6fe01d724e</id>
<content type='text'>
Instead of passing separate names and callbacks arrays
to virtio_find_vqs(), allocate one of virtual_queue_info structs and
pass it to virtio_find_vqs_info().

Suggested-by: Xuan Zhuo &lt;xuanzhuo@linux.alibaba.com&gt;
Signed-off-by: Jiri Pirko &lt;jiri@nvidia.com&gt;
Message-Id: &lt;20240708074814.1739223-13-jiri@resnulli.us&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>crypto: virtio - drop owner assignment</title>
<updated>2024-05-22T12:31:16Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>krzysztof.kozlowski@linaro.org</email>
</author>
<published>2024-03-31T08:43:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9e00c140f38d2394426d7e9b2a23b52958c67deb'/>
<id>urn:sha1:9e00c140f38d2394426d7e9b2a23b52958c67deb</id>
<content type='text'>
virtio core already sets the .owner, so driver does not need to.

Signed-off-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@linaro.org&gt;

Message-Id: &lt;20240331-module-owner-virtio-v2-10-98f04bfaf46a@linaro.org&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Acked-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>Merge tag 'v6.9-p1' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6</title>
<updated>2024-03-15T21:46:54Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2024-03-15T21:46:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c8e769961668ef56acabc67f040c58ed769c57e4'/>
<id>urn:sha1:c8e769961668ef56acabc67f040c58ed769c57e4</id>
<content type='text'>
Pull crypto updates from Herbert Xu:
 "API:

   - Avoid unnecessary copying in scomp for trivial SG lists

  Algorithms:

   - Optimise NEON CCM implementation on ARM64

  Drivers:

   - Add queue stop/query debugfs support in hisilicon/qm

   - Intel qat updates and cleanups"

* tag 'v6.9-p1' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (79 commits)
  Revert "crypto: remove CONFIG_CRYPTO_STATS"
  crypto: scomp - remove memcpy if sg_nents is 1 and pages are lowmem
  crypto: tcrypt - add ffdhe2048(dh) test
  crypto: iaa - fix the missing CRYPTO_ALG_ASYNC in cra_flags
  crypto: hisilicon/zip - fix the missing CRYPTO_ALG_ASYNC in cra_flags
  hwrng: hisi - use dev_err_probe
  MAINTAINERS: Remove T Ambarus from few mchp entries
  crypto: iaa - Fix comp/decomp delay statistics
  crypto: iaa - Fix async_disable descriptor leak
  dt-bindings: rng: atmel,at91-trng: add sam9x7 TRNG
  dt-bindings: crypto: add sam9x7 in Atmel TDES
  dt-bindings: crypto: add sam9x7 in Atmel SHA
  dt-bindings: crypto: add sam9x7 in Atmel AES
  crypto: remove CONFIG_CRYPTO_STATS
  crypto: dh - Make public key test FIPS-only
  crypto: rockchip - fix to check return value
  crypto: jitter - fix CRYPTO_JITTERENTROPY help text
  crypto: qat - make ring to service map common for QAT GEN4
  crypto: qat - fix ring to service map for dcc in 420xx
  crypto: qat - fix ring to service map for dcc in 4xxx
  ...
</content>
</entry>
<entry>
<title>crypto: virtio - remove duplicate check if queue is broken</title>
<updated>2024-02-09T04:57:18Z</updated>
<author>
<name>Li RongQing</name>
<email>lirongqing@baidu.com</email>
</author>
<published>2024-02-01T06:17:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=633eeefab69ed4bdfa3f1d375c609e87feb1c55a'/>
<id>urn:sha1:633eeefab69ed4bdfa3f1d375c609e87feb1c55a</id>
<content type='text'>
virtqueue_enable_cb() will call virtqueue_poll() which will check if
queue is broken at beginning, so remove the virtqueue_is_broken() call

Reviewed-by: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
Signed-off-by: Li RongQing &lt;lirongqing@baidu.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: virtio/akcipher - Fix stack overflow on memcpy</title>
<updated>2024-02-09T04:55:53Z</updated>
<author>
<name>zhenwei pi</name>
<email>pizhenwei@bytedance.com</email>
</author>
<published>2024-01-30T11:27:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c0ec2a712daf133d9996a8a1b7ee2d4996080363'/>
<id>urn:sha1:c0ec2a712daf133d9996a8a1b7ee2d4996080363</id>
<content type='text'>
sizeof(struct virtio_crypto_akcipher_session_para) is less than
sizeof(struct virtio_crypto_op_ctrl_req::u), copying more bytes from
stack variable leads stack overflow. Clang reports this issue by
commands:
make -j CC=clang-14 mrproper &gt;/dev/null 2&gt;&amp;1
make -j O=/tmp/crypto-build CC=clang-14 allmodconfig &gt;/dev/null 2&gt;&amp;1
make -j O=/tmp/crypto-build W=1 CC=clang-14 drivers/crypto/virtio/
  virtio_crypto_akcipher_algs.o

Fixes: 59ca6c93387d ("virtio-crypto: implement RSA algorithm")
Link: https://lore.kernel.org/all/0a194a79-e3a3-45e7-be98-83abd3e1cb7e@roeck-us.net/
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: zhenwei pi &lt;pizhenwei@bytedance.com&gt;
Tested-by: Nathan Chancellor &lt;nathan@kernel.org&gt; # build
Acked-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: virtio - Less function calls in __virtio_crypto_akcipher_do_req() after error detection</title>
<updated>2024-01-26T08:36:57Z</updated>
<author>
<name>Markus Elfring</name>
<email>elfring@users.sourceforge.net</email>
</author>
<published>2023-12-26T10:00:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e01966e643c97eb8916bbbbbeceb687afb11f345'/>
<id>urn:sha1:e01966e643c97eb8916bbbbbeceb687afb11f345</id>
<content type='text'>
The kfree() function was called in up to two cases by the
__virtio_crypto_akcipher_do_req() function during error handling
even if the passed variable contained a null pointer.
This issue was detected by using the Coccinelle software.

* Adjust jump targets.

* Delete two initialisations which became unnecessary
  with this refactoring.

Signed-off-by: Markus Elfring &lt;elfring@users.sourceforge.net&gt;
Reviewed-by: Gonglei &lt;arei.gonglei@huawei.com&gt;
Reviewed-by: Justin Stitt &lt;justinstitt@google.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: virtio - Wait for tasklet to complete on device remove</title>
<updated>2023-12-22T04:30:19Z</updated>
<author>
<name>wangyangxin</name>
<email>wangyangxin1@huawei.com</email>
</author>
<published>2023-12-11T11:42:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=67cc511e8d436456cc98033e6d4ba83ebfc8e672'/>
<id>urn:sha1:67cc511e8d436456cc98033e6d4ba83ebfc8e672</id>
<content type='text'>
The scheduled tasklet needs to be executed on device remove.

Fixes: fed93fb62e05 ("crypto: virtio - Handle dataq logic with tasklet")
Signed-off-by: wangyangxin &lt;wangyangxin1@huawei.com&gt;
Signed-off-by: Gonglei &lt;arei.gonglei@huawei.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: virtio - Handle dataq logic with tasklet</title>
<updated>2023-12-01T10:03:26Z</updated>
<author>
<name>Gonglei (Arei)</name>
<email>arei.gonglei@huawei.com</email>
</author>
<published>2023-11-20T11:49:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fed93fb62e05c38152b0fc1dc9609639e63eed76'/>
<id>urn:sha1:fed93fb62e05c38152b0fc1dc9609639e63eed76</id>
<content type='text'>
Doing ipsec produces a spinlock recursion warning.
This is due to crypto_finalize_request() being called in the upper half.
Move virtual data queue processing of virtio-crypto driver to tasklet.

Fixes: dbaf0624ffa57 ("crypto: add virtio-crypto driver")
Reported-by: Halil Pasic &lt;pasic@linux.ibm.com&gt;
Signed-off-by: wangyangxin &lt;wangyangxin1@huawei.com&gt;
Signed-off-by: Gonglei &lt;arei.gonglei@huawei.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
</feed>
