Linux Trace Kernel
 help / color / mirror / Atom feed
From: Avi Weiss <thnkslprpt@gmail.com>
To: rostedt@goodmis.org, gmonaco@redhat.com
Cc: mhiramat@kernel.org, mathieu.desnoyers@efficios.com,
	linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Avi Weiss <thnkslprpt@gmail.com>
Subject: [PATCH] rv: Fix empty tail container detection
Date: Mon, 16 Nov 2026 10:45:30 +0200	[thread overview]
Message-ID: <20261116084530.87088-1-thnkslprpt@gmail.com> (raw)

rv_is_container_monitor() returns false for the last list entry
before checking its enable callback. With CONFIG_RV_MON_DEADLINE=y
and CONFIG_RV_MON_NOMISS=n, the empty deadline container can be
last. Enabling it then calls a NULL callback through
rv_enable_single(), causing a kernel oops.

An empty non-tail container already enables successfully: it is
marked enabled without activating any child monitors. Preserve this
behavior regardless of list position by checking the tail entry's
enable callback. Keep the tail check before list_next_entry() to
avoid accessing the list head as a monitor.

Fixes: 8d7861ac507d ("rv: Fix out-of-bound memory access in rv_is_container_monitor()")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
---
 kernel/trace/rv/rv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/rv/rv.c b/kernel/trace/rv/rv.c
index 29f155c6968b..a142e877e940 100644
--- a/kernel/trace/rv/rv.c
+++ b/kernel/trace/rv/rv.c
@@ -222,7 +222,7 @@ bool rv_is_container_monitor(struct rv_monitor *mon)
 	struct rv_monitor *next;
 
 	if (list_is_last(&mon->list, &rv_monitors_list))
-		return false;
+		return !mon->enable;
 
 	next = list_next_entry(mon, list);
 

base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
-- 
2.53.0


                 reply	other threads:[~2026-11-16  8:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261116084530.87088-1-thnkslprpt@gmail.com \
    --to=thnkslprpt@gmail.com \
    --cc=gmonaco@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=rostedt@goodmis.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