Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754765AbbGJMI0 (ORCPT ); Fri, 10 Jul 2015 08:08:26 -0400 Received: from e23smtp01.au.ibm.com ([202.81.31.143]:51416 "EHLO e23smtp01.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753480AbbGJMIV (ORCPT ); Fri, 10 Jul 2015 08:08:21 -0400 X-Helo: d23dlp01.au.ibm.com X-MailFrom: srikar@linux.vnet.ibm.com X-RcptTo: linux-kernel@vger.kernel.org Date: Fri, 10 Jul 2015 17:37:15 +0530 From: Srikar Dronamraju To: Oleg Nesterov Cc: Ananth Mavinakayanahalli , Anton Arapov , David Long , Denys Vlasenko , "Frank Ch. Eigler" , Ingo Molnar , Jan Willeke , Jim Keniston , Mark Wielaard , Pratyush Anand , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 11/11] uprobes/x86: Make arch_uretprobe_is_alive(RP_CHECK_CALL) more clever Message-ID: <20150710120715.GK26095@linux.vnet.ibm.com> Reply-To: Srikar Dronamraju References: <20150707012210.GA7466@redhat.com> <20150707012313.GA7557@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20150707012313.GA7557@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15071012-1618-0000-0000-0000025D9B24 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1244 Lines: 30 > 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 Looks good to me. Acked-by: Srikar Dronamraju -- Thanks and Regards Srikar Dronamraju -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/