From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752158AbdBNIlM (ORCPT ); Tue, 14 Feb 2017 03:41:12 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:41010 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750859AbdBNIlK (ORCPT ); Tue, 14 Feb 2017 03:41:10 -0500 Date: Tue, 14 Feb 2017 14:11:03 +0530 From: Ananth N Mavinakayanahalli To: "Naveen N. Rao" Cc: Masami Hiramatsu , Ingo Molnar , linux-kernel@vger.kernel.org Subject: Re: [PATCH] kretprobes: reject registration if a symbol offset is specified Reply-To: ananth@linux.vnet.ibm.com References: <57139b36e50748ad931d66658bed62b29280c8c2.1487060504.git.naveen.n.rao@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <57139b36e50748ad931d66658bed62b29280c8c2.1487060504.git.naveen.n.rao@linux.vnet.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17021408-0004-0000-0000-00001193DC41 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006613; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000203; SDB=6.00821722; UDB=6.00401920; IPR=6.00599175; BA=6.00005135; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00014274; XFM=3.00000011; UTC=2017-02-14 08:41:07 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17021408-0005-0000-0000-00007D0B7354 Message-Id: <20170214084103.GF29806@in.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-02-14_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702140088 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 14, 2017 at 02:01:18PM +0530, Naveen N. Rao wrote: > Users shouldn't be able to specify an offset with kretprobes, as we always > want to probe at function entry. Otherwise, we won't be able to capture > the proper return address resulting in the kretprobe never firing. > > With samples/kprobes/kretprobe_example.c including an offset: > my_kretprobe.kp.offset = 40; > > Before this patch, the probe gets planted but never fires. > > After this patch: > $ sudo insmod samples/kprobes/kretprobe_example.ko > [sudo] password for naveen: > insmod: ERROR: could not insert module samples/kprobes/kretprobe_example.ko: Operation not permitted > > And dmesg: > [48253.757629] register_kretprobe failed, returned -22 > > Signed-off-by: Naveen N. Rao Acked-by: Ananth N Mavinakayanahalli