From: Jonathan Cameron <jic23@kernel.org>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: Jiale Yao <yaojiale02@163.com>, Dave Jiang <dave.jiang@intel.com>,
Alison Schofield <alison.schofield@intel.com>,
Vishal Verma <vishal.l.verma@intel.com>,
Dan Williams <djbw@kernel.org>, Ira Weiny <iweiny@kernel.org>,
Li Ming <ming.li@zohomail.com>,
linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: Re: [PATCH] cxl/acpi: Check ACPI companion before use
Date: Fri, 25 Sep 2026 23:47:17 +0100 [thread overview]
Message-ID: <20260925234718.37fdcc56@jic23-hlaptop> (raw)
In-Reply-To: <20260924164247.rsb4h7qjx5bvrthg@offworld>
On Thu, 24 Sep 2026 09:42:47 -0700
Davidlohr Bueso <dave@stgolabs.net> wrote:
> On Thu, 24 Sep 2026, Jiale Yao wrote:
>
> >Platform drivers can be forced to match devices outside their ID tables
> >through driver_override. cxl_acpi_probe() assumes that every bound device
> >has an ACPI companion and dereferences adev->dev.bus without checking the
> >result of ACPI_COMPANION(). Force-binding cxl_acpi to a platform device
> >without a companion therefore causes a NULL pointer dereference.
> >
> >This was reproduced by setting the driver override for the pcspkr platform
> >device to cxl_acpi and binding it through sysfs:
> >
> > BUG: kernel NULL pointer dereference, address: 0000000000000280
> > #PF: supervisor read access in kernel mode
> > RIP: cxl_acpi_probe+0xf4/0x220
> > Call Trace:
> > platform_probe+0x4d/0x80
> > really_probe+0x106/0x370
> > device_driver_attach+0x4c/0xa0
> > bind_store+0xd0/0x100
> >
> >Commit 2b3a5dabe89e ("platform/surface: acpi-notify: Check ACPI
> >companion before use") fixed the same force-binding issue in another
> >platform driver. Check the companion before setting up the CXL root and
> >return -ENODEV when it is absent.
> >
> >Fixes: 7d4b5ca2e2cb ("cxl/acpi: Add downstream port data to cxl_port instances")
> >Cc: stable@vger.kernel.org
> >Signed-off-by: Jiale Yao <yaojiale02@163.com>
>
> With Dave's comment,
>
> Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>
Andy Shevchenko was looking at ways to have drivers set a flag to
disable matches on driver_override. Not sure if that is still ongoing.
+CC Andy
Jonathan
prev parent reply other threads:[~2026-09-25 22:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-24 12:54 Jiale Yao
2026-09-24 14:17 ` Dave Jiang
2026-09-24 16:42 ` Davidlohr Bueso
2026-09-25 22:47 ` Jonathan Cameron [this message]
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=20260925234718.37fdcc56@jic23-hlaptop \
--to=jic23@kernel.org \
--cc=alison.schofield@intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=djbw@kernel.org \
--cc=iweiny@kernel.org \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.li@zohomail.com \
--cc=stable@vger.kernel.org \
--cc=vishal.l.verma@intel.com \
--cc=yaojiale02@163.com \
/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
all inboxes | Powered by JetHome®