Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp5178475rdb; Sat, 30 Dec 2023 09:01:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IGwWlQg4Kk/7FAvJ/zS28oYDdK8/Q04zSIYOgrb34PlQM1TxPcYPhZd/ywu4TwZtf9muMM3 X-Received: by 2002:a05:6a20:da9e:b0:196:38d:451f with SMTP id iy30-20020a056a20da9e00b00196038d451fmr8722095pzb.47.1703955714487; Sat, 30 Dec 2023 09:01:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703955714; cv=none; d=google.com; s=arc-20160816; b=A/YY5kKDYbVf+DdPVdWOF2fCj69h/MlPVpPBrBX0Sp++9baWmHExd0qR2JKtGrJ8Hb X1/tIGuT3w3ZF32fgI2vr+kNUMPlBfkEzZT9J3092dEy3/6WAOsBQKaM2AX8FUn7uxC7 cBm5SHeD5X2d9XFQr/qxRglsEwmQKSQlRioOfiejUVc5jSf32rruUM/4YBnJFE5h2OhE HuyenWxxnBFOgJExH+UalWjRDxh5a9rylb/a7K/4zuaCwgVxxuwU6ox60ME83zsDgFdS gv8wZAaI6R8F4rJuJ8zuStH4DOFE/S9NOr79yNlH5gaoBVzLH3ziTjuS/3KpQ/T2TMzB ViDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=4QIcJTcmD+09gxsUfvwoVCUHhs5+yptu+2GvRucqwo0=; fh=MoN5VjKtDd9aOxCCk4Il7Fhp2wRKY+0wsP7txpPODZA=; b=FB9cFM9nO77HWaZDnC7anJEfCyhGBkZ4EQ3vWDogTPJZT2v7TXolMPTvOAMyGyin+6 VLwd0WkKYCaYCmQ5q07+uRWixZvD9DYCvR6YhBMjVJaXNqWomb1FtS51SSCfygWzIvds Y+lmxROX5msZ8ms1pYBsiqHTFgWEx1jlOC4VfOTVEUdpC/M0k7wD1I5WXDtOH1M9Yb+p 0UmKdL8HMa841sj9d7BVZXvm873+yKsLZ5ff4hz+vGrfnn4lgEim6dDFw+XbCw1pvwoH w7OVivvMIULo3pyBq5aVBTMnO/V4tuzoBKRIdZIYbBF69qBTubH8nZ3A7K2Tc5jH1Fst imWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@landley-net.20230601.gappssmtp.com header.s=20230601 header.b=iQgC0v0l; spf=pass (google.com: domain of linux-kernel+bounces-13516-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13516-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id a13-20020a65418d000000b005ca4098bf66si16194203pgq.637.2023.12.30.09.01.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Dec 2023 09:01:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-13516-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@landley-net.20230601.gappssmtp.com header.s=20230601 header.b=iQgC0v0l; spf=pass (google.com: domain of linux-kernel+bounces-13516-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13516-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 21C6128202B for ; Sat, 30 Dec 2023 17:01:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 02404BA37; Sat, 30 Dec 2023 17:01:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=landley-net.20230601.gappssmtp.com header.i=@landley-net.20230601.gappssmtp.com header.b="iQgC0v0l" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-oo1-f52.google.com (mail-oo1-f52.google.com [209.85.161.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC3B18F71 for ; Sat, 30 Dec 2023 17:01:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=landley.net Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=landley.net Received: by mail-oo1-f52.google.com with SMTP id 006d021491bc7-59552c93366so135685eaf.1 for ; Sat, 30 Dec 2023 09:01:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=landley-net.20230601.gappssmtp.com; s=20230601; t=1703955703; x=1704560503; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=4QIcJTcmD+09gxsUfvwoVCUHhs5+yptu+2GvRucqwo0=; b=iQgC0v0lu9Q5bfQ9VDRPMuWBQ01QXu5mtgVnYRoOEiA98LpoYOSbwL9u3bIH5edRpb KXwqGPRkZO/CXQS0cIHU7HIatnlW+ElYb5F2HLozY2/2K9CycY6+qe9J84qutP9v7cs0 jHdCIv/5iJ1Ng/sIVF8jUYIpCZXKZhw2t5na4o0Rvf6m/wg83IOUaq25VfKwBMQEKrg8 vPdmuxqZRoY4rwFIYvxGe9vT7qi4wu5By8NZNSzfXuNueCs4RPsC+5vw/4rYtRWyiLpq 6LQ1zAnvQL0Y1J6YMf6n+O8kvoBBJVOYu6ic5KoEC2dZvrNUs2JHg7XslM6o9LVHMAwI jyXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703955703; x=1704560503; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4QIcJTcmD+09gxsUfvwoVCUHhs5+yptu+2GvRucqwo0=; b=uwH3mGZ3hZ0RWDwqUxobacjpRX8sRrImCPEvKwP7gd364DGjHfZAtHlNFSMQ0Qbfal sOc76p/nMV5EsnJM9FT3P+eP+IWjx/XRy6BS0sAdZAELWtisJHZeYm4MG7x8BnLsY56w snVHfOfeL/9vqCW3q0DFNnAAqj9h/PJ0bBPmf6fju28w9FHXuj3SwamO3hAD9I5tYj+K v1RADlAynmG2w+WTQGqSmMWXQlOuhsnsECG5f2+UANWj9evxW1P9345wMRuCPm0Idcvv i6OjDnv2cxlFq0rB1eO4Lb5HDOVlJPBJdDWGHYHur/7uAAl8R6MrECrqsqfKX47Rt2ZP 717Q== X-Gm-Message-State: AOJu0YzOkdF2sF4QfewktiKWPsMjoBrXEdWRheGwdLRPbNWrxd5Crncr jvvEtftzN7T5xFs8CVJIVcdpT9dR8n32eg== X-Received: by 2002:a05:6820:1691:b0:58d:ac91:1dd0 with SMTP id bc17-20020a056820169100b0058dac911dd0mr6483989oob.9.1703955702953; Sat, 30 Dec 2023 09:01:42 -0800 (PST) Received: from [192.168.1.4] ([136.62.51.249]) by smtp.gmail.com with ESMTPSA id h123-20020a4a5e81000000b00595086848a8sm860674oob.16.2023.12.30.09.01.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 30 Dec 2023 09:01:42 -0800 (PST) Message-ID: Date: Sat, 30 Dec 2023 11:08:00 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v3] rootfs: Fix support for rootfstype= when root= is given Content-Language: en-US To: Stefan Berger , Askar Safin Cc: gregkh@linuxfoundation.org, initramfs@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, zohar@linux.ibm.com References: <0879141d-462c-7e94-7c87-7a5b5422b8ed@landley.net> From: Rob Landley In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 12/29/23 13:14, Stefan Berger wrote:>> That said, the code I wrote is doing a strstr to see if the argument's there, >> but doesn't care what ELSE is there, so it could easily be >> "rootfstype=tmpfs,ext4" and have the userspace script also filter the argument >> for just what it's interested in, since at that point it's NOT THE KERNEL DOING IT. > > It's a bit tricky that this particular option, that can support a > comma-separated list, is shared between kernel and user space and user > space does not already filter-out what is not relevant for it. Debian's code sometimes has bugs, especially their initramfs stuff doesn't get a lot of scrutiny: https://lkml.iu.edu/hypermail/linux/kernel/1705.2/05611.html https://lkml.iu.edu/hypermail/linux/kernel/1705.3/01182.html https://lkml.org/lkml/2017/9/13/651#:~:text=Debian's But they're pretty good about fixing bugs pointed out to them: https://salsa.debian.org/kernel-team/initramfs-tools/-/commit/49e4a0555f51 The kernel having more capabilities here than Debian's userspace does isn't new, it's what gives debian's userspace the opportunity to gain new capabilities. Although in this case, the patch in question still isn't in lkml 5 years later because Debian development is much more responsive than linux-kernel: https://lkml.iu.edu/hypermail/linux/kernel/2302.2/05597.html >>> Setting the kernel boot command line option rootfstype= to tmpfs or >>> ramfs was possible so far and that's what the documentation and code >>> supported so far as well. The bug surfaced when root= was provided, in >>> which case it was ignored. >> >> No, as I explained when I wrote the initmpfs code in 2013 when you say root= you >> are explicitly requesting the kernel mount a second file system over rootfs > > From the perspective of needing xattr support in initramfs it's > unfortunately not so obvious what the filesystem type of the kernel's > rootfs (presumably the 1st file system) has to do with the option given > for the 2nd filesystem. Though the Debian scripts are the bigger problem > it seems. Ping Ben if initramfs-tools needs updating? I've been following the initramfs xattr support threads forever: https://lkml.iu.edu/hypermail/linux/kernel/2207.3/06939.html I'm happy to add new format support to toybox cpio if anybody comes to an agreement on what that should be, but last time there was "as long as we're here 32 bit timestamps" and "sparse file support could be" and various bikeshedding... Was there a new thread I didn't get cc'd on? The last I have is... July 2022 I think? > However, for those one could argue that the Debian scripts > could be updated and for as long as they are not able to filter-out the > tmpfs or ramfs options we are interested in one cannot pass these > options or a comma-separated list on systems that run the current Debian > scripts. You can argue that current userspace does not take full advantage of the existing kernel API, sure. >> (that's what root= MEANS), and thus don't bother making it a (more expensive) >> tmpfs because it's not sticking around. > > That's true unless you want to use IMA signature enforcement in the > initramfs already and tmpfs is now required. I agree that if you want to add a new requirement, you may need to modify userspace. Let me see if I understand your problem: it sounds like debian's initramfs-tools overloads the root= and rootfstype= arguments parsed by the kernel to have a second meaning (the kernel uses them for one thing, you want to use them for something else, and there's currently a semantic gap between the two.) You want to add a new capability requiring a new build dependency in the initramfs-tools package because it's doing new stuff, but there cannot be any OTHER changes made to initramfs-tools, so the kernel should change its existing semantics instead. You can't NOT provide root=, and you can't provide initramfstype=tmpfs... either, and those are the two existing ways to tell rootfs to be tmpfs instead of ramfs. You'd like to add a third way to specify the same thing. Do I have that right? > Stefan Rob