From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: "Michael J. Ruhl" <michael.j.ruhl@intel.com>
Cc: platform-driver-x86@vger.kernel.org,
intel-xe@lists.freedesktop.org,
Hans de Goede <hdegoede@redhat.com>,
lucas.demarchi@intel.com, rodrigo.vivi@intel.com,
thomas.hellstrom@linux.intel.com, airlied@gmail.com,
simona@ffwll.ch, david.e.box@linux.intel.com,
Tejas Upadhyay <tejas.upadhyay@intel.com>,
stable@vger.kernel.org
Subject: Re: [PATCH v5 01/12] platform/x86/intel/pmt: fix a crashlog NULL pointer access
Date: Mon, 30 Jun 2025 12:29:00 +0300 (EEST) [thread overview]
Message-ID: <e860ab9b-4f75-b6ef-3b82-f4e45f478d03@linux.intel.com> (raw)
In-Reply-To: <20250627204321.521628-2-michael.j.ruhl@intel.com>
On Fri, 27 Jun 2025, Michael J. Ruhl wrote:
> Usage of the intel_pmt_read() for binary sysfs, requires a pcidev. The
> current use of the endpoint value is only valid for telemetry endpoint
> usage.
>
> Without the ep, the crashlog usage causes the following NULL pointer
> exception:
>
> BUG: kernel NULL pointer dereference, address: 0000000000000000
> Oops: Oops: 0000 [#1] SMP NOPTI
> RIP: 0010:intel_pmt_read+0x3b/0x70 [pmt_class]
> Code:
> Call Trace:
> <TASK>
> ? sysfs_kf_bin_read+0xc0/0xe0
> kernfs_fop_read_iter+0xac/0x1a0
> vfs_read+0x26d/0x350
> ksys_read+0x6b/0xe0
> __x64_sys_read+0x1d/0x30
> x64_sys_call+0x1bc8/0x1d70
> do_syscall_64+0x6d/0x110
Can you confirm, if this was possible to trigger only after this series
has been applied, not with the current mainline code?
--
i.
> Augment struct intel_pmt_entry with a pointer to the pcidev to avoid
> the NULL pointer exception.
>
> Reviewed-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
> Fixes: 416eeb2e1fc7 ("platform/x86/intel/pmt: telemetry: Export API to read telemetry")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
> ---
> drivers/platform/x86/intel/pmt/class.c | 3 ++-
> drivers/platform/x86/intel/pmt/class.h | 1 +
> 2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/intel/pmt/class.c b/drivers/platform/x86/intel/pmt/class.c
> index 7233b654bbad..d046e8752173 100644
> --- a/drivers/platform/x86/intel/pmt/class.c
> +++ b/drivers/platform/x86/intel/pmt/class.c
> @@ -97,7 +97,7 @@ intel_pmt_read(struct file *filp, struct kobject *kobj,
> if (count > entry->size - off)
> count = entry->size - off;
>
> - count = pmt_telem_read_mmio(entry->ep->pcidev, entry->cb, entry->header.guid, buf,
> + count = pmt_telem_read_mmio(entry->pcidev, entry->cb, entry->header.guid, buf,
> entry->base, off, count);
>
> return count;
> @@ -252,6 +252,7 @@ static int intel_pmt_populate_entry(struct intel_pmt_entry *entry,
> return -EINVAL;
> }
>
> + entry->pcidev = pci_dev;
> entry->guid = header->guid;
> entry->size = header->size;
> entry->cb = ivdev->priv_data;
> diff --git a/drivers/platform/x86/intel/pmt/class.h b/drivers/platform/x86/intel/pmt/class.h
> index b2006d57779d..f6ce80c4e051 100644
> --- a/drivers/platform/x86/intel/pmt/class.h
> +++ b/drivers/platform/x86/intel/pmt/class.h
> @@ -39,6 +39,7 @@ struct intel_pmt_header {
>
> struct intel_pmt_entry {
> struct telem_endpoint *ep;
> + struct pci_dev *pcidev;
> struct intel_pmt_header header;
> struct bin_attribute pmt_bin_attr;
> struct kobject *kobj;
>
next prev parent reply other threads:[~2025-06-30 9:29 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-27 20:43 [PATCH v5 00/12] Crashlog Type1 Version2 support Michael J. Ruhl
2025-06-27 20:43 ` [PATCH v5 01/12] platform/x86/intel/pmt: fix a crashlog NULL pointer access Michael J. Ruhl
2025-06-30 9:29 ` Ilpo Järvinen [this message]
2025-06-30 15:00 ` Ruhl, Michael J
2025-06-27 20:43 ` [PATCH v5 02/12] drm/xe: Correct BMG VSEC header sizing Michael J. Ruhl
2025-06-30 19:57 ` Rodrigo Vivi
2025-06-30 22:00 ` Ruhl, Michael J
2025-06-27 20:43 ` [PATCH v5 03/12] platform/x86/intel/pmt: white space cleanup Michael J. Ruhl
2025-06-27 20:43 ` [PATCH v5 04/12] platform/x86/intel/pmt: mutex clean up Michael J. Ruhl
2025-06-27 20:43 ` [PATCH v5 05/12] platform/x86/intel/pmt: use guard(mutex) Michael J. Ruhl
2025-06-27 20:43 ` [PATCH v5 06/12] platform/x86/intel/pmt: re-order trigger logic Michael J. Ruhl
2025-06-27 20:43 ` [PATCH v5 07/12] platform/x86/intel/pmt: correct types Michael J. Ruhl
2025-06-27 20:43 ` [PATCH v5 08/12] platform/x86/intel/pmt: decouple sysfs and namespace Michael J. Ruhl
2025-06-27 20:43 ` [PATCH v5 09/12] platform/x86/intel/pmt: add register access helpers Michael J. Ruhl
2025-07-02 15:50 ` Ruhl, Michael J
2025-06-27 20:43 ` [PATCH v5 10/12] platform/x86/intel/pmt: refactor base parameter Michael J. Ruhl
2025-06-27 20:43 ` [PATCH v5 11/12] platform/x86/intel/pmt: use a version struct Michael J. Ruhl
2025-06-27 20:43 ` [PATCH v5 12/12] platform/x86/intel/pmt: support BMG crashlog Michael J. Ruhl
2025-06-30 20:36 ` ✓ CI.KUnit: success for Crashlog Type1 Version2 support (rev5) Patchwork
2025-06-30 21:42 ` ✓ Xe.CI.BAT: " Patchwork
2025-07-02 3:19 ` ✗ Xe.CI.Full: failure " Patchwork
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=e860ab9b-4f75-b6ef-3b82-f4e45f478d03@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=airlied@gmail.com \
--cc=david.e.box@linux.intel.com \
--cc=hdegoede@redhat.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=lucas.demarchi@intel.com \
--cc=michael.j.ruhl@intel.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=rodrigo.vivi@intel.com \
--cc=simona@ffwll.ch \
--cc=stable@vger.kernel.org \
--cc=tejas.upadhyay@intel.com \
--cc=thomas.hellstrom@linux.intel.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