Messages in this thread | | | Date | Mon, 25 Mar 2013 13:31:21 +0100 | From | Oleg Nesterov <> | Subject | Re: [PATCH 5/7] uretprobes: return probe exit, invoke handlers |
| |
The last comment, I promise ;)
On 03/24, Oleg Nesterov wrote: > > On 03/22, Anton Arapov wrote: > > > > +static void handle_uretprobe(struct xol_area *area, struct pt_regs *regs) > > +{ > > + struct uprobe_task *utask; > > + struct return_instance *ri, *tmp; > > + unsigned long prev_ret_vaddr; > > + > > + utask = get_utask(); > > + if (!utask) > > + return; > > + > > + ri = utask->return_instances; > > + if (!ri) > > + return; > > Hmm. I am wondering what should the caller (handle_swbp) do in this > case...
And you do not actually need get_utask(), just check current->utask.
handle_uretprobe() must not be called if either ->utask or ->return_instances is NULL. This can only happen if we have a bug, or user-space tries to fool the kernel.
Perhaps it makes sense to add pr_warn().
Oleg.
| |