All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: kernel test robot <oliver.sang@intel.com>
Cc: oe-lkp@lists.linux.dev, lkp@intel.com,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [peterz-queue:perf/pmu-unregister] [perf] 4cbf3df69c: BUG:kernel_NULL_pointer_dereference,address
Date: Fri, 25 Oct 2024 10:20:17 +0200	[thread overview]
Message-ID: <20241025082017.GF14555@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <202410251048.2505fe51-lkp@intel.com>

On Fri, Oct 25, 2024 at 10:19:41AM +0800, kernel test robot wrote:
> 
> 
> Hello,
> 
> kernel test robot noticed "BUG:kernel_NULL_pointer_dereference,address" on:
> 
> commit: 4cbf3df69c5697061018989b08423d4c04bbe101 ("perf: Make perf_pmu_unregister() useable")
> https://git.kernel.org/cgit/linux/kernel/git/peterz/queue.git perf/pmu-unregister
> 
> in testcase: trinity
> version: trinity-x86_64-ba2360ed-1_20240923
> with following parameters:
> 
> 	runtime: 600s
> 
> 
> 
> config: x86_64-kexec
> compiler: clang-18
> test machine: qemu-system-x86_64 -enable-kvm -cpu SandyBridge -smp 2 -m 16G
> 
> (please refer to attached dmesg/kmsg for entire log/backtrace)
> 
> 
> +-----------------------------------------------------------+------------+------------+
> |                                                           | d4187ab34e | 4cbf3df69c |
> +-----------------------------------------------------------+------------+------------+
> | BUG:kernel_NULL_pointer_dereference,address               | 0          | 15         |
> | Oops                                                      | 0          | 15         |
> | RIP:__free_event                                          | 0          | 15         |
> | Kernel_panic-not_syncing:Fatal_exception                  | 0          | 15         |
> +-----------------------------------------------------------+------------+------------+
> 
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <oliver.sang@intel.com>
> | Closes: https://lore.kernel.org/oe-lkp/202410251048.2505fe51-lkp@intel.com
> 
> 
> [   27.301103][ T3733] BUG: kernel NULL pointer dereference, address: 0000000000000008
> [   27.302392][ T3733] #PF: supervisor write access in kernel mode
> [   27.303317][ T3733] #PF: error_code(0x0002) - not-present page
> [   27.304207][ T3733] PGD 80000001bfbc3067 P4D 80000001bfbc3067 PUD 1ae899067 PMD 0
> [   27.305417][ T3733] Oops: Oops: 0002 [#1] PREEMPT SMP PTI
> [   27.306260][ T3733] CPU: 0 UID: 65534 PID: 3733 Comm: trinity-c0 Not tainted 6.12.0-rc2-00028-g4cbf3df69c56 #1
> [   27.307747][ T3733] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
> [ 27.309232][ T3733] RIP: 0010:__free_event (include/linux/list.h:195 include/linux/list.h:218 include/linux/list.h:229 kernel/events/core.c:5395) 

> [ 27.334428][ T3733] ? __free_event (include/linux/list.h:195 include/linux/list.h:218 include/linux/list.h:229 kernel/events/core.c:5395) 
> [ 27.335253][ T3733] ? __free_event (include/linux/list.h:218 include/linux/list.h:229 kernel/events/core.c:5395) 
> [ 27.336027][ T3733] perf_event_alloc (kernel/events/core.c:12566) 
> [ 27.336836][ T3733] __se_sys_perf_event_open (kernel/events/core.c:12978) 
> [ 27.337703][ T3733] ? enqueue_hrtimer (kernel/time/hrtimer.c:1093) 
> [ 27.338512][ T3733] ? hrtimer_start_range_ns (kernel/time/hrtimer.c:1302) 
> [ 27.339427][ T3733] do_syscall_64 (arch/x86/entry/common.c:?) 
> [ 27.340215][ T3733] ? irqentry_exit_to_user_mode (arch/x86/include/asm/processor.h:701 arch/x86/include/asm/entry-common.h:100 include/linux/entry-common.h:364 kernel/entry/common.c:233) 

This might help... Let me fold that and push out an updated brranch.

--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -12395,6 +12395,7 @@ perf_event_alloc(struct perf_event_attr
 	INIT_LIST_HEAD(&event->active_entry);
 	INIT_LIST_HEAD(&event->addr_filters.list);
 	INIT_HLIST_NODE(&event->hlist_entry);
+	INIT_LIST_HEAD(&event->pmu_list);
 
 
 	init_waitqueue_head(&event->waitq);

      reply	other threads:[~2024-10-25  8:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-25  2:19 [peterz-queue:perf/pmu-unregister] [perf] 4cbf3df69c: BUG:kernel_NULL_pointer_dereference,address kernel test robot
2024-10-25  8:20 ` Peter Zijlstra [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=20241025082017.GF14555@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=oe-lkp@lists.linux.dev \
    --cc=oliver.sang@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 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.