Linux cryptographic layer development
 help / color / mirror / Atom feed
From: "Cabiddu, Giovanni" <giovanni.cabiddu@intel.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Linux Crypto Mailing List <linux-crypto@vger.kernel.org>,
	Yosry Ahmed <yosry.ahmed@linux.dev>,
	Kanchana P Sridhar <kanchana.p.sridhar@intel.com>,
	Sergey Senozhatsky <senozhatsky@chromium.org>
Subject: Re: [v3 PATCH 5/8] crypto: acomp - Add request chaining and virtual addresses
Date: Thu, 20 Mar 2025 17:24:57 +0000	[thread overview]
Message-ID: <Z9xPaQNIyFi9fiYe@gcabiddu-mobl.ger.corp.intel.com> (raw)
In-Reply-To: <e9da3237a4b9ca0a9c8aad8f182997ad14320b5a.1741488107.git.herbert@gondor.apana.org.au>

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

  parent reply	other threads:[~2025-03-20 17:25 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-09  2:43 [v3 PATCH 0/8] crypto: acomp - Add request chaining and virtual address support Herbert Xu
2025-03-09  2:43 ` [v3 PATCH 1/8] crypto: api - Add cra_type->destroy hook Herbert Xu
2025-03-09  2:43 ` [v3 PATCH 2/8] crypto: scomp - Remove tfm argument from alloc/free_ctx Herbert Xu
2025-03-09  2:43 ` [v3 PATCH 3/8] crypto: acomp - Move stream management into scomp layer Herbert Xu
2025-03-16  4:36   ` Eric Biggers
2025-03-16  4:42     ` Herbert Xu
2025-03-16  4:46       ` Herbert Xu
2025-03-16  4:44     ` Herbert Xu
2025-03-17  8:36     ` Herbert Xu
2025-03-09  2:43 ` [v3 PATCH 4/8] crypto: scomp - Disable BH when taking per-cpu spin lock Herbert Xu
2025-03-09  2:43 ` [v3 PATCH 5/8] crypto: acomp - Add request chaining and virtual addresses Herbert Xu
2025-03-16  4:49   ` Eric Biggers
2025-03-16  5:43     ` Herbert Xu
2025-03-16  6:50       ` Eric Biggers
2025-03-20 17:24   ` Cabiddu, Giovanni [this message]
2025-03-21  2:33     ` Herbert Xu
2025-03-24  9:39       ` Cabiddu, Giovanni
2025-03-09  2:43 ` [v3 PATCH 6/8] crypto: testmgr - Remove NULL dst acomp tests Herbert Xu
2025-03-09  2:43 ` [v3 PATCH 7/8] crypto: scomp - Remove support for most non-trivial destination SG lists Herbert Xu
2025-03-10 19:31   ` Dan Carpenter
2025-03-11  3:13     ` Herbert Xu
2025-03-11  3:16       ` Herbert Xu
2025-03-09  2:43 ` [v3 PATCH 8/8] crypto: scomp - Add chaining and virtual address support Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z9xPaQNIyFi9fiYe@gcabiddu-mobl.ger.corp.intel.com \
    --to=giovanni.cabiddu@intel.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=kanchana.p.sridhar@intel.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=senozhatsky@chromium.org \
    --cc=yosry.ahmed@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox