MIPS: kprobes: flush_insn_slot should flush only if probe initialised

[email protected]
Newsgroups gmane.linux.ports.mips.cvs
Message-ID <S23994789AbdGCBHbe4Cm0/[email protected]>
Author: Marcin Nowakowski <[email protected]> Thu Jun 8 15:20:32 2017 +0200
Comitter: Ralf Baechle <[email protected]> Thu Jun 8 15:36:03 2017 +0200
Commit: 71b45f431ccbe3eb199c1907a99fb640f998f29a
Gitweb: https://git.linux-mips.org/g/ralf/linux/71b45f431ccb
Branch: linux-4.2-stable

When ftrace is used with kprobes, it is possible for a kprobe to contain
an invalid location (ie. only initialised to 0 and not to a specific
location in the code). Trying to perform a cache flush on such location
leads to a crash r4k_flush_icache_range().

Fixes: c1bf207d6ee1 ("MIPS: kprobe: Add support.")
Signed-off-by: Marcin Nowakowski <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/16296/
Signed-off-by: Ralf Baechle <[email protected]>
(cherry picked from commit a1497c7641ff53ca3632e87030fc905f73f2e7a5)

---

 arch/mips/include/asm/kprobes.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.