Re: [PATCH 8/9] blk-crypto: use on-stack skciphers for fallback en/decryption

Christoph Hellwig
2025-11-07T12:11:00Z

On Thu, Nov 06, 2025 at 08:18:59PM -0800, Eric Biggers wrote:
> On Fri, Oct 31, 2025 at 10:34:38AM +0100, Christoph Hellwig wrote:
> > Allocating a skcipher dynamically can deadlock or cause unexpected
> > I/O failures when called from writeback context. Sidestep the
> > allocation by using on-stack skciphers, similar to what the non
> > blk-crypto fscrypt already does.
> >
> > Signed-off-by: Christoph Hellwig <hch@lst.de>
>
> It might be worth leaving a note in the commit message that this also
> drops the incomplete support for asynchronous algorithms. ("Incomplete"
> in the sense that they could be used, but only synchronously.)

sure.

> Also note that with asynchronous algorithms no being longer supported,
> the code can actually be simplified further because the
> DECLARE_CRYPTO_WAIT(wait) objects are no longer necessary. The sequence
> of crypto_sync_skcipher calls that is used should be similar to what
> fscrypt_crypt_data_unit() does.

Ok.