Re: [PATCH 5.10 0/9] x86/kprobes: Fix kprobe debug exception handling logic

From: Greg KH
Date: Fri Aug 04 2023 - 05:57:18 EST


On Wed, Jul 05, 2023 at 02:46:44PM +0800, Li Huafei wrote:
> We found an issue with null pointer access due to kprobe debug exception
> error handling on 5.10, and I proposed a separate fix patch for 5.10,
> see [1]. But as Greg gave advice, we always choose to backport relevant
> patches from upstream to fix issues with stable kernels, so I made this
> patch set.
>
> The main one we need to backport is patch 5, which uses int3 instead of
> debug trap for single-stepping, thus avoiding the problems we
> encountered with kprobe debug exception error handling. Patches 1-4 are
> pre-patches, and patches 6-9 are fixes for patch 5. The major
> modifications are patch 2 and patch 5. Patch 2 optimizes
> resume_execution() to avoid repeated instruction decoding, and patch 5
> uses int3 instead of debug trap, and as Masami said in the commit
> message this patch will change some behavior of kprobe, but it has
> almost no effect on the actual usage.
>
> Please let me know if there are any problems, thanks!

Looks good, thanks for the backports, all now queued up.

greg k-h