Linux CXL
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Dave Jiang <dave.jiang@intel.com>
Cc: linux-cxl@vger.kernel.org, dave@stgolabs.net,
	alison.schofield@intel.com, ming.li@zohomail.com,
	icheng@nvidia.com, stable@vger.kernel.org
Subject: Re: [PATCH 1/2] cxl/port: Clear cached dport pointers when a dport is removed
Date: Fri, 25 Sep 2026 23:51:39 +0100	[thread overview]
Message-ID: <20260925235139.47f78065@jic23-hlaptop> (raw)
In-Reply-To: <20260924212159.52920-2-dave.jiang@intel.com>

On Thu, 24 Sep 2026 14:21:58 -0700
Dave Jiang <dave.jiang@intel.com> wrote:

> Switch decoders cache dport pointers in cxlsd->target[], and nothing
> clears them when a dport is freed. Readers then dereference freed memory.
> 
> KASAN caught it under a cxl_test load/unload loop with concurrent sysfs
> reads (abbreviated).
> 
> Clear the matching slots from cxl_dport_remove(), walking the port's
> decoders the way cxl_port_update_decoder_targets() does on the add side.
> Scan all nr_targets slots, the target[] allocation size, and clear every
> hit.
> 
> Fixes: 8330671c57c7 ("cxl: Add helper to delete dport")
> Cc: stable@vger.kernel.org
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
> Assisted-by: LLM
Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>

  reply	other threads:[~2026-09-25 22:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24 21:21 [PATCH 0/2] cxl: dport fixes from sashiko reports Dave Jiang
2026-09-24 21:21 ` [PATCH 1/2] cxl/port: Clear cached dport pointers when a dport is removed Dave Jiang
2026-09-25 22:51   ` Jonathan Cameron [this message]
2026-09-24 21:21 ` [PATCH 2/2] cxl/core: Hold the dport host lock across dport lookup and use Dave Jiang
2026-09-25 23:07   ` Jonathan Cameron

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=20260925235139.47f78065@jic23-hlaptop \
    --to=jic23@kernel.org \
    --cc=alison.schofield@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=icheng@nvidia.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=ming.li@zohomail.com \
    --cc=stable@vger.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