Received: by 10.192.165.148 with SMTP id m20csp22880imm; Fri, 20 Apr 2018 02:15:44 -0700 (PDT) X-Google-Smtp-Source: AIpwx48WeeQI9Zp87gA4/dEH91LoXO3h60um44phAuINT1z697/R9V3ukDYVN6BVet6wtrpnbUkv X-Received: by 2002:a17:902:be18:: with SMTP id r24-v6mr9437845pls.275.1524215744674; Fri, 20 Apr 2018 02:15:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524215744; cv=none; d=google.com; s=arc-20160816; b=CJr988IDIZHzok5rM90b4ZnCLEEXgfOCfMsS7RBMUH2s6Bsxl2Fs6Hz1XGQxPBDPog 3MAtfc/4R1NIZZVPyemd11NXgYT72ocGGdDTzCxOxLe1Zol3rcQdSTnNeUJF7ZJLnxQE LWlGwV9Wh+AC2H10A4Q3fBjwjL0Tfgitabu59ZW8Wm86mpz63NuwwhS5FlXpQDC4+kIG 40hBfoP9TxRE8PPIEtXqTtRd6HsXNZJJzItkk85IUhJ7acQ7tyoLzrvGO0cG8fwaRygZ 4MTaCMkstpEirRLEWKMw8G2vdnpNvfWwvUCbGu+iwdwZcOdlZvw2RXDm7uJ4i7dE7KUp Kydg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:arc-authentication-results; bh=mzOWoD/MiGSx1nqb6DLCjN6QbCkWjX9527yAn8n+YKU=; b=p3E5/pWEKsoZcluCqnwWRJPyCEqVtx8jUpFWWdWxcrd9lW2IB/VLKroVn87TyercEa OkM9TZ5WHLfdH8kk0XEOnjhY4jVJ9EH+0g7tk5HfJNvHdQZu/lVxiOhl/RAbKVRblLBx n0CDzC7ZKm3gmtWmYqx14P7iZer1BzzEDM8jsIj7WTPKgBtkXpoMYcL7WCjV/cYXDyYC G5vMI43QPOv22GUsjHkwSKfiqpcGIo+RmMGQIE6xlf170HJ699aXAQ9zyq4Z1CrO9601 rnG37kzTCHualghDKPKUubyQJg882f70ZzIBOJAebLzT+BNqZOo0HgXJDREVWDY1lSWA BaQQ== 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 f34-v6si5415772plf.362.2018.04.20.02.15.30; Fri, 20 Apr 2018 02:15:44 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754227AbeDTJOU (ORCPT + 99 others); Fri, 20 Apr 2018 05:14:20 -0400 Received: from mail-ot0-f196.google.com ([74.125.82.196]:37841 "EHLO mail-ot0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754158AbeDTJOS (ORCPT ); Fri, 20 Apr 2018 05:14:18 -0400 Received: by mail-ot0-f196.google.com with SMTP id 77-v6so2793846otd.4 for ; Fri, 20 Apr 2018 02:14:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=mzOWoD/MiGSx1nqb6DLCjN6QbCkWjX9527yAn8n+YKU=; b=Um+35AeTn3hu9V9jOp2Wy/BmZiDkXSHWDl9Nrt5Z1lHGzgv+aM2APAu38da5RcbDS6 hX4g26IzWQMGQsvyouAmI+UKu+tGFfEV5PSjt2EX6s5DCPIl9zowU3MR93OUmXoZg1T9 mo7fn9gkEf3m9dKZtO/7SS6n2KzR+iyvUPgBQkARMArqsjTWUV2OARNuHKwdm3SyOEzi 938TZdbrvtQA5cr1lPQsSsm/peBpLbJKyMdi7aSA2VGVuLecWv2sOxUFpk2z3tVSom05 Js0G+ahUkxm382C021krPKWsQKfPQaQLXzU3miQ76QAVbP8HVroCqb02L+LjLbVAPGc2 uHow== X-Gm-Message-State: ALQs6tBd5C5YT8ujV8o1gyTd7H4A2oJ0whPECOWAMFgFhnSjm5jv7oOU MoFbyO3Rg/VzgvH+nqZfH2MD77Vpkp1+2N3PGjgwEA== X-Received: by 2002:a9d:5b47:: with SMTP id e7-v6mr2460422otj.62.1524215658208; Fri, 20 Apr 2018 02:14:18 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:5783:0:0:0:0:0 with HTTP; Fri, 20 Apr 2018 02:14:17 -0700 (PDT) In-Reply-To: <20180419195449.GC9451@redhat.com> References: <20180412150826.20988-1-mszeredi@redhat.com> <20180412150826.20988-32-mszeredi@redhat.com> <20180418093845.19ca33f3@gandalf.local.home> <20180419195449.GC9451@redhat.com> From: Miklos Szeredi Date: Fri, 20 Apr 2018 11:14:17 +0200 Message-ID: Subject: Re: [RFC PATCH 31/35] Revert "vfs: add d_real_inode() helper" To: Vivek Goyal Cc: Miklos Szeredi , Steven Rostedt , Amir Goldstein , overlayfs , linux-fsdevel , linux-kernel , Howard McLauchlan Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 19, 2018 at 9:54 PM, Vivek Goyal wrote: > On Wed, Apr 18, 2018 at 03:49:02PM +0200, Miklos Szeredi wrote: >> On Wed, Apr 18, 2018 at 3:38 PM, Steven Rostedt wrote: >> > On Wed, 18 Apr 2018 13:42:03 +0200 >> > Miklos Szeredi wrote: >> > >> >> On Wed, Apr 18, 2018 at 10:19 AM, Amir Goldstein wrote: >> >> > On Thu, Apr 12, 2018 at 6:08 PM, Miklos Szeredi wrote: >> >> >> This reverts commit a118084432d642eeccb961c7c8cc61525a941fcb. >> >> >> >> >> >> No user of d_real_inode() remains, so it can be removed. >> >> >> >> >> > >> >> > FYI, there is a new user in v4.17-rc1 added by commit >> >> > f0a2aa5a2a40 tracing/uprobe: Add support for overlayfs >> >> > >> >> > Seems like this patch got merged without any CC to overlayfs >> >> > mailing list nor maintainer? >> > >> > It appeared to be a small change with lots of reviewers. I didn't think >> > it was something to notify the overlayfs folks with. But perhaps I was >> > wrong. >> >> The patch is correct. The code surrounding it isn't, though. >> >> > >> >> > >> >> > Not sure yet if overlayfs-rorw patches would allow reverting this >> >> > change. >> >> >> >> Not trivial, because uprobe is looking at i_mapping to get a list of >> >> current memory maps. We could set i_mapping at overlay inode >> >> initialization time, but we definitely can't *change* i_mapping at >> >> copy up. Which is bound to result in some weird inconsistencies. So >> >> likely we'll need to keep d_real_inode() for the time being. >> > >> > I just received this patch: >> > >> > http://lkml.kernel.org/r/20180418062907.3210386-1-songliubraving@fb.com >> > >> > Which removes this code. Can you review it and I'll take it. >> >> It shouldn't remove d_real_inode(), because that part is correct and >> fixes a real bug in handling overlayfs files. > > I am wondering what does it practically mean for metdata only copy up > patches. Given this is uprobe code, I am assuming its modifying some > executable code dynamically. And for the the case of metadata only > copy up, it will return inode of lower. That probably means, as long > as all running instances of that exeutable are using that inode, things > will work fine. > > But if for some reason somebody opens that file for WRITE and triggers > copy up and new instances of same binary will not see the probe taking > affect? > > Which is probably very similar to what will happen if a lower executable > is copied up. Having said that, in normal cases there should not be a > need to copy up a binary in normal circumstances. The only thing we need to ensure when uprobes interact with copy-ups is that the kernel doesn't crash and doesn't leak memory. Other than that, it's a totally uninteresting corner case and we don't need to worry about its behavior. Thanks, Miklos