Re: [PATCH] powerpc/kprobes: Fix null pointer reference in arch_prepare_kprobe()

From: Naveen N. Rao
Date: Wed Oct 12 2022 - 05:53:54 EST


Li Huafei wrote:

  # echo 'p cmdline_proc_show' > kprobe_events
  # echo 'p cmdline_proc_show+16' >> kprobe_events

I think we should extend multiple_kprobes selftest to also place
contiguous probes to catch such errors.

Yes. But each architecture implementation is different and it looks a
little difficult to decide which offsets need to be tested.

I don't think we need to be accurate here. A test to simply try putting a probe at every byte within the first 256 bytes of a kernel function should help catch many such issues. Some of those probes will be rejected, but we can ignore errors.


- Naveen