MIPS: kprobes: flush_insn_slot should flush only if probe initialised

[email protected]
Newsgroups gmane.linux.ports.mips.cvs
Message-ID <S23994627AbdGCBE5z2HL0/[email protected]>
Author: Marcin Nowakowski <[email protected]> Thu Jun 8 15:20:32 2017 +0200
Comitter: Ralf Baechle <[email protected]> Thu Jun 8 15:37:19 2017 +0200
Commit: 0d1cb59ab9490a734bac17abb232aebae12133a9
Gitweb: https://git.linux-mips.org/g/ralf/linux/0d1cb59ab949
Branch: linux-3.11-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.