mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roberto Sassu <roberto.sassu@huaweicloud.com>
To: Christian Brauner <brauner@kernel.org>, Danny Hu <dannyhu@arista.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
	Mimi Zohar <zohar@linux.ibm.com>,
	 Roberto Sassu <roberto.sassu@huawei.com>,
	Dmitry Kasatkin <dmitry.kasatkin@gmail.com>,
	Eric Snowberg <eric.snowberg@oracle.com>, Jan Kara <jack@suse.cz>,
	Victor Kamensky <kamensky@cisco.com>,
	Taras Kondratiuk <takondra@cisco.com>,
	Zheng Zengkai <zhengzengkai@huawei.com>,
	zhangguangzhi <zhangguangzhi3@huawei.com>,
	Jason Yan <yanaijie@huawei.com>,
	silviu.vlasceanu@huawei.com, hpa@zytor.com, arnd@arndb.de,
	 james.w.mcmechan@gmail.com, niveditas98@gmail.com,
	pierre@arista.com,  julien@arista.com, kbharathi@arista.com,
	alexandr.lobakin@intel.com,  linux-fsdevel@vger.kernel.org,
	linux-integrity@vger.kernel.org,
	 linux-security-module@vger.kernel.org,
	linux-kbuild@vger.kernel.org,  initramfs@vger.kernel.org,
	linux-api@vger.kernel.org,  linux-kernel@vger.kernel.org,
	bug-cpio@gnu.org
Subject: Re: [PATCH v6 0/4] initramfs: add support for xattrs in the initial ram disk
Date: Wed, 11 Nov 2026 14:45:34 +0100	[thread overview]
Message-ID: <a9edb8a433e8efcba3d11b2a06fa1063df41a24d.camel@huaweicloud.com> (raw)
In-Reply-To: <20261110-hengst-tontechnik-ausfuhr-265b06d68611@brauner>

On Tue, 2026-11-10 at 17:21 +0100, Christian Brauner wrote:
> On Thu, Nov 05, 2026 at 11:37:39AM -0800, Danny Hu wrote:
> > This proposal consists in including file metadata as additional files named
> > METADATA!!!, for each file added to the ram disk. The CPIO parser in the
> > kernel recognizes these special files from the file name, and calls the
> > appropriate parser to add metadata to the previously extracted file.
> 
> No, sorry. We're not going to do this:
> 
> * This is in-band signalling by filename. A METADATA!!! entry changes
>   the meaning of whatever came before it in the stream.

Yes, it is a hack, but such an image is backward compatible with
previous versions. There is no new format, version bump, etc.

>   Which is just the TRAILER!!! nonsense all over again (cf. [1]).
>   No cpio tool knows about it and a kernel without this parser silently
>   extracts the metadata as junk files.

METADATA!!! is stored in ramfs/tmpfs if not processed, so it is just a
temporary file, like the rest of the initramfs content.

> * It sets whatever xattrs the archive comes with through vfs_setxattr()
>   during early boot. Which is insane.

Similarly, the archive can already ship arbitrary binaries that get
executed as root. If you want, we could restrict it to security.ima and
security.evm only.

>   Not just security.ima but security.capability, security.selinux,
>   trusted.* and anything else.
> 
>   And we've NAKed this before in 2018 (cf. [2]).
>   The magic file name scheme was called a kludge back then too (cf. [3]).
>   Nothing about that has changed.
> 
> * The initrd is already covered as a whole. Appraising
>   individual files inside an image whose integrity is plain weird.

I agree when the image is prebuilt and has a known reference value. As
far as I know, there is no reference value when the initial ram disk is
dynamically generated on the host. In the latter case, using finer-
granularity measurement/appraisal is the only option.


> * If kernel and initrd are owned by different parties this can be
>   done in userspace. A trusted /init can apply xattrs from a manifest
>   before it runs anything else. That was pointed out in 2019 already
>   (cf. [4], [5], [6]).

Unless the trusted /init is in the kernel image and launched as User-
Mode-Driver (UMD), you need to measure/appraise it, which again
requires its signature to be carried in the initial ram disk.


> This has been proposed in some form since 2018 and never found a
> maintainer willing to take it. I'm not taking a private cpio extension
> into init/initramfs.c either.

I understand. v3 was close to being upstreamed but then got stuck
because nobody was willing to take it, despite all review comments
being addressed. In its favor, this extension is harmless. If
METADATA!!! is not there, nothing happens. If it is there and not
supported, it is a junk file removed together with the rest of the
initramfs content.

Roberto

> [1]: https://lore.kernel.org/r/d69f329c-8365-bb0e-69ee-774cbea141b2@zytor.com
> [2]: https://lore.kernel.org/r/3d1bfbd7-7d45-4cf1-32d6-7f6985b42393@schaufler-ca.com
> [3]: https://lore.kernel.org/r/f2886ac7-aff9-94bc-5f65-b3b2e946a6ff@schaufler-ca.com
> [4]: https://lore.kernel.org/r/20190512091748.s6fvy2f5p2a2o6ja@isilmar-4.linta.de
> [5]: https://lore.kernel.org/r/20190512194322.GA71658@rani.riverdale.lan
> [6]: https://lore.kernel.org/r/CALCETrV3b205L38xqPr6QqwGn6-vxQdPoJGUygJJpgM-JqqXfQ@mail.gmail.com
> 


      reply	other threads:[~2026-11-11 13:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-05 19:37 Danny Hu
2026-11-05 19:37 ` [PATCH v6 1/4] ima: skip algorithm availability check until initramfs unpacking is finished Danny Hu
2026-11-05 19:37 ` [PATCH v6 2/4] initramfs: add file metadata Danny Hu
2026-11-05 19:37 ` [PATCH v6 3/4] initramfs: read metadata from special file METADATA!!! Danny Hu
2026-11-05 19:37 ` [PATCH v6 4/4] gen_init_cpio: add support for file metadata Danny Hu
2026-11-10 16:21 ` [PATCH v6 0/4] initramfs: add support for xattrs in the initial ram disk Christian Brauner
2026-11-11 13:45   ` Roberto Sassu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a9edb8a433e8efcba3d11b2a06fa1063df41a24d.camel@huaweicloud.com \
    --to=roberto.sassu@huaweicloud.com \
    --cc=alexandr.lobakin@intel.com \
    --cc=arnd@arndb.de \
    --cc=brauner@kernel.org \
    --cc=bug-cpio@gnu.org \
    --cc=dannyhu@arista.com \
    --cc=dmitry.kasatkin@gmail.com \
    --cc=eric.snowberg@oracle.com \
    --cc=hpa@zytor.com \
    --cc=initramfs@vger.kernel.org \
    --cc=jack@suse.cz \
    --cc=james.w.mcmechan@gmail.com \
    --cc=julien@arista.com \
    --cc=kamensky@cisco.com \
    --cc=kbharathi@arista.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=niveditas98@gmail.com \
    --cc=pierre@arista.com \
    --cc=roberto.sassu@huawei.com \
    --cc=silviu.vlasceanu@huawei.com \
    --cc=takondra@cisco.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=yanaijie@huawei.com \
    --cc=zhangguangzhi3@huawei.com \
    --cc=zhengzengkai@huawei.com \
    --cc=zohar@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®