On Thu, Jun 02, 2022 at 07:25:48PM -0700, Eric Biggers wrote: > What if the address is in the vmalloc area and spans a page boundary? If the > next page isn't physically contiguous, this will write to some random page. A > multi-element scatterlist would be needed to describe all the physical pages. That's exactly it :) Can't believe I missed that, or that that bug was lurking for so long. > Note that in v5.5 and later, ChaCha20 support is available via the library > function chacha20_crypt(), in addition to the skcipher API. You should consider > using the library function, as it seems to match your use case. I'll check that out - that looks like exactly what I was looking for when I originally wrote this code. Thanks, I owe you a beer :)