Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4299890imw; Tue, 19 Jul 2022 04:08:43 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vB0VBW7S8JxOnXsa2XpREV1SDByFUCNjcj9WaR7I1XEGQJt8eZFddBvpc/4Kmjt59AvyWt X-Received: by 2002:a05:6808:171a:b0:333:52c2:aa2c with SMTP id bc26-20020a056808171a00b0033352c2aa2cmr17798424oib.17.1658228923145; Tue, 19 Jul 2022 04:08:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658228923; cv=none; d=google.com; s=arc-20160816; b=FGbGlaYYjmnArBTGgaj1JMZWFfnoJHH9UeTl39MA92TRDKHRSyB5RwZCUEiXxMW2+X Kgey0rtgeiJ4FLMO5JmTTXHWEXroP3YpECvARr87K+WPSrI172+oJaHcDRsgk2g7gMKc all2avYmVdc17M9F7bJG+Z6nBDycBF8iyMfwkewWiTDH2mA2Ot35djqv6deNSySTymN/ DzJQvDeYakScNTxznYcZL6tXwocnRJvYrA1OUHWfMpflSjPAMMv4jiIkk632CUlZPmbL dCo2FePU/fWxXZw2lI0Y/89P6zSH6n7dBAjAN2pKFTy6XaUgLX1ZKFz61kXfbiY1HnaE dH+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=ra5x2/muxSeeSQ3tlCgpeqbladVRxJnxCPl4bJq3p34=; b=laN1vq9RN/2jlMrh7bWnq3Y0meykvlPv0IJplZRgUYMeDiquwCZxwP1oUpQN9mRduj WDxQhG52+MnfD6bIKXl9iSfNkRG4DpzZFbtBJMWoUuiwLO+iS/lgVuK0HjFR5lJczLSG okURBBVwjywDi3tcpprPcyeeHqNkrAsXbRVdG7al9z8pd81JicXyOpYa/iO99ZIjLyI6 7UdCtJb3Sm6Ub1wlbaEGl/jeW2C9+M3rF2Fgyw6HQZ2JDW0bmB5PSpD1GrHLnm66BBDQ +O/dcr1PbQrKGoLExFaqdVPT1VybHoPYDJkej0mgA0Ic/tIKqvPGla6ziTaiz8vMzzBI CCSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@landley-net.20210112.gappssmtp.com header.s=20210112 header.b=2lKKxFzS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w188-20020a4a5dc5000000b004355d9522bbsi11392144ooa.63.2022.07.19.04.08.29; Tue, 19 Jul 2022 04:08:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@landley-net.20210112.gappssmtp.com header.s=20210112 header.b=2lKKxFzS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237422AbiGSKxU (ORCPT + 99 others); Tue, 19 Jul 2022 06:53:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237376AbiGSKxQ (ORCPT ); Tue, 19 Jul 2022 06:53:16 -0400 Received: from mail-oo1-xc33.google.com (mail-oo1-xc33.google.com [IPv6:2607:f8b0:4864:20::c33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FBF3402E2 for ; Tue, 19 Jul 2022 03:53:14 -0700 (PDT) Received: by mail-oo1-xc33.google.com with SMTP id t11-20020a4ad0ab000000b004356ab59d3bso2802744oor.7 for ; Tue, 19 Jul 2022 03:53:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=landley-net.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=ra5x2/muxSeeSQ3tlCgpeqbladVRxJnxCPl4bJq3p34=; b=2lKKxFzSTFfoAqHkPQJOZzk9NSwhvMVfz9AI6037udC8exCOdgmjJTCzLfGNh8TiZR juF5/5iF/lwpY0I4eBxOM7ch26XEY1pzvru00V28d56VKmfDdmUC/dvbNUXfD/GneoTj e62bDsHZKQ06qjQfN6BdAPe8q7wMqzTya9y9Oxq/85+9tv+FEcRChm48xzwJ+vVtJutJ ocu7WYAHxW+9letk5IuqILyJfJ0omA9TYCGqGI3ZW12BP0J1uMrdUw4g3mf6Dnq9iC2d KIoG/xTswyWySLrhFnRZ2Qa4cNrCubzn949cy5pGWP6ba+vFmgIdE/fnF+KPaKPeGBQd k/Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=ra5x2/muxSeeSQ3tlCgpeqbladVRxJnxCPl4bJq3p34=; b=suDBKOntzFWAdZWBLLKJMrRP+ogNW6NMSLE98Ev4Jxcy0FoSgKBxng8DJo9YX7WPel tIsBCK9dzGTfdU6clR9wZHO63oPPAbQ1Q0r1/GPGW1mW0o9fPbQA+mmqFvi9yKUwymM8 q0oSp+XmyOibNsyK7eCCGCxoc4uqzo28qJHU58mN9SFSQ3QLk1rR6+5NVyrkt0g2/79s KhtV1kPzw/s3PYltIt9FQzm1Hx8X71gIRrpxvXAzS0hJuGrAAsV/yzf3HZaOiTTjihE+ yvw7Fzt5Z6r1N7arq7HAEkhsezQPPVYw/eWAX5m1Xa4n75mSPwn+D8Xz5e9nBaBZdwEi zjng== X-Gm-Message-State: AJIora+IRIeawycpV9fWb3pBqR+eIYpFObmHQEsnNRMn6lU/DetcifN3 5rldUyAOjM4/uBMI5p3mv9pQzw== X-Received: by 2002:a4a:864b:0:b0:425:71ed:ada7 with SMTP id w11-20020a4a864b000000b0042571edada7mr10923632ooh.92.1658227993382; Tue, 19 Jul 2022 03:53:13 -0700 (PDT) Received: from [192.168.86.210] ([136.62.38.22]) by smtp.gmail.com with ESMTPSA id cg4-20020a056830630400b0061c7ac52b75sm5901958otb.26.2022.07.19.03.53.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Jul 2022 03:53:12 -0700 (PDT) Message-ID: <99ae4aa6-b55a-55a9-e836-b0b483a358d6@landley.net> Date: Tue, 19 Jul 2022 06:00:04 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH v4 0/3] initramfs: add support for xattrs in the initial ram disk Content-Language: en-US To: Roberto Sassu , Jim Baxter , Eugeniu Rosca Cc: "hpa@zytor.com" , Masahiro Yamada , Arvind Sankar , Mimi Zohar , "viro@zeniv.linux.org.uk" , "linux-security-module@vger.kernel.org" , "linux-integrity@vger.kernel.org" , "initramfs@vger.kernel.org" , "linux-api@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bug-cpio@gnu.org" , "zohar@linux.vnet.ibm.com" , Silviu Vlasceanu , Dmitry Kasatkin , "takondra@cisco.com" , "kamensky@cisco.com" , "arnd@arndb.de" , "james.w.mcmechan@gmail.com" , "linux-kbuild@vger.kernel.org" , Dirk Behme , Eugeniu Rosca References: <33cfb804-6a17-39f0-92b7-01d54e9c452d@huawei.com> <1561909199.3985.33.camel@linux.ibm.com> <45164486-782f-a442-e442-6f56f9299c66@huawei.com> <1561991485.4067.14.camel@linux.ibm.com> <0c17bf9e-9b0b-b067-cf18-24516315b682@huawei.com> <20220609102627.GA3922@lxhi-065> <21b3aeab20554a30b9796b82cc58e55b@huawei.com> <20220610153336.GA8881@lxhi-065> <4bc349a59e4042f7831b1190914851fe@huawei.com> <20220615092712.GA4068@lxhi-065> <032ade35-6eb8-d698-ac44-aa45d46752dd@mentor.com> From: Rob Landley In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/18/22 11:49, Roberto Sassu wrote: > Uhm, I guess this could be solved with: > > https://github.com/openeuler-mirror/kernel/commit/18a502f7e3b1de7b9ba0c70896ce08ee13d052da > > and adding initramtmpfs to the kernel command line. It's initmpfs. You can argue about whether it should have two t's (I was consistent naming it in the patch series adding it), but ramfs and tmpfs are two different things and saying "initramtmpfs" is like saying "mount -t ext4btrfs". > You are probably using ramfs, which does not have xattr support. Do not specify root= in your kernel command line. If you specify root= you're saying "switch off of initramfs to a different root filesystem", so it doesn't make the overmounted filesystem tmpfs because you told it you wouldn't be using it. (The decision of what to mount has to be made before it examines the cpio.gz contents, so root= is used to signal "we are not keeping this initramfs" because that's literally what root= means. Your root filesystem is not initramfs, it is instead this thing to be mounted over initramfs.) You can tell which you're using via /proc/mounts having a line: rootfs / rootfs rw,size=121832k,nr_inodes=30458 0 0 If it's got the size= then it's tmpfs: ramfs basically doesn't have bounds checking and "cat /dev/null > filename" on ramfs will lock your system solid due to unpinnable memory exhaustion. If you don't have a "rootfs" line at ALL then root= was used to overmount and part of the gratuitously magic behavior of root= is it hides the rootfs line from /proc/mounts even though the filesystem is actually still there, which is not something it does for ANY OTHER OVERMOUNT: $ mkdir sub $ mount -t proc proc sub $ mount -t ramfs sub sub $ grep sub /proc/mounts proc /sub proc rw,relatime 0 0 sub /sub ramfs rw,relatime 0 0 I've never understood why they added that gratuitous special case to hide how the system actually works, but it's a land mine you have to be told about after you've stepped on it in order to understand what's going on. Part of the reason people think initramfs is so "magic" when PID 1 isn't, we don't HIDE the fact that PID 1 is always there but we hide the fact initramfs is... Rob