Re: [PATCH v2 1/3] arm64: Prohibit instrumentation on arch_stack_walk()

From: Mark Rutland
Date: Fri Dec 09 2022 - 06:17:10 EST


On Tue, Dec 06, 2022 at 09:41:37AM +0900, Masami Hiramatsu wrote:
> On Fri, 2 Dec 2022 13:17:30 +0000
> Mark Rutland <mark.rutland@xxxxxxx> wrote:
> > I had a go at testing this patch, and it fixes the crash with the reproducer
> > above, but there are plenty of other instances in stacktrace.c that lead to the
> > same sort of crash, e.g.
> >
> > # echo p stackinfo_get_task >> ${TRACEFS}/kprobe_events
> > # echo 1 > ${TRACEFS}/events/kprobes/enable
>
> Oops, thanks for pointing! Hmm, I thought stackinfo_get_task() is an
> inlined function usually. Maybe we should make it nokprobe_inline.
> But this is just one case. I need to scan all symbols to trace...

FWIW, due to other instrumentation issues I've started doing a larger noinstr
cleanup on arm64 which should address this, as fixing this properly involves
also modifying a bunch of underlying helpers (e.g. preempt_count()).

I can Cc you when sending that out, if you'd like? That'll probably be in the
new year.

Thanks,
Mark.