From: sashiko-bot@kernel.org
To: "Pavitrakumar Managutte" <pavitrakumarm@vayavyalabs.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v19 3/4] crypto: spacc - Add SPAcc AUTODETECT Support
Date: Wed, 29 Jul 2026 10:42:26 +0000 [thread overview]
Message-ID: <20260729104227.3C3BF1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260729102547.159890-4-pavitrakumarm@vayavyalabs.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Unbounded wait_event() in spacc_check_modes() can hang the kernel unkillably on hardware failure
--
--- Patch [3]: [PATCH v19 3/4] crypto: spacc - Add SPAcc AUTODETECT Support ---
commit 962d554e2ceb06aab36f424093e873ccc473ceb6
Author: Pavitrakumar Managutte <pavitrakumarm@vayavyalabs.com>
crypto: spacc - Add SPAcc AUTODETECT Support
This commit adds autodetect configuration support to the SPAcc driver.
It attempts to automatically detect the supported cryptographic algorithms
at runtime instead of relying on a static configuration.
> diff --git a/drivers/crypto/dwc-spacc/spacc_core.c b/drivers/crypto/dwc-spacc/spacc_core.c
> index b4eaab534c8ee..ec77a13612756 100644
> --- a/drivers/crypto/dwc-spacc/spacc_core.c
> +++ b/drivers/crypto/dwc-spacc/spacc_core.c
[ ... ]
> + err = spacc_packet_enqueue_ddt(spacc, rc, ddt, ddt, proclen, 0,
> + aadlen, 0, 0, 0);
> + job = &spacc->job[rc];
> +
> + if (err == 0) {
> + /*
> + * No timeout, not interruptible: this only returns once
> + * job_done is actually true, i.e. the hardware has
> + * genuinely relinquished the job. That guarantees it is
> + * always safe to close the job/context and (via the
> + * caller) free the DMA buffer immediately below --
> + * there is no "unconfirmed" case left to handle.
> + *
> + * Tradeoff: if the hardware ever genuinely fails to
> + * complete a submitted job, this hangs here
> + * unkillably (TASK_UNINTERRUPTIBLE, no timeout) for the
> + * rest of probe. Accepted deliberately in place of the
> + * abandoned-job/UAF risk of giving up early with no
> + * hardware cancel available.
> + */
> + wait_event(job->waitq, job->job_done);
^^^^^^^^^^
[Severity: High]
Is it safe to use an unbounded wait here?
If the hardware is faulty or drops the interrupt, wait_event() will hang
indefinitely in TASK_UNINTERRUPTIBLE (D-state). If the driver is built-in,
this would hang the entire kernel boot process. If it is loaded as a module,
it permanently hangs the loading process.
While the comment explains this is a deliberate tradeoff to avoid a
use-after-free, could we use wait_event_timeout() instead? If the timeout
expires, the driver could fail the probe and intentionally leak the DMA
buffers and job context (or reset the hardware block) to safely prevent the
UAF without permanently hanging the system.
> +
> + job->job_done = 0;
> + err = job->job_err;
> + }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260729102547.159890-1-pavitrakumarm@vayavyalabs.com?part=3
next prev parent reply other threads:[~2026-07-29 10:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-29 10:25 [PATCH v19 0/4] crypto: spacc - Add SPAcc Crypto Driver Pavitrakumar Managutte
2026-07-29 10:25 ` [PATCH v19 1/4] dt-bindings: crypto: Document support for SPAcc Pavitrakumar Managutte
2026-07-29 10:25 ` [PATCH v19 2/4] crypto: spacc - Add SPAcc ahash support Pavitrakumar Managutte
2026-07-29 10:50 ` sashiko-bot
2026-07-29 10:25 ` [PATCH v19 3/4] crypto: spacc - Add SPAcc AUTODETECT Support Pavitrakumar Managutte
2026-07-29 10:42 ` sashiko-bot [this message]
2026-07-29 10:25 ` [PATCH v19 4/4] crypto: spacc - Add SPAcc Kconfig and Makefile Pavitrakumar Managutte
2026-07-29 10:38 ` sashiko-bot
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=20260729104227.3C3BF1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=pavitrakumarm@vayavyalabs.com \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.