Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp619267pxj; Thu, 27 May 2021 08:00:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXcJOIu71JFqd/WjUon/Juizs8SUhsRg1omJ2kQIjVpbOP9dWcVjnyxM8PIn/QWd7l8bm+ X-Received: by 2002:a17:906:3ed0:: with SMTP id d16mr4204244ejj.16.1622127602374; Thu, 27 May 2021 08:00:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622127602; cv=none; d=google.com; s=arc-20160816; b=vnzcdYuFv8RBEB2X2RgfvKg6K8Sz7BwmYblItWWqjWLzWswAZEGt8aIiDmBxaJo1P4 s/NUAFLYKqPiAFpGCmfsxpwdSwI4KF/S4sHLt4Jg4tPWRWiQzIL4GG0CTYpi+7RlUJLH Ko7prHYU4PpKuY8759adqGNPNu6LeMBnIZN99/NsSgdLd515USHaKhpl36kJVPVbMgcV p21EaBl1VT09v3we5sku3BSFuDVjhg+l90Ho9VqqSRrLD/WjdO8394ccB66S3uPnACyr JBfWiWZy83CKR7xEtp983aULdwlW7+4MfDJ4Ovvd+P7v3w8shdBgaoFjTsrEQILEwm2q HeTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=1c4xwHXGGH1sejR0TUAI0AnMRSAgsr2C+wu36PqGz4g=; b=D3oZzlKFDxKMyyO8lXnRUQjNYg+j8fl0PM+F93GTmMYBg0OzePGZevbGbWJ77ytA36 VwEosDUBFPn/xYmhKa/Hiq9witx6NXBQLujCdLW10S18Dvx7JRAfjgV8+pWv5W6HHttT OZYwpik5A0qukhlAq69FUvF4o134oQEcNcCxwGVD8tUHV40+4AecMyFD5AYZzUpDU880 SdzAO7j/BhI8sg/CvXcp6gwdXFc5k3TOaPu82UXJo61GTkQMnwEuxBqlBuIMat2rb5ui d20Kq+pFl42RMawsX6mf+o/DeLqpI1CqC9bQvSeC7uhC6CzWNlCLmFF7g3xiP4aNZQ/Y XbLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=H8zeQu+e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a22si2774121edb.304.2021.05.27.07.59.39; Thu, 27 May 2021 08:00:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=H8zeQu+e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234365AbhE0Hba (ORCPT + 99 others); Thu, 27 May 2021 03:31:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234927AbhE0HbI (ORCPT ); Thu, 27 May 2021 03:31:08 -0400 Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7179C061574; Thu, 27 May 2021 00:29:34 -0700 (PDT) Received: by mail-lf1-x142.google.com with SMTP id q7so6540928lfr.6; Thu, 27 May 2021 00:29:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1c4xwHXGGH1sejR0TUAI0AnMRSAgsr2C+wu36PqGz4g=; b=H8zeQu+eGMTrFrWohbctnGNggExgciyKjSFweAeZ5yi75WASzHLuC2DRrHzjv+lDFM QcxNPlyHvJON1F9oHy9YJWtyTn+zbxk31SfN/oucRoiK/ng69AkASErakarkA9UmgW9X Vudo4TkSk9kb1j1DKCjPA7K/ZAetPGEQH1f+VmXfdv/bY901w9PdbSN/fK++G0+cAB0+ W8x5OzsrdM5wcAwfPDmUt1N3w4HEgGMe3m+n2jm4ftQK/B4VNsoHw3jaOynaSq1UZFun 2fOSyDzDDuWHMynrg18PT+60oXzMw3JQi4o7ofYSCPKPmkjqNYBua8Fn7DaMa+gFzVYU r09w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1c4xwHXGGH1sejR0TUAI0AnMRSAgsr2C+wu36PqGz4g=; b=n+4NUyQyth17QCs0S8U6ML7IYzP9crs4GHgId38ZnkIdxD/O7lKVIcNju+ZtgUWWD3 h+Xwayl16ekyP4WgxLQdM43859sNZXsFVBjN3Wk001G35T//4vYKAetD1mHjSeCwTEe6 hhI7aaedvu66nRJvmH0o4vlo+NCWUtOIGkXDb5SjxtWQ5U64oZQhuqGofJoLj6RfHjXW smCN3SLnlY157N3Xa+HSCzPS0UM4cwtpmQB5EArRwBsX5/26nBy/Qx+CiRTjQNGLR+1t bNL8PjltqHAM3C1PCYuzbdBHJDy4S+tTLU6+DjyejO8li5X4CBREjLVLLWM8XzU9NAIf Kbyg== X-Gm-Message-State: AOAM532cs/XDueQyXRKE9+4BMVmMBnMgQRNZo88bkFury9fiBwlxq4G5 KjkFtm0xrcE3TMGGTpgiPkqtHpOmstxQpVKRx9Q= X-Received: by 2002:a19:3f0a:: with SMTP id m10mr1585850lfa.477.1622100573127; Thu, 27 May 2021 00:29:33 -0700 (PDT) MIME-Version: 1.0 References: <20210525141524.3995-1-dong.menglong@zte.com.cn> <20210525141524.3995-3-dong.menglong@zte.com.cn> <20210526090310.GI4332@42.do-not-panic.com> In-Reply-To: <20210526090310.GI4332@42.do-not-panic.com> From: Menglong Dong Date: Thu, 27 May 2021 15:29:20 +0800 Message-ID: Subject: Re: [PATCH v2 2/3] init/do_cmounts.c: introduce 'user_root' for initramfs To: Luis Chamberlain Cc: Josh Triplett , "Eric W. Biederman" , Alexander Viro , Kees Cook , Sami Tolvanen , ojeda@kernel.org, johan@kernel.org, Bjorn Helgaas , masahiroy@kernel.org, Menglong Dong , joe@perches.com, Jens Axboe , hare@suse.de, Jan Kara , tj@kernel.org, gregkh@linuxfoundation.org, song@kernel.org, NeilBrown , Andrew Morton , f.fainelli@gmail.com, arnd@arndb.de, Rasmus Villemoes , wangkefeng.wang@huawei.com, Barret Rhoden , mhiramat@kernel.org, Steven Rostedt , vbabka@suse.cz, Alexander Potapenko , pmladek@suse.com, Chris Down , jojing64@gmail.com, terrelln@fb.com, geert@linux-m68k.org, mingo@kernel.org, linux-fsdevel@vger.kernel.org, LKML , jeyu@kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 26, 2021 at 5:03 PM Luis Chamberlain wrote: > [...] > > I asked for the kconfig entry. And it would be good to document then Wow, I didn't recognize it's you, haha~ > also the worst case expected on boot for what this could do to you. I > mean, we are opening a different evil universe. So that's why the > kconfig exists. How bad and evil can this be? I just dig into it a little deeper today. Except the boot time you mentioned, I haven't dig out other bad case yet. I don't think this will affect the path lookup you mentioned before. As I know, all threads in kernel are using the same root, and after change root to 'user root', path lookup will be inside this root. One thing, the name of the root mount will change from 'rootfs' to 'tmpfs' or 'ramfs'. Before this change, what you can see with 'mount' is: $ mount rootfs on / type rootfs (rw,size=903476k,nr_inodes=225869) After this patch, it will become: $ mount tmpfs on / type tmpfs (rw,size=903476k,nr_inodes=225869) I'm not sure if this is a risk. And I tried to change pivot_root to make it support the root that have not a parent mount, but not success yet. That seems much more complex. Thanks! Menglong Dong