Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Daniel Byrne <daniel1.byrne@intel.com>
To: Vinod Koul <vkoul@kernel.org>, Dave Jiang <dave.jiang@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>, Dan Williams <djbw@kernel.org>,
	Vinicius Costa Gomes <vinicius.gomes@intel.com>,
	Frank Li <Frank.Li@kernel.org>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Tom Zanussi <tom.zanussi@linux.intel.com>,
	Kristen Accardi <kristen.c.accardi@intel.com>,
	dmaengine@vger.kernel.org, linux-crypto@vger.kernel.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: [PATCH 00/17] [PATCH 00/17] dmaengine: idxd: fixes found by an in-kernel polling client
Date: Mon, 19 Oct 2026 08:06:13 -0700	[thread overview]
Message-ID: <20261019150630.4026341-1-daniel1.byrne@intel.com> (raw)

These are fixes for bugs in the idxd driver that an in-kernel polling
client exposed while sharing DSA work queues between many io_uring rings
(that client is to be posted separately as "io_uring: DMA-engine copy offload
for buffered file I/O"). They apply to v7.3 on their own and do not
depend on that series. Each patch says which released kernels it
affects; the ones that fit stable are tagged.

In short:
 - the event-log fault path dereferences a NULL workqueue on a kernel WQ
   (stable, 6.4+), plus a hardening of the user WQ's workqueue teardown;
 - a memcpy longer than the work queue's transfer limit is accepted at
   prep and fails silently in hardware (stable, 5.10+);
 - a channel is listed before it is complete, and a failed registration
   leaves a freed channel on the list (stable, 5.13+);
 - the device driver is unbound after its work queues were freed;
 - terminate_all releases the work queue's interrupt handle for good
   (stable, 7.0+);
 - device commands wait forever, and the interrupt-handle release writes
   over a running command; the device disable misreads the fail-fast
   status as "already disabled"; the device is disabled after its
   queues' software state is gone; a reset loses the command interrupt
   it re-creates;
 - terminate_all frees descriptor slots the device still holds, and
   drains and resets report a timeout as a completed drain;
 - a descriptor whose submission failed is freed twice (stable, 5.14+);
 - an iaa_crypto descriptor is completed as a dmaengine transaction on
   abort and flush (stable, 6.8+);
 - software- and system-reset halts never flush the work queues, a halt
   flush strips the callbacks of live clients, and the interrupt-handle
   revoke runs without the queue lock.

Tested on a Granite Rapids system with four DSA devices: crc32c-verified
DMA I/O from the io_uring client under WQ unbind, live unbind and rebind,
driver unbind, PCI FLR and PCI driver unbind and rebind, on a v7.2-based
tree, clean under KASAN, DMA_API_DEBUG and lockdep; the v7.3 rebase is
conflict-free and build-tested per patch.

Daniel Byrne (17):
  dmaengine: idxd: don't queue EVL fault work for kernel WQs
  dmaengine: idxd: detach the user fault workqueue under the event log
    lock
  dmaengine: idxd: refuse a memcpy longer than the WQ max transfer size
  dmaengine: idxd: list a new channel only once it is complete
  dmaengine: idxd: unbind the device driver before its work queues go
    away
  dmaengine: idxd: keep the interrupt handle across terminate_all
  dmaengine: idxd: bound device command waits and fail fast after a
    timeout
  dmaengine: idxd: compare the device disable status code whole
  dmaengine: idxd: quarantine terminate_all's descriptor slots until the
    device has drained
  dmaengine: idxd: return -ETIMEDOUT from drains and resets and leak
    what the device may still write
  dmaengine: idxd: disable the device before its work queues are
    unregistered
  dmaengine: idxd: hold device commands off while the reset re-creates
    its interrupts
  dmaengine: idxd: fix the double free of a descriptor whose submission
    failed
  dmaengine: idxd: complete an iaa_crypto descriptor through its own
    driver on abort and flush
  dmaengine: idxd: flush the work queues on every halt type
  dmaengine: idxd: keep client callbacks on a halt flush and cancel
    resubmissions after a terminate
  dmaengine: idxd: run the interrupt-handle revoke under the queue lock

 drivers/dma/dmaengine.c   |  41 +++
 drivers/dma/idxd/cdev.c   |  62 +++-
 drivers/dma/idxd/device.c | 588 ++++++++++++++++++++++++++++++++++----
 drivers/dma/idxd/dma.c    |  60 +++-
 drivers/dma/idxd/idxd.h   |  53 +++-
 drivers/dma/idxd/init.c   |  64 ++++-
 drivers/dma/idxd/irq.c    | 258 +++++++++++++----
 drivers/dma/idxd/submit.c | 158 ++++++++--
 include/linux/dmaengine.h |   2 +
 9 files changed, 1109 insertions(+), 177 deletions(-)


base-commit: c03c1a14507dfaf8b856c2608f9ac216021fc222
-- 
2.43.0


             reply	other threads:[~2026-10-19 15:14 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-19 15:06 Daniel Byrne [this message]
2026-10-19 15:06 ` [PATCH 01/17] dmaengine: idxd: don't queue EVL fault work for kernel WQs Daniel Byrne
2026-10-19 15:06 ` [PATCH 02/17] dmaengine: idxd: detach the user fault workqueue under the event log lock Daniel Byrne
2026-10-19 15:06 ` [PATCH 03/17] dmaengine: idxd: refuse a memcpy longer than the WQ max transfer size Daniel Byrne
2026-10-19 21:19   ` Frank Li
2026-10-19 15:06 ` [PATCH 04/17] dmaengine: idxd: list a new channel only once it is complete Daniel Byrne
2026-10-19 15:06 ` [PATCH 05/17] dmaengine: idxd: unbind the device driver before its work queues go away Daniel Byrne
2026-10-19 15:06 ` [PATCH 06/17] dmaengine: idxd: keep the interrupt handle across terminate_all Daniel Byrne
2026-10-19 15:06 ` [PATCH 07/17] dmaengine: idxd: bound device command waits and fail fast after a timeout Daniel Byrne
2026-10-19 15:06 ` [PATCH 08/17] dmaengine: idxd: compare the device disable status code whole Daniel Byrne
2026-10-19 15:06 ` [PATCH 09/17] dmaengine: idxd: quarantine terminate_all's descriptor slots until the device has drained Daniel Byrne
2026-10-19 15:06 ` [PATCH 10/17] dmaengine: idxd: return -ETIMEDOUT from drains and resets and leak what the device may still write Daniel Byrne
2026-10-19 15:06 ` [PATCH 11/17] dmaengine: idxd: disable the device before its work queues are unregistered Daniel Byrne
2026-10-19 15:06 ` [PATCH 12/17] dmaengine: idxd: hold device commands off while the reset re-creates its interrupts Daniel Byrne
2026-10-19 15:06 ` [PATCH 13/17] dmaengine: idxd: fix the double free of a descriptor whose submission failed Daniel Byrne
2026-10-19 15:06 ` [PATCH 14/17] dmaengine: idxd: complete an iaa_crypto descriptor through its own driver on abort and flush Daniel Byrne
2026-10-19 15:06 ` [PATCH 15/17] dmaengine: idxd: flush the work queues on every halt type Daniel Byrne
2026-10-19 15:06 ` [PATCH 16/17] dmaengine: idxd: keep client callbacks on a halt flush and cancel resubmissions after a terminate Daniel Byrne
2026-10-19 15:06 ` [PATCH 17/17] dmaengine: idxd: run the interrupt-handle revoke under the queue lock Daniel Byrne
2026-10-19 19:09 ` [PATCH 00/17] [PATCH 00/17] dmaengine: idxd: fixes found by an in-kernel polling client Frank Li

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=20261019150630.4026341-1-daniel1.byrne@intel.com \
    --to=daniel1.byrne@intel.com \
    --cc=Frank.Li@kernel.org \
    --cc=dave.jiang@intel.com \
    --cc=djbw@kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=fenghua.yu@intel.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=kristen.c.accardi@intel.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tom.zanussi@linux.intel.com \
    --cc=vinicius.gomes@intel.com \
    --cc=vkoul@kernel.org \
    /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