Re: [PATCH 6/7] arch: __get_wchan() || ARCH_STACKWALK

From: Kees Cook
Date: Fri Oct 22 2021 - 12:13:30 EST


On Fri, Oct 22, 2021 at 05:09:39PM +0200, Peter Zijlstra wrote:
> Use ARCH_STACKWALK to implement a generic __get_wchan().
>
> STACKTRACE should be possible, but the various implementations of
> stack_trace_save_tsk() are not consistent enough for this to work.
> ARCH_STACKWALK is a smaller set of architectures with a better defined
> interface.
>
> Since get_wchan() pins the task in a blocked state, it is not
> necessary to take a reference on the task stack, the task isn't going
> anywhere.
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>

Nice, this looks good.

Reviewed-by: Kees Cook <keescook@xxxxxxxxxxxx>

--
Kees Cook