提交 a2310c74 编写于 作者: L Liao Chang 提交者: Guo Ren

csky/kprobe: reclaim insn_slot on kprobe unregistration

On kprobe registration kernel allocate one insn_slot for new kprobe,
but it forget to reclaim the insn_slot on unregistration, leading to a
potential leakage.
Reported-by: NChen Guokai <chenguokai17@mails.ucas.ac.cn>
Reviewed-by: NMasami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: NLiao Chang <liaochang1@huawei.com>
Signed-off-by: NGuo Ren <guoren@kernel.org>
上级 ff699273
......@@ -124,6 +124,10 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p)
void __kprobes arch_remove_kprobe(struct kprobe *p)
{
if (p->ainsn.api.insn) {
free_insn_slot(p->ainsn.api.insn, 0);
p->ainsn.api.insn = NULL;
}
}
static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册