Sometimes the stack cannot be recovered after userspace instrumentation
because the corresponding function does not save LR value. In this case
it is better to print a warning instead of calling panic (the worst that
can happen is the instrumented application crashing with segmentation
fault). Currently the function _start is known to cause such an error.
But actually it never returns so it is save to ignore this issue and
just recycle the coresponding retprobe instance.
spin_lock_irqsave (&kretprobe_lock, flags);
while ((ri = get_used_rp_inst(rp)) != NULL) {
- if (dbi_disarm_urp_inst(ri) == 0)
- recycle_rp_inst(ri);
- else
- panic("%s (%d/%d): cannot disarm urp instance (%08lx)",
+ if (dbi_disarm_urp_inst(ri) != 0)
+ /*panic*/printk("%s (%d/%d): cannot disarm urp instance (%08lx)\n",
ri->task->comm, ri->task->tgid, ri->task->pid,
(unsigned long)rp->kp.addr);
+ recycle_rp_inst(ri);
}
if (hlist_empty(&rp->used_instances) || not_rp2) {