From: David Arcari <darcari@redhat.com>
To: alexander.shishkin@linux.intel.com
Cc: linux-kernel@vger.kernel.org, jerry.hoemann@hpe.com,
David Arcari <darcari@redhat.com>
Subject: [PATCH v2] intel_th: core: fix null pointer dereference in intel_th_irq
Date: Tue, 18 Nov 2025 16:21:06 -0500 [thread overview]
Message-ID: <20251118212106.541728-1-darcari@redhat.com> (raw)
In-Reply-To: <20250825174554.925679-1-darcari@redhat.com>
In certain cases intel_th_irq can reference a null entry in
the th->thdev array. This results in the splat shown below.
The problem is that intel_th_output_enable() can modify the
thdev[] array at the same time intel_th_irq is referencing
the same array. This can be fixed by disabling interrupts
during the call to intel_th_output_enable().
BUG: kernel NULL pointer dereference, address: 0000000000000304
Oops: Oops: 0000 [#1] SMP NOPTI
RIP: 0010:intel_th_irq+0x26/0x70 [intel_th]
Call Trace:
<IRQ>
? show_trace_log_lvl+0x1b0/0x2f0
? show_trace_log_lvl+0x1b0/0x2f0
? __handle_irq_event_percpu+0x4a/0x180
? __die_body.cold+0x8/0x12
? page_fault_oops+0x148/0x160
? exc_page_fault+0x73/0x160
? asm_exc_page_fault+0x26/0x30
? intel_th_irq+0x26/0x70 [intel_th]
__handle_irq_event_percpu+0x4a/0x180
handle_irq_event+0x38/0x80
handle_fasteoi_irq+0x78/0x200
__common_interrupt+0x3e/0x90
common_interrupt+0x80/0xa0
</IRQ>
Fixes: a753bfcfdb1f ("intel_th: Make the switch allocate its subdevices")
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: linux-kernel@vger.kernel.org
Cc: Jerry Hoemann <jerry.hoemann@hpe.com>
Signed-off-by: David Arcari <darcari@redhat.com>
---
v2: switched to use scoped based lock guard functionality
drivers/hwtracing/intel_th/core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th/core.c
index 47d9e6c3bac0..7b7dcc651efe 100644
--- a/drivers/hwtracing/intel_th/core.c
+++ b/drivers/hwtracing/intel_th/core.c
@@ -717,6 +717,8 @@ int intel_th_output_enable(struct intel_th *th, unsigned int otype)
struct intel_th_device *thdev;
int src = 0, dst = 0;
+ guard(disable_irq)(&th->irq);
+
for (src = 0, dst = 0; dst <= th->num_thdevs; src++, dst++) {
for (; src < ARRAY_SIZE(intel_th_subdevices); src++) {
if (intel_th_subdevices[src].type != INTEL_TH_OUTPUT)
--
2.51.0
next prev parent reply other threads:[~2025-11-18 21:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-25 17:45 [PATCH] " David Arcari
2025-09-04 17:41 ` David Arcari
2025-09-26 16:19 ` alex
2025-09-26 20:12 ` David Arcari
2025-09-27 14:54 ` Markus Elfring
2025-09-29 12:05 ` David Arcari
2025-11-18 21:21 ` David Arcari [this message]
2025-11-19 12:55 ` [PATCH v2] " Markus Elfring
2025-11-20 12:32 ` David Arcari
2025-11-20 13:07 ` [v2] " Markus Elfring
2025-11-20 13:22 ` David Arcari
2026-01-16 12:49 ` Alexander Shishkin
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=20251118212106.541728-1-darcari@redhat.com \
--to=darcari@redhat.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=jerry.hoemann@hpe.com \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®