]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: tracing: disable uprobe/kprobe on compact branch instructions
authorMarcin Nowakowski <marcin.nowakowski@imgtec.com>
Fri, 30 Sep 2016 09:33:46 +0000 (11:33 +0200)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 6 Oct 2016 15:37:40 +0000 (17:37 +0200)
commit4b8b33208558fbdc9cdaea18c10fefe2d2db075e
tree7948594b560af72ed535a41cc567de4235562ff8
parentafdfd5a8ca3a3ad8c9cc76a1e86cf65a3a114da2
MIPS: tracing: disable uprobe/kprobe on compact branch instructions

Current instruction decoder for uprobe/kprobe handler only handles
branches with delay slots. For compact branches the behaviour is rather
unpredictable - and depending on the encoding of a compact branch
instruction may result in one (or more) of:
- executing an instruction that follows a branch which wasn't in a delay
  slot and shouldn't have been executed
- incorrectly emulating a branch leading to a jump to a wrong location
- unexpected branching out of the single-stepped code and never reaching
  the breakpoint that should terminate the probe handler

Results of these actions are generally unpredictable, but can end up
with a probed application or kernel crash, so disable placing probes on
compact branches until they are handled properly.

Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/14336/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/kernel/branch.c
arch/mips/kernel/kprobes.c
arch/mips/kernel/probes-common.h
arch/mips/kernel/uprobes.c