[PATCH 5.4] arm64: kprobes: Use BRK instead of single-step when executing instructions out-of-line

Greg KH greg at kroah.com
Mon Jun 20 04:53:41 PDT 2022


On Wed, Jun 15, 2022 at 09:59:23AM +0800, Mark-PK Tsai wrote:
> From: Jean-Philippe Brucker <jean-philippe at linaro.org>
> 
> commit 7ee31a3aa8f490c6507bc4294df6b70bed1c593e upstream.
> 
> Commit 36dadef23fcc ("kprobes: Init kprobes in early_initcall") enabled
> using kprobes from early_initcall. Unfortunately at this point the
> hardware debug infrastructure is not operational. The OS lock may still
> be locked, and the hardware watchpoints may have unknown values when
> kprobe enables debug monitors to single-step instructions.
> 
> Rather than using hardware single-step, append a BRK instruction after
> the instruction to be executed out-of-line.
> 
> Fixes: 36dadef23fcc ("kprobes: Init kprobes in early_initcall")
> Suggested-by: Will Deacon <will at kernel.org>
> Signed-off-by: Jean-Philippe Brucker <jean-philippe at linaro.org>
> Acked-by: Masami Hiramatsu <mhiramat at kernel.org>
> Link: https://lore.kernel.org/r/20201103134900.337243-1-jean-philippe@linaro.org
> Signed-off-by: Will Deacon <will at kernel.org>
> Link: https://lore.kernel.org/lkml/20220610063619.7921-1-mark-pk.tsai@mediatek.com/
> Cc: stable at vger.kernel.org
> Signed-off-by: Mark-PK Tsai <mark-pk.tsai at mediatek.com>

Now queued up, thanks.

greg k-h



More information about the linux-arm-kernel mailing list