lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240916102741.GA13899@redhat.com>
Date: Mon, 16 Sep 2024 12:27:41 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Steven Rostedt <rostedt@...dmis.org>,
	Masami Hiramatsu <mhiramat@...nel.org>,
	Catalin Marinas <catalin.marinas@....com>,
	Will Deacon <will@...nel.org>, Puranjay Mohan <puranjay@...nel.org>,
	Mark Rutland <mark.rutland@....com>,
	Mark Brown <broonie@...nel.org>,
	Kalesh Singh <kaleshsingh@...gle.com>,
	chenqiwu <qiwuchen55@...il.com>
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: arm64: stacktrace: WARN_ON(state->common.pc == orig_pc) in
 kunwind_recover_return_address()

I don't know the details but people report that
kunwind_recover_return_address() hits this warning.

I know absolutely nothing about arm64 or kernel/trace/fgraph.c, but at
first glance this code looks broken:

	kunwind_recover_return_address:

		...

		orig_pc = ftrace_graph_ret_addr(state->task, NULL,
						state->common.pc,
						(void *)state->common.fp);
		if (WARN_ON_ONCE(state->common.pc == orig_pc))

	ftrace_graph_ret_addr:

		...

		if (!idx)
			return ret;


given that kunwind_recover_return_address() passes idx == NULL to
ftrace_graph_ret_addr(), it should always return ret == state->common.pc ?


Perhaps this connects to 29c1c24a27 ("function_graph: Fix up ftrace_graph_ret_addr()")
and I have no idea if something like the patch below makes any sense.

Oleg.

--- a/arch/arm64/kernel/stacktrace.c
+++ b/arch/arm64/kernel/stacktrace.c
@@ -106,7 +106,8 @@ kunwind_recover_return_address(struct kunwind_state *state)
 	if (state->task->ret_stack &&
 	    (state->common.pc == (unsigned long)return_to_handler)) {
 		unsigned long orig_pc;
-		orig_pc = ftrace_graph_ret_addr(state->task, NULL,
+		orig_pc = ftrace_graph_ret_addr(state->task,
+						&state->task->curr_ret_stack,
 						state->common.pc,
 						(void *)state->common.fp);
 		if (WARN_ON_ONCE(state->common.pc == orig_pc))


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ