Received: by 10.192.165.156 with SMTP id m28csp1416311imm; Wed, 18 Apr 2018 09:17:31 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/QPjQuSp/QnUEPvHApVjsZjpbdc6yzxjNLaQeLz+Nkgk2D5iTHYMXPKNpx0UKM93qOEOKM X-Received: by 10.98.232.2 with SMTP id c2mr2514314pfi.187.1524068251709; Wed, 18 Apr 2018 09:17:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524068251; cv=none; d=google.com; s=arc-20160816; b=anRrMayhSjyMBpA5uXhI37ZF88eaSxLzpkBJfduQV4eEVWTc9Aon/04Esa3F84K4as zpAOfmygS+l67zHnf0WbavrA0QYDttGsesehYuTqNxckzYUnE2LL4A+ZLQHcBrKs7zoJ 5ltpReY4AWsx0rJ2JFOAo98hlmZTiXf6in4Sc7f5QrLgOZ38LsCqz78PFcfZVg3VTUky GRuZMeXGWYOvm1Yg4dGgNYAZI/8gcjk+Cjh/uNTvjSng3wjMsHBPMtmtQmGrLQKO6usJ bSk27Ijzpzjirz7lbeMFjpdCDIU1ERp5XNA9SV1o6ARrCjWdG5R7kG2q3REjL506/SPk lNpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:spamdiagnosticmetadata:spamdiagnosticoutput :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature :dkim-signature:arc-authentication-results; bh=sghr6tHaeKmNkkK0du9+QsPMwfKgEh6ZlXv20QWvQjw=; b=k46bAABjQyoa5tsawHxrVpc6lH/6kNY8M5qm/9U/yDjvZcDVAbpEIoaAusr7Le6D0K mnThFxRtPyWWSVsahhkL8d0KsJWvBw5xKq0tAGEFxy+u8FnSUbPUOMwC9iwK9j0cda2t 57hwClPW3FCnLowCrzY1iZrCKacjGk5sr+TvDpXGAuDxMp8aE5/MbfbofxPoaD/lUAWZ kqR3SsQO06IKPSUbJcLNt0wHbChusIzmp+/kuVanDJf6iCiKtcW6hvQaEsO3+l3dUtn3 JhfHXmewRA5C4AJf28leeMBrL49WKYfoDw2kCwz+LjWpa0VpoOXbJxVpECRgBlODAQwg OX3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=NzE3mNeT; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=DfGZRgsx; 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=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x12si1339277pge.687.2018.04.18.09.17.17; Wed, 18 Apr 2018 09:17:31 -0700 (PDT) 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; dkim=pass header.i=@fb.com header.s=facebook header.b=NzE3mNeT; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=DfGZRgsx; 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=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752392AbeDRQQH (ORCPT + 99 others); Wed, 18 Apr 2018 12:16:07 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:56696 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750872AbeDRQQG (ORCPT ); Wed, 18 Apr 2018 12:16:06 -0400 Received: from pps.filterd (m0148460.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w3IGE0on021961; Wed, 18 Apr 2018 09:15:54 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-id : content-transfer-encoding : mime-version; s=facebook; bh=sghr6tHaeKmNkkK0du9+QsPMwfKgEh6ZlXv20QWvQjw=; b=NzE3mNeT/w1FZO6w9CMbfFwEgvPtDi/MDuI3ETLFZIz/A5iqdfKttTxn5G2pdLPwmN7+ msUPrjrPUB8uRB0s15N4gWHx1qqG8Lyo3TAW8kKKKjsrUSXia/QY36ek9wV2t2zA530+ 1f48SGKFgMYNP+XDj9j/+2mswWV0x4wnWvs= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2he92cr296-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 18 Apr 2018 09:15:54 -0700 Received: from NAM01-SN1-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.24) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 18 Apr 2018 09:15:52 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=sghr6tHaeKmNkkK0du9+QsPMwfKgEh6ZlXv20QWvQjw=; b=DfGZRgsxCdlFiGNxcBLQoVAEShydx6ibZXBmCUx661E55Am7DIuIZQ/xZQWsxQI4Ce5Sue199R8hF8VKV5GMOSbq+vl+LWCtIr/XYVR/rSn2HJ9oDCuQMHboXe8RKW3nFMn4lQU4D4rLqAWQG+Xo3/3D2M5WN4ciNl09s+YkJ6A= Received: from DM5PR15MB1548.namprd15.prod.outlook.com (10.173.222.139) by DM5PR15MB1611.namprd15.prod.outlook.com (10.175.105.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.675.13; Wed, 18 Apr 2018 16:15:51 +0000 Received: from DM5PR15MB1548.namprd15.prod.outlook.com ([fe80::d87a:fa34:57e7:1e2c]) by DM5PR15MB1548.namprd15.prod.outlook.com ([fe80::d87a:fa34:57e7:1e2c%17]) with mapi id 15.20.0675.015; Wed, 18 Apr 2018 16:15:50 +0000 From: Song Liu To: Steven Rostedt CC: Miklos Szeredi , LKML , Kernel Team , Ingo Molnar , "Howard McLauchlan" , Josef Bacik , "Srikar Dronamraju" Subject: Re: [PATCH 1/2] tracing: fix bad use of igrab in trace_uprobe.c Thread-Topic: [PATCH 1/2] tracing: fix bad use of igrab in trace_uprobe.c Thread-Index: AQHT1t6qY2w++l1Em02GF9oER/KoaKQGjmAAgAAF+ACAAB7zAA== Date: Wed, 18 Apr 2018 16:15:50 +0000 Message-ID: <939B1EB1-07D3-473F-B7D1-21E7B0F6CF13@fb.com> References: <20180418062907.3210386-1-songliubraving@fb.com> <20180418102504.7673a7f3@gandalf.local.home> In-Reply-To: <20180418102504.7673a7f3@gandalf.local.home> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: Apple Mail (2.3445.6.18) authentication-results: goodmis.org; dkim=none (message not signed) header.d=none;goodmis.org; dmarc=none action=none header.from=fb.com; x-originating-ip: [2620:10d:c090:180::1:db29] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR15MB1611;7:Tkt7oY7UR88NVU1M0ig/0tWLVImgXeS+qDqoqKwm1i8SquPRBxGu9VJK3QvRfmcrMsZ1WFjmnkQiJ9187rs94Bej3odqIWiexT+PRsL4axG1qIM5C7qCXR5NcKGbk2qq2JEmj9vL/b+DGepY4qk/2CJnc5AOeNpLlSL+44yNf5c4G5GBopt6cg62MULgbwUhMKvYvS0+SxiOQYGLO4ZG0bcjMgm3b+OaVS9xXYONbzWxse1o9NjltC9RpzQOx+tA;20:HsmaR0f9EVT8uQecr/ECaTLvGM7hSO/NiqN7ERCBRHiNryrb9ELRzyvmA5KOy76HzBR+PfCoz+b/RjACQc5tbTBUsczNfkDa09qwWOWW17a0i+qgUA3GMOoXGlzFMw9rOperzuuALDg+a95MN7xWRHJkJEI6NF+kpmkkcEwrO6g= x-ms-exchange-antispam-srfa-diagnostics: SOS;SOR; x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:DM5PR15MB1611; x-ms-traffictypediagnostic: DM5PR15MB1611: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231232)(11241501184)(944501327)(52105095)(93006095)(93001095)(10201501046)(3002001)(6041310)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR15MB1611;BCL:0;PCL:0;RULEID:;SRVR:DM5PR15MB1611; x-forefront-prvs: 06469BCC91 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(346002)(39380400002)(39860400002)(366004)(6506007)(2906002)(102836004)(6116002)(82746002)(305945005)(6436002)(6512007)(7736002)(478600001)(33656002)(6486002)(14454004)(53546011)(54906003)(53936002)(4326008)(5250100002)(81166006)(8676002)(99286004)(5660300001)(8936002)(83716003)(76176011)(186003)(25786009)(11346002)(446003)(2616005)(476003)(36756003)(86362001)(50226002)(6246003)(6916009);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR15MB1611;H:DM5PR15MB1548.namprd15.prod.outlook.com;FPR:;SPF:None;LANG:en;MLV:sfv; x-microsoft-antispam-message-info: hobDkoVjqlocUA8YsZGy4wtlWDlvY9GHwsB1YMw7Ec/A36ruOC1hRloh+9G9nJhlSqaSHEsXcDvYQAH1v1KqbGIeHzcYZ1J8e0d0tTV5+JW+i+OUNapR/WFsTu8sHnojN3199tkaz0SChfeWDR5VvrfxISXSg8Cor8klsbXPbVIEyYmpKQqpRpVJQFQ11RQX spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: <1CB3466784AB09459DA4CC3625D04484@namprd15.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: f005e8bd-b8f0-4811-47ce-08d5a547a73c X-MS-Exchange-CrossTenant-Network-Message-Id: f005e8bd-b8f0-4811-47ce-08d5a547a73c X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Apr 2018 16:15:50.9174 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR15MB1611 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-04-18_03:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Apr 18, 2018, at 7:25 AM, Steven Rostedt wrote: >=20 > On Wed, 18 Apr 2018 16:03:42 +0200 > Miklos Szeredi wrote: >=20 >>> @@ -937,7 +928,8 @@ probe_event_enable(struct trace_uprobe *tu, struct = trace_event_file *file, >>> goto err_flags; >>>=20 >>> tu->consumer.filter =3D filter; >>> - ret =3D uprobe_register(tu->inode, tu->offset, &tu->consumer); >>> + ret =3D uprobe_register(d_inode(tu->path.dentry), tu->offset, >>> + &tu->consumer); =20 >>=20 >> It is not entirely clear how the lifetime of uprobe relates to the >> lifetime of trace_uprobe. Is the uprobe object never going to survive >> its creator trace_uprobe object? >=20 > Not exactly sure what you mean here. >=20 > The trace_uprobe (the probe event) is created, it doesn't do anything > until it is enabled. This function is called when it is enabled. The > trace_uprobe (probe event) can not be deleted while it is enabled > (EBUSY). >=20 > Are you asking what happens if the file is deleted while it has probe? > That I don't know about (haven't tried it out). But I would hope that > it keeps a reference to the inode, isn't that what the igrab is for? > And is now being replaced by a reference on the path, or is that the > problem? >=20 > -- Steve >=20 Just as Miklos pointed out, I run tests with the uprobe and confirmed=20 that igrab() is not sufficient to prevent umount. When we change it to=20 path_get()/path_put(), umount will abort because of the trace_uprobe.=20 Song >>=20 >> If that's the case, it warrants a comment. If that's not the case, >> then the path would need to be passed to uprobe_resister() which would >> need to obtain its own reference. >>=20 >>> if (ret) >>> goto err_buffer; >>>=20