Received: by 10.192.165.148 with SMTP id m20csp578512imm; Fri, 20 Apr 2018 11:33:09 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+gGBjavRpo2kySQhmjcx0wo3DiOfdtFP/5PLoA5zlC0rBeTvtYJ+3Xr9fUJIP6rY4MhSci X-Received: by 2002:a17:902:5a46:: with SMTP id f6-v6mr6000320plm.85.1524249188955; Fri, 20 Apr 2018 11:33:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524249188; cv=none; d=google.com; s=arc-20160816; b=X00autLn/+CAK0ZM0h9fKKEUou8dZnk9KYnMM0kdMlHdiBTZsif/W/W1CoJRGnOj6C exrbVmm2nHzBApsXheNkmxkPxgRUJXN2IZqexYfP93TiHY+HLG1o0Eax1PgaEx2KlLl0 G7kp27izCXnfwz4cGIsMI2stayIeC9eSenJXmp7bx5/05sZbLCdQ8T38xso3MnL6sLVH jwWcUF7KhkR3hnyCJpvPLt/1WryPTX9FiToXCnHLEjuoNQ/AFSTsJkB4dyQQbBLdAElH CnbKzYScyc6lp72FExtMlM1+N7V+qeQzVvmBH6UDjP7K08oeWDaDDrAcZNrKkfbT22eb XJpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dmarc-filter:arc-authentication-results; bh=PKHZiRDossAlshomf7ehl9rB1M4b4KZ3ineBUx7/m4Q=; b=xtJQnY347+61r2WGPKdhgGytMRY5moEmIBOFIr9JQdlfQIgSSqTQhLxH3DP1i82N7i vFwobogCIPEam/WVZpxtXXuBtMTPMvythb870GZnYdw0HRuP9UPdDbYmqLqYSA8OJ8EM G27skIgwH6twtoy2JtKmTuKCWkI2HA/99Oen+9xBT+Adc42AbFW4noz+Lkong4ZTOFWC qiyqBkDPZUWUZQczSKnfrNxSv3aEMmkYgcMJiDuomLAnwUKe7qDmVq0cjb40Io6QSUk2 kbWGd2U/MZMpCzUuK9ggn7IuVgowJVYdn1aXmuZKYQ5sroPONQcMpZNPBs6t57eJCBlO CHsQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z14si2407137pfc.128.2018.04.20.11.32.54; Fri, 20 Apr 2018 11:33:08 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753902AbeDTSaM (ORCPT + 99 others); Fri, 20 Apr 2018 14:30:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:43120 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753587AbeDTSaL (ORCPT ); Fri, 20 Apr 2018 14:30:11 -0400 Received: from gandalf.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B78F5217AE; Fri, 20 Apr 2018 18:30:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B78F5217AE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Date: Fri, 20 Apr 2018 14:30:08 -0400 From: Steven Rostedt To: Song Liu Cc: , , Ingo Molnar , Howard McLauchlan , Josef Bacik , Srikar Dronamraju , Miklos Szeredi Subject: Re: [PATCH v3 1/2] tracing: fix bad use of igrab in trace_uprobe.c Message-ID: <20180420143008.19959743@gandalf.local.home> In-Reply-To: <20180420165625.129593-1-songliubraving@fb.com> References: <20180420165625.129593-1-songliubraving@fb.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 20 Apr 2018 09:56:24 -0700 Song Liu wrote: > s Miklos reported and suggested: > > This pattern repeats two times in trace_uprobe.c and in > kernel/events/core.c as well: > > ret = kern_path(filename, LOOKUP_FOLLOW, &path); > if (ret) > goto fail_address_parse; > > inode = igrab(d_inode(path.dentry)); > path_put(&path); > > And it's wrong. You can only hold a reference to the inode if you > have an active ref to the superblock as well (which is normally > through path.mnt) or holding s_umount. > > This way unmounting the containing filesystem while the tracepoint is > active will give you the "VFS: Busy inodes after unmount..." message > and a crash when the inode is finally put. > > Solution: store path instead of inode. > > This patch fixes two instances in trace_uprobe.c. struct path is added to > struct trace_uprobe to keep the inode and containing mount point > referenced. > > Fixes: f3f096cfedf8 ("tracing: Provide trace events interface for uprobes") > Fixes: 33ea4b24277b ("perf/core: Implement the 'perf_uprobe' PMU") > Cc: Steven Rostedt > Cc: Ingo Molnar > Cc: Howard McLauchlan > Cc: Josef Bacik > Cc: Srikar Dronamraju > Cc: Miklos Szeredi > Reported-by: Miklos Szeredi > Signed-off-by: Song Liu > --- Can I get an Acked-by or Reviewed-by from someone? Thanks! -- Steve