All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frank Li <Frank.li@oss.nxp.com>
To: Daniel Byrne <daniel1.byrne@intel.com>
Cc: Vinod Koul <vkoul@kernel.org>,
	dmaengine@vger.kernel.org,
	Vinicius Costa Gomes <vinicius.gomes@intel.com>,
	Dave Jiang <dave.jiang@intel.com>, Frank Li <Frank.Li@kernel.org>,
	Fenghua Yu <fenghuay@nvidia.com>, Dan Williams <djbw@kernel.org>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v2 06/10] dmaengine: idxd: read GENCFG before clearing the event log enable
Date: Thu, 3 Dec 2026 11:49:26 -0600	[thread overview]
Message-ID: <axGrpsyARtaOWzqU@SMW015318> (raw)
In-Reply-To: <20261130194721.1900266-7-daniel1.byrne@intel.com>

On Mon, Nov 30, 2026 at 11:47:17AM -0800, Daniel Byrne wrote:
> idxd_device_evl_free() clears the event log enable in a GENCFG value it
> never read. The other 31 bits it writes back are whatever the stack
> held, whereas the setup path and the GENCTRL update three lines below
> read the register first. Every unbind of the device driver, and both of
> its probe error paths, therefore program an arbitrary read buffer limit
> and arbitrary reserved bits. The limit is rewritten on the next enable
> only when one was configured, so with the default of none the arbitrary
> one stays in effect until the next device reset. The read was dropped
> with the evl_en test on the remove path when the log's memory leak was
> fixed.
>
> Read the register before changing the bit.
>
> Fixes: ee66bc295783 ("dmaengine: idxd: Fix leaking event log memory")
> Cc: stable@vger.kernel.org # 7.0+
> Signed-off-by: Daniel Byrne <daniel1.byrne@intel.com>
> ---

Reviewed-by: Frank Li <Frank.Li@nxp.com>

> New in v2.
>
>  drivers/dma/idxd/device.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/dma/idxd/device.c b/drivers/dma/idxd/device.c
> index 131138483b87..83665f7d8d6f 100644
> --- a/drivers/dma/idxd/device.c
> +++ b/drivers/dma/idxd/device.c
> @@ -835,6 +835,7 @@ static void idxd_device_evl_free(struct idxd_device *idxd)
>  		return;
>
>  	mutex_lock(&evl->lock);
> +	gencfg.bits = ioread32(idxd->reg_base + IDXD_GENCFG_OFFSET);
>  	gencfg.evl_en = 0;
>  	iowrite32(gencfg.bits, idxd->reg_base + IDXD_GENCFG_OFFSET);
>
> --
> 2.43.0
>

  reply	other threads:[~2026-12-03 17:49 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 19:47 [PATCH v2 00/10] dmaengine: idxd: event log, cdev and prep fixes Daniel Byrne
2026-11-30 19:47 ` [PATCH v2 01/10] dmaengine: idxd: don't queue EVL fault work for kernel WQs Daniel Byrne
2026-12-03 17:47   ` Frank Li
2026-11-30 19:47 ` [PATCH v2 02/10] dmaengine: idxd: detach the user fault workqueue under the event log lock Daniel Byrne
2026-12-03 17:47   ` Frank Li
2026-11-30 19:47 ` [PATCH v2 03/10] dmaengine: idxd: free the event log fault item when no record is copied Daniel Byrne
2026-12-03 17:47   ` Frank Li
2026-11-30 19:47 ` [PATCH v2 04/10] dmaengine: idxd: refuse a memcpy longer than the WQ max transfer size Daniel Byrne
2026-12-03 17:48   ` Frank Li
2026-12-04 20:43     ` Daniel Byrne
2026-11-30 19:47 ` [PATCH v2 05/10] dmaengine: idxd: take an mm_users reference for the completion record copy Daniel Byrne
2026-12-03 17:49   ` Frank Li
2026-11-30 19:47 ` [PATCH v2 06/10] dmaengine: idxd: read GENCFG before clearing the event log enable Daniel Byrne
2026-12-03 17:49   ` Frank Li [this message]
2026-11-30 19:47 ` [PATCH v2 07/10] dmaengine: idxd: don't sleep for a descriptor in the prep callbacks Daniel Byrne
2026-12-03 17:49   ` Frank Li
2026-11-30 19:47 ` [PATCH v2 08/10] dmaengine: idxd: read the event log size under its lock in the setup Daniel Byrne
2026-12-03 17:50   ` Frank Li
2026-11-30 19:47 ` [PATCH v2 09/10] dmaengine: idxd: free the queue interrupt when the percpu_ref setup fails Daniel Byrne
2026-12-03 17:44   ` Frank Li
2026-12-04 20:44     ` Daniel Byrne
2026-11-30 19:47 ` [PATCH v2 10/10] dmaengine: idxd: test a queue under its lock before quiescing it Daniel Byrne
2026-11-30 20:09   ` sashiko-bot
2026-11-30 21:06     ` Daniel Byrne

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=axGrpsyARtaOWzqU@SMW015318 \
    --to=frank.li@oss.nxp.com \
    --cc=Frank.Li@kernel.org \
    --cc=daniel1.byrne@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=djbw@kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=fenghuay@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --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 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.