qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] block/crypto: do not require number of threads upfront
@ 2024-05-27 15:58 Stefan Hajnoczi
  2024-05-27 15:58 ` [PATCH 1/2] block/crypto: create ciphers on demand Stefan Hajnoczi
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Stefan Hajnoczi @ 2024-05-27 15:58 UTC (permalink / raw)
  To: qemu-devel
  Cc: Hanna Reitz, qemu-block, Kevin Wolf, Daniel P. Berrangé,
	Stefan Hajnoczi

The block layer does not know how many threads will perform I/O. It is possible
to exceed the number of threads that is given to qcrypto_block_open() and this
can trigger an assertion failure in qcrypto_block_pop_cipher().

This patch series removes the n_threads argument and instead handles an
arbitrary number of threads.
---
Is it secure to store the key in QCryptoBlock? In this series I assumed the
answer is yes since the QCryptoBlock's cipher state is equally sensitive, but
I'm not familiar with this code or a crypto expert.

Stefan Hajnoczi (2):
  block/crypto: create ciphers on demand
  crypto/block: drop qcrypto_block_open() n_threads argument

 crypto/blockpriv.h             |  13 ++--
 include/crypto/block.h         |   2 -
 block/crypto.c                 |   1 -
 block/qcow.c                   |   2 +-
 block/qcow2.c                  |   5 +-
 crypto/block-luks.c            |   4 +-
 crypto/block-qcow.c            |   8 +--
 crypto/block.c                 | 116 ++++++++++++++++++++-------------
 tests/unit/test-crypto-block.c |   4 --
 9 files changed, 85 insertions(+), 70 deletions(-)

-- 
2.45.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-06-03 16:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-27 15:58 [PATCH 0/2] block/crypto: do not require number of threads upfront Stefan Hajnoczi
2024-05-27 15:58 ` [PATCH 1/2] block/crypto: create ciphers on demand Stefan Hajnoczi
2024-05-27 15:58 ` [PATCH 2/2] crypto/block: drop qcrypto_block_open() n_threads argument Stefan Hajnoczi
2024-05-29 16:50 ` [PATCH 0/2] block/crypto: do not require number of threads upfront Kevin Wolf
2024-05-29 18:10   ` Stefan Hajnoczi
2024-06-03 12:37 ` Daniel P. Berrangé
2024-06-03 16:04 ` Kevin Wolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).