Re: [v3 PATCH 5/8] crypto: acomp - Add request chaining and virtual addresses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Mar 09, 2025 at 10:43:21AM +0800, Herbert Xu wrote:
> This adds request chaining and virtual address support to the
> acomp interface.
> 
> It is identical to the ahash interface, except that a new flag
> CRYPTO_ACOMP_REQ_NONDMA has been added to indicate that the
> virtual addresses are not suitable for DMA.  This is because
> all existing and potential acomp users can provide memory that
> is suitable for DMA so there is no need for a fall-back copy
> path.

...

> +static int acomp_reqchain_finish(struct acomp_req_chain *state,
> +				 int err, u32 mask)
> +{
> +	struct acomp_req *req0 = state->req0;
> +	struct acomp_req *req = state->cur;
> +	struct acomp_req *n;
> +
> +	acomp_reqchain_virt(state, err);
> +
> +	if (req != req0)
I'm hitting a NULL pointer dereference at this point as req0 is NULL.

I'm using b67a02600372 ("crypto: acomp - Add request chaining and
virtual addresses") from your tree.
I wrote a simple test that chains a bunch of requests following the same
pattern in tcrypt for ahash.

Here is how I'm using the API high level. For now, I'm using the software
implementation of deflate (deflate-scomp):

    tfm = crypto_alloc_acomp("deflate", 0, 0);

    req0 = acomp_request_alloc(tfm);
    req1 = acomp_request_alloc(tfm);
    req2 = acomp_request_alloc(tfm);

    acomp_request_set_params(req0, ...);
    acomp_request_set_params(req1, ...);
    acomp_request_set_params(req2, ...);

    acomp_request_set_callback(req0, 0, crypto_req_done, &wait);
    acomp_request_set_callback(req1, 0, NULL, NULL);
    acomp_request_set_callback(req2, 0, NULL, NULL);

    head = req0;
    acomp_request_chain(req1, head);
    acomp_request_chain(req2, head);

    ret = crypto_acomp_compress(req0);$
    ...

Do you see anything wrong?
Do you have any documentation or a sample showing how to use these APIs?

Thanks,

-- 
Giovanni




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux