All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Lynch <nathan.lynch@amd.com>
To: Vinicius Costa Gomes <vinicius.gomes@intel.com>,
	Dave Jiang <dave.jiang@intel.com>, Vinod Koul <vkoul@kernel.org>,
	Fenghua Yu <fenghua.yu@intel.com>,
	Dan Williams <dan.j.williams@intel.com>
Cc: <dmaengine@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/9] dmaengine: idxd: Fix possible invalid memory access after FLR
Date: Fri, 15 Aug 2025 14:26:53 -0500	[thread overview]
Message-ID: <87349sgzcy.fsf@AUSNATLYNCH.amd.com> (raw)
In-Reply-To: <20250804-idxd-fix-flr-on-kernel-queues-v3-v1-3-4e020fbf52c1@intel.com>

Vinicius Costa Gomes <vinicius.gomes@intel.com> writes:

> In the case that the first Field Level Reset (FLR) concludes

I think you mean Function Level Reset? (here and in other changes in the
series)


> correctly, but in the second FLR the scratch area for the saved
> configuration cannot be allocated, it's possible for a invalid memory
> access to happen.
>
> Always set the deallocated scratch area to NULL after FLR completes.
>
> Fixes: 98d187a98903 ("dmaengine: idxd: Enable Function Level Reset (FLR) for halt")
> Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
> ---
>  drivers/dma/idxd/init.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/dma/idxd/init.c b/drivers/dma/idxd/init.c
> index a58b8cdbfa60ba9f00b91a737df01517885bc41a..31e00af136a7e13887d3ffd00efbb05864712a80 100644
> --- a/drivers/dma/idxd/init.c
> +++ b/drivers/dma/idxd/init.c
> @@ -1136,6 +1136,7 @@ static void idxd_reset_done(struct pci_dev *pdev)
>  	}
>  out:
>  	kfree(idxd->idxd_saved);
> +	idxd->idxd_saved = NULL;
>  }
>  
>  static const struct pci_error_handlers idxd_error_handler = {
>
> -- 
> 2.50.1

  parent reply	other threads:[~2025-08-15 19:26 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-05  1:27 [PATCH 0/9] dmaengine: idxd: Memory leak and FLR fixes Vinicius Costa Gomes
2025-08-05  1:27 ` [PATCH 1/9] dmaengine: idxd: Fix lockdep warnings when calling idxd_device_config() Vinicius Costa Gomes
2025-08-06 17:02   ` Dave Jiang
2025-08-06 20:25     ` Vinicius Costa Gomes
2025-08-05  1:27 ` [PATCH 2/9] dmaengine: idxd: Fix crash when the event log is disabled Vinicius Costa Gomes
2025-08-06 17:07   ` Dave Jiang
2025-08-05  1:27 ` [PATCH 3/9] dmaengine: idxd: Fix possible invalid memory access after FLR Vinicius Costa Gomes
2025-08-06 17:09   ` Dave Jiang
2025-08-15 19:26   ` Nathan Lynch [this message]
2025-08-15 22:45     ` Vinicius Costa Gomes
2025-08-05  1:27 ` [PATCH 4/9] dmaengine: idxd: Flush kernel workqueues on Field Level Reset Vinicius Costa Gomes
2025-08-06 17:12   ` Dave Jiang
2025-08-05  1:27 ` [PATCH 5/9] dmaengine: idxd: Allow DMA clients to empty the pending queue Vinicius Costa Gomes
2025-08-06 17:17   ` Dave Jiang
2025-08-06 20:30     ` Vinicius Costa Gomes
2025-08-05  1:27 ` [PATCH 6/9] dmaengine: idxd: Fix not releasing workqueue on .release() Vinicius Costa Gomes
2025-08-06 17:24   ` Dave Jiang
2025-08-05  1:27 ` [PATCH 7/9] dmaengine: idxd: Fix memory leak when a wq is reset Vinicius Costa Gomes
2025-08-06 17:25   ` Dave Jiang
2025-08-05  1:27 ` [PATCH 8/9] dmaengine: idxd: Fix freeing the allocated ida too late Vinicius Costa Gomes
2025-08-06 17:27   ` Dave Jiang
2025-08-05  1:28 ` [PATCH 9/9] dmaengine: idxd: Fix leaking event log memory Vinicius Costa Gomes
2025-08-06 17:29   ` Dave Jiang

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=87349sgzcy.fsf@AUSNATLYNCH.amd.com \
    --to=nathan.lynch@amd.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=fenghua.yu@intel.com \
    --cc=linux-kernel@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.