Received: by 10.223.185.116 with SMTP id b49csp2285505wrg; Mon, 12 Feb 2018 07:20:50 -0800 (PST) X-Google-Smtp-Source: AH8x226k5UXgh3DRtTdpmDm28RPz++aT6Zis/qkfsfzV+zvhpmjlB2oFqnkML9hghjwb8t7R+DFD X-Received: by 2002:a17:902:9a41:: with SMTP id x1-v6mr10714336plv.256.1518448850022; Mon, 12 Feb 2018 07:20:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518448849; cv=none; d=google.com; s=arc-20160816; b=0rz+Hc19/udmlTFIFkuYFKeOCuVydEGQCO0/N6kh9tI0MU+ZRQu6uBiLzWZCeV01Cn J5vlpCEJD94uWPyGEj5V2Q98UvCcEL8wgPtrOtw1kw4LobRIlWPMtNzIRj4Edpgb2nJZ fxSMQeD8euQ4y5MEzW4r7KkdIVhvk8+vrPvab7kxWZwVD9Ye9cuGlo1IHgaa+wxiZaPk T5Qw3MBK5szg0w0zBr7p+l073csvS7WRLajzkOCnAIXr1/O/XZNH7CEJ6N+aQckBCztq /+M9rzHsriecG88wgquS80Ri5hoTwhNiNxH4RAUCqDiaWhWfCkcpRZuWlnvNNzZ4qtRp h5zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=qZFf0h7cK+wNUU16z0QIExXqdIaqCGJfwhcvVDi4oPQ=; b=grgPvO4KxyqACOd+vv3MvmEpvnaPIkDhwZDt0HhmHxdfCovpKdJD2697Lvz+JmSvHM 2Fp5miv3L+fVdrER9JK25k3UudCtZcHr05xbsyKnOOpXwCCYjkk1yjKFGscZxR8kf6Hf eEaxzqIIhBihPZfDcnCtz3jOoDYmquGA7cNGGtONYMJp1VdBf1Pqu9/bgSk99p2eMDLs C4MlCQJJnKjeYNP8ptH3taUivvxtCHHxYwB/cU0G/jsaa+voynk/11QtzNVRGSFeTRiI Xws//PAUMcSLawDhyW255CWFnFldDPov/JmbrBoj1n4qJ3bfGDHDP/oKSCw3pTXVbZNB PM8Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f84si825059pfh.363.2018.02.12.07.20.32; Mon, 12 Feb 2018 07:20:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752604AbeBLPTi (ORCPT + 99 others); Mon, 12 Feb 2018 10:19:38 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:42632 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751279AbeBLPTh (ORCPT ); Mon, 12 Feb 2018 10:19:37 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B82157CBDB; Mon, 12 Feb 2018 15:19:36 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.34.27.30]) by smtp.corp.redhat.com (Postfix) with SMTP id E17382166BAE; Mon, 12 Feb 2018 15:19:35 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Mon, 12 Feb 2018 16:19:36 +0100 (CET) Date: Mon, 12 Feb 2018 16:19:35 +0100 From: Oleg Nesterov To: Ravi Bangoria Cc: Srikar Dronamraju , "Naveen N. Rao" , ananth@linux.vnet.ibm.com, lkml Subject: Re: Uprobe: Bug(?) when probing small binaries Message-ID: <20180212151935.GA12577@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 12 Feb 2018 15:19:36 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 12 Feb 2018 15:19:36 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'oleg@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ravi, On 02/12, Ravi Bangoria wrote: > > I'm observing a bug in the uprobe infrastructure. I am not sure, > When target binary > is quite small, uprobe replaces 'trap' instruction at two different > places. Ex, but this is actually "the same place" (in the file), just 2 virtual addrs differ, > ? (gdb) x/w 0x1001069c > ??? 0x1001069c:??? 2080899750 > > Now enable the probe: > > ? # echo 1 > events/probe_a/main/enable > > Check probed instruction: > > ? (gdb) disassemble main > ?????? 0x000000001000069c <+8>:??? trap > > *Bug*: > > ? (gdb) x/w 0x1001069c > ??? 0x1001069c:? 2145386504 > > In short, when it replaces the probe instruction, it does some corruption > in the readonly vma. This seems to be a bug. > > How did I get the other address 0x1001069c?I found build_map_info() > returns these two vmas for the single probe: > > ? 10000000-10010000 r-xp 00000000 08:05 67325595?? /home/ravi/a.out > ? 10010000-10020000 r--p 00000000 08:05 67325595?? /home/ravi/a.out please note that these 2 vma's mmap the same region in a.out, so *0x1001069c and *0x1000069c point to the same insn. Oleg.