On Mon, 28 Jul 2025, Harald Freudenberger wrote:

> > > > > Mikulas Patocka (2):
> > > > >   dm-integrity: use internal variable for digestsize
> > > > >   dm-integrity: introduce ahash support for the internal hash
> > > > >
> > > > >  drivers/md/dm-integrity.c | 370
> > > > > +++++++++++++++++++++++++++-----------
> > > > >  1 file changed, 265 insertions(+), 105 deletions(-)

Hi

I reviewed the code and unfortunatelly I found out that it is buggy (I 
didn't notice the bugs before, when I was working on it).

integrity_ahash_sector_checksum uses sg_set_buf and sg_set_buf needs 
directly mapped memory. It doesn't work with vmalloc memory and it doesn't 
work with memory obtained from kmap.

The result buffer may be vmallocated memory (if we have 
CONFIG_VMAP_STACK).

I'd like to ask the maintainers of crypto-api - Herbert or David - what if 
I pass vmalloc-allocated memory (or possibly stack memory) as "result" to 
ahash_request_set_crypt(req, sg, result, nbytes);? Is it legal or not?

Mikulas


Reply via email to