Linux Security Modules development
 help / color / mirror / Atom feed
From: "Mickaël Salaün" <mic@digikod.net>
To: "Günther Noack" <gnoack@google.com>
Cc: Christian Brauner <brauner@kernel.org>,
	 linux-security-module@vger.kernel.org,
	Paul Moore <paul@paul-moore.com>,
	 Amir Goldstein <amir73il@gmail.com>,
	Miklos Szeredi <miklos@szeredi.hu>,
	 Serge Hallyn <serge@hallyn.com>,
	Stephen Smalley <stephen.smalley.work@gmail.com>
Subject: Re: [PATCH v4 2/5] landlock: Require LANDLOCK_ACCESS_FS_MAKE_REG for whiteout creation
Date: Fri, 31 Jul 2026 17:14:49 +0200	[thread overview]
Message-ID: <20260731.Eemae3quu2na@digikod.net> (raw)
In-Reply-To: <amyvWp25gjy_U5Hv@google.com>

On Fri, Jul 31, 2026 at 04:21:14PM +0200, Günther Noack wrote:
> On Fri, Jul 31, 2026 at 01:07:57PM +0200, Mickaël Salaün wrote:
> > On Fri, Jul 24, 2026 at 06:10:01PM +0200, Günther Noack wrote:
> > > +
> > > +/**
> > > + * DOC: erratum_4
> > > + *
> > > + * Erratum 4: Creation of whiteout objects
> > > + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > + *
> > > + * This fix addresses an issue through which it was possible to create whiteout
> > > + * objects, even when all file creation is restricted using Landlock.
> > > + *
> > > + * With this fix, the creation of whiteout objects is now guarded using
> > > + * ``LANDLOCK_ACCESS_FS_MAKE_REG``, both when it is done through
> > > + * :manpage:`renameat2(2)` with `RENAME_WHITEOUT`, and when it is done through
> > > + * :manpage:`mknod(2)` with ``S_IFCHR`` and ``makedev(0, 0)`` (which previously
> > > + * required ``LANDLOCK_ACCESS_FS_MAKE_CHAR``).
> > > + *
> > > + * Whiteout objects are special file types used in OverlayFS to mark the absence
> > > + * of a file in an upper file system, even when the lower (often read-only) file
> > > + * system does have a file with the same name.
> > > + *
> > > + * Impact:
> > > + *
> > > + * Without this fix, it was possible to create whiteout files from userspace
> > > + * using :manpage:`renameat2(2)` with the ``RENAME_WHITEOUT`` flag.
> > 
> > The errata should focus on the change of access rights which are needed
> > (and could potentially break some use cases), not to talk about the
> > RENAME_WHITEOUT (bypass) fix.  Most fixes don't get a Landlock errata
> > bit.  The impact should then be explicit that this is for sandboxed
> > programs such as fuse-overlayfs.
> > 
> > This patch does two things:
> > - fix the RENAME_WHITEOUT creating a whitout without being controlled
> >   (no errata, just a fix),
> > - and repurpose the MAKE_REG to control whitetout creation instead of
> >   relying on MAKE_CHAR (which needs an errata because it could break
> >   legitimate use cases/policies).
> 
> FYI, I'm thinking to change the phrasing to this:
> 
> /**
>  * DOC: erratum_4
>  *
>  * Erratum 4: Creation of whiteout objects
>  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>  *
>  * This fix changes the access rights required for the creation of whiteout
>  * objects through :manpage:`mknod(2)` with ``S_IFCHR`` and ``makedev(0, 0)``.

Adding renameat2 + RENAME_WHITEOUT would be better too.

>  * This way of creating whiteout objects is now guarded by
>  * ``LANDLOCK_ACCESS_FS_MAKE_REG`` instead of ``LANDLOCK_ACCESS_FS_MAKE_CHAR``.
>  *
>  * Whiteout objects are used in OverlayFS to mark the absence of a file in an
>  * upper file system.  Despite being created with ``S_IFCHR``, whiteout objects
>  * do not count as character devices.
>  *
>  * Impact:
>  *
>  * Sandboxed programs that create OverlayFS whiteouts (such as fuse-overlayfs)
>  * now require ``LANDLOCK_ACCESS_FS_MAKE_REG`` instead of
>  * ``LANDLOCK_ACCESS_FS_MAKE_CHAR``.
>  */
> LANDLOCK_ERRATUM(4)
> 
> Please let me know whether that sounds better.

This looks good, thanks!

  reply	other threads:[~2026-07-31 15:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-24 16:09 [PATCH v4 0/5] landlock: Restrict whiteout object creation Günther Noack
2026-07-24 16:10 ` [PATCH v4 1/5] selftests/landlock: Use an actual chardev for MAKE_CHAR audit test Günther Noack
2026-07-24 16:10 ` [PATCH v4 2/5] landlock: Require LANDLOCK_ACCESS_FS_MAKE_REG for whiteout creation Günther Noack
2026-07-31 11:07   ` Mickaël Salaün
2026-07-31 13:13     ` Günther Noack
2026-07-31 14:21     ` Günther Noack
2026-07-31 15:14       ` Mickaël Salaün [this message]
2026-07-31 13:13   ` Mickaël Salaün
2026-07-31 14:05     ` Günther Noack
2026-07-24 16:10 ` [PATCH v4 3/5] selftests/landlock: Add tests for whiteout object creation Günther Noack
2026-07-31 13:22   ` Mickaël Salaün
2026-07-31 14:18     ` Günther Noack
2026-07-24 16:10 ` [PATCH v4 4/5] selftests/landlock: Test whiteout object behaviour in OverlayFS renames Günther Noack
2026-07-31 13:43   ` Mickaël Salaün
2026-07-24 16:10 ` [PATCH v4 5/5] landlock: Link the erratum documentation for whiteout objects Günther Noack

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=20260731.Eemae3quu2na@digikod.net \
    --to=mic@digikod.net \
    --cc=amir73il@gmail.com \
    --cc=brauner@kernel.org \
    --cc=gnoack@google.com \
    --cc=linux-security-module@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=paul@paul-moore.com \
    --cc=serge@hallyn.com \
    --cc=stephen.smalley.work@gmail.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