[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b0193d69-d328-432d-86af-54fac7cef711@linux.ibm.com>
Date: Thu, 30 Jan 2025 17:38:24 +0100
From: Jens Remus <jremus@...ux.ibm.com>
To: Josh Poimboeuf <jpoimboe@...nel.org>, x86@...nel.org
Cc: Peter Zijlstra <peterz@...radead.org>,
Steven Rostedt <rostedt@...dmis.org>, Ingo Molnar <mingo@...nel.org>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
linux-kernel@...r.kernel.org, Indu Bhagat <indu.bhagat@...cle.com>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>, Namhyung Kim <namhyung@...nel.org>,
Ian Rogers <irogers@...gle.com>,
Adrian Hunter <adrian.hunter@...el.com>,
linux-perf-users@...r.kernel.org, Mark Brown <broonie@...nel.org>,
linux-toolchains@...r.kernel.org, Jordan Rome <jordalgo@...a.com>,
Sam James <sam@...too.org>, linux-trace-kernel@...r.kernel.org,
Andrii Nakryiko <andrii.nakryiko@...il.com>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Florian Weimer <fweimer@...hat.com>, Andy Lutomirski <luto@...nel.org>,
Masami Hiramatsu <mhiramat@...nel.org>, Weinan Liu <wnliu@...gle.com>,
Heiko Carstens <hca@...ux.ibm.com>,
Alexander Gordeev <agordeev@...ux.ibm.com>
Subject: Re: [PATCH v4 26/39] unwind_user/sframe: Enable debugging in uaccess
regions
On 22.01.2025 03:31, Josh Poimboeuf wrote:
> Objtool warns about calling pr_debug() from uaccess-enabled regions, and
> rightfully so. Add a dbg_sec_uaccess() macro which temporarily disables
> uaccess before doing the dynamic printk, and use that to add debug
> messages throughout the uaccess-enabled regions.
>
> Signed-off-by: Josh Poimboeuf <jpoimboe@...nel.org>
> diff --git a/kernel/unwind/sframe.c b/kernel/unwind/sframe.c
> @@ -53,12 +53,15 @@ static __always_inline int __read_fde(struct sframe_section *sec,
> sizeof(struct sframe_fde), Efault);
>
> ip = sec->sframe_start + fde->start_addr;
> - if (ip < sec->text_start || ip > sec->text_end)
> + if (ip < sec->text_start || ip > sec->text_end) {
> + dbg_sec_uaccess("bad fde num %d\n", fde_num);
> return -EINVAL;
> + }
>
> return 0;
>
> Efault:
> + dbg_sec_uaccess("fde %d usercopy failed\n", fde_num);
> return -EFAULT;
> }
Add a similar debug message for SFRame FDE user copy failures?
diff --git a/kernel/unwind/sframe.c b/kernel/unwind/sframe.c
@@ -125,6 +125,7 @@ static __always_inline int __find_fde(struct sframe_section *sec,
return 0;
Efault:
+ dbg_sec_uaccess("fde usercopy failed\n");
return -EFAULT;
}
Printing the IP is probably not an option due to security concerns?
Printing the the CFA, FP, and RA offsets is too much traffic? To debug
issues on s390 I had to add tons of additional debug messages to make
sense of what was actually going on.
Regards,
Jens
--
Jens Remus
Linux on Z Development (D3303)
+49-7031-16-1128 Office
jremus@...ibm.com
IBM
IBM Deutschland Research & Development GmbH; Vorsitzender des Aufsichtsrats: Wolfgang Wendt; Geschäftsführung: David Faller; Sitz der Gesellschaft: Böblingen; Registergericht: Amtsgericht Stuttgart, HRB 243294
IBM Data Privacy Statement: https://www.ibm.com/privacy/
Powered by blists - more mailing lists