From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9918CC3A5A0 for ; Mon, 19 Aug 2019 16:43:17 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6B9B52070B for ; Mon, 19 Aug 2019 16:43:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="TOeJdir0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6B9B52070B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:MIME-Version:In-Reply-To:References:To: Subject:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=VoXFcBpH/l2nFRUU5r7iOLEZmyUDJLKhwkmU88T8eN8=; b=TOeJdir0/wFp/0ewwzbjCR3QR so110DlV2EnXuXU7Qgo3mFo9AFKUX+IjjIMuhnu4D4Q++p4ZjGCd5mEGSMVwECXNfzJsY40VYlLCZ RDpLw6QvAsfuLM1fRR2BCV0IrHycUVs54QR8g1dG8G+5+fBr1NMade5OHvqFu2UEE/nwHPIcpkbuf Cofc/kHuxf9eeCpun4lGOOEhZ4j1gFqhMJp0bJEln1DSpFpo3E6MzJOHWMYc7CttDZ1Sl73AQcjam HsmcIK8gwwbv0S0Oa0Dzz0in00bjYsT27WJDRsiGdHm/x8qgccbAt99l18+P8n0VDu1Ce8Grj8C/F uMbc4xj1A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hzkkX-0000Rd-0i; Mon, 19 Aug 2019 16:43:17 +0000 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hzkkU-0000R3-6N for linux-arm-kernel@lists.infradead.org; Mon, 19 Aug 2019 16:43:15 +0000 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x7JGRaDQ064894 for ; Mon, 19 Aug 2019 12:43:12 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ufx99b8vy-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 19 Aug 2019 12:43:12 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 19 Aug 2019 17:43:09 +0100 Received: from b06avi18626390.portsmouth.uk.ibm.com (9.149.26.192) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 19 Aug 2019 17:43:05 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x7JGgi8i42009006 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Aug 2019 16:42:44 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 51FA252059; Mon, 19 Aug 2019 16:43:04 +0000 (GMT) Received: from localhost (unknown [9.85.69.174]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id E705452051; Mon, 19 Aug 2019 16:43:03 +0000 (GMT) Date: Mon, 19 Aug 2019 22:13:02 +0530 From: "Naveen N. Rao" Subject: Re: [PATCH 1/4] kprobes: adjust kprobe addr for KPROBES_ON_FTRACE To: Anil S Keshavamurthy , Borislav Petkov , Catalin Marinas , "David S. Miller" , "H. Peter Anvin" , Jisheng Zhang , =?iso-8859-1?q?Masami=0A?= Hiramatsu , Ingo Molnar , Steven Rostedt , Thomas Gleixner , Will Deacon References: <20190819192422.5ed79702@xhacker.debian> <20190819192505.483c0bf0@xhacker.debian> In-Reply-To: <20190819192505.483c0bf0@xhacker.debian> MIME-Version: 1.0 User-Agent: astroid/0.15.0 (https://github.com/astroidmail/astroid) X-TM-AS-GCONF: 00 x-cbid: 19081916-0016-0000-0000-000002A06A45 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19081916-0017-0000-0000-00003300958E Message-Id: <1566232801.derqq08wxh.naveen@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-08-19_03:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908190176 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190819_094314_241719_C20640EE X-CRM114-Status: GOOD ( 22.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Jisheng Zhang wrote: > For KPROBES_ON_FTRACE case, we need to adjust the kprobe's addr > correspondingly. > > Signed-off-by: Jisheng Zhang > --- > kernel/kprobes.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/kernel/kprobes.c b/kernel/kprobes.c > index 9873fc627d61..f8400753a8a9 100644 > --- a/kernel/kprobes.c > +++ b/kernel/kprobes.c > @@ -1560,6 +1560,9 @@ int register_kprobe(struct kprobe *p) > addr = kprobe_addr(p); > if (IS_ERR(addr)) > return PTR_ERR(addr); > +#ifdef CONFIG_KPROBES_ON_FTRACE > + addr = (kprobe_opcode_t *)ftrace_call_adjust((unsigned long)addr); > +#endif > p->addr = addr; I'm not sure what this is achieving, but looks wrong to me. If you intend to have kprobes default to using ftrace entry for probing functions, consider over-riding kprobe_lookup_name() -- see powerpc variant for example. - Naveen _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel