Re: [PATCH v2 11/11] uprobes/x86: Make arch_uretprobe_is_alive(RP_CHECK_CALL) more clever

From: Srikar Dronamraju
Date: Fri Jul 10 2015 - 08:08:28 EST


> If you ret-probe func_1() and func_2() prepare_uretprobe() hits the
> MAX_URETPROBE_DEPTH limit and "return" from func_2() is not reported.
>
> When we know that the new call is not chained, we can do the more
> strict check. In this case "sp" points to the new ret-addr, so every
> frame which uses the same "sp" must be dead. The only complication is
> that arch_uretprobe_is_alive() needs to know was it chained or not, so
> we add the new RP_CHECK_CHAIN_CALL enum and change prepare_uretprobe()
> to pass RP_CHECK_CALL only if !chained.
>
> Note: arch_uretprobe_is_alive() could also re-read *sp and check if
> this word is still trampoline_vaddr. This could obviously improve the
> logic, but I would like to avoid another copy_from_user() especially
> in the case when we can't avoid the false "alive == T" positives.
>
> Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>

Looks good to me.

Acked-by: Srikar Dronamraju <srikar@xxxxxxxxxxxxxxxxxx>

--
Thanks and Regards
Srikar Dronamraju

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/