From: "Mickaël Salaün" <mic@digikod.net>
To: Tingmao Wang <m@maowtm.org>
Cc: "Günther Noack" <gnoack@google.com>, "Jan Kara" <jack@suse.cz>,
linux-security-module@vger.kernel.org,
"Amir Goldstein" <amir73il@gmail.com>,
"Matthew Bobrowski" <repnop@google.com>,
linux-fsdevel@vger.kernel.org,
"Tycho Andersen" <tycho@tycho.pizza>,
"Nicolas Bouchinet" <nicolas.bouchinet@ssi.gouv.fr>
Subject: Re: [RFC PATCH 5/9] Define user structure for events and responses.
Date: Wed, 12 Mar 2025 12:49:44 +0100 [thread overview]
Message-ID: <20250312.uo7QuoiZ7iu1@digikod.net> (raw)
In-Reply-To: <63681c08-dd9e-4f8f-9c41-f87762ea536c@maowtm.org>
On Tue, Mar 11, 2025 at 11:18:49PM +0000, Tingmao Wang wrote:
> On 3/11/25 19:28, Mickaël Salaün wrote:
> > On Mon, Mar 10, 2025 at 12:39:04AM +0000, Tingmao Wang wrote:
> > > On 3/6/25 03:05, Tingmao Wang wrote:
> > > [...]
> > > > This is also motivated by the potential UX I'm thinking of. For example,
> > > > if a newly installed application tries to create ~/.app-name, it will be
> > > > much more reassuring and convenient to the user if we can show something
> > > > like
> > > >
> > > > [program] wants to mkdir ~/.app-name. Allow this and future
> > > > access to the new directory?
> > > >
> > > > rather than just "[program] wants to mkdir under ~". (The "Allow this
> > > > and future access to the new directory" bit is made possible by the
> > > > supervisor knowing the name of the file/directory being created, and can
> > > > remember them / write them out to a persistent profile etc)
> > >
> > > Another significant motivation, which I forgot to mention, is to auto-grant
> > > access to newly created files/sockets etc under things like /tmp,
> > > $XDG_RUNTIME_DIR, or ~/Downloads.
> >
> > What do you mean? What is not currently possible?
>
> It is not currently possible with landlock to say "I will allow this
> application access to create and open new file/folders under this directory,
> change or delete the files it creates, but not touch any existing files".
> Landlock supervisor can make this possible (keeping track via its own state
> to allow future requests on the new file, or modifying the domain if we
> support that), but for that the supervisor has to know what file the
> application tried to create, hence motivating sending filename.
This capability would be at least inconsistent, and dangerous at worse,
because of policy inconsistencies over time. A sandbox policy should be
seen over several invocations of the same sandbox. See related deny
listing issues: https://github.com/landlock-lsm/linux/issues/28
Let's say a first instance of the sandbox can create files and access
them, but not other existing files in the same directory. A second
instance of this sandbox would not be able to access the files the same
application created, so it will not be able to clean them if required.
That could be OK in the case of the ~/Downloads directory but I think it
would be weird for users to not be able to open their previous
downloaded files from the browser, whereas it was allowed before.
For such use case, if we want to avoid new browser instances to access
old downloaded files, I'd recommand to create a new download directory
per browser/sandbox launch.
>
> (I can see this kind of policy being applied to dirs like /tmp or my
> Downloads folder. $XDG_RUNTIME_DIR is also a sensible place for this
> behaviour due to the common pattern of creating a lock/pid file/socket
> there, although on second thought a GUI sandbox probably will want to create
> a private copy of that dir anyway for each app, to do dbus filtering etc)
An $XDG_RUNTIME_DIR per sandbox looks reasonable, but in practice we
also need secure proxies/portals to still share some user's resources.
This part should be implemented in user space because the kernel doesn't
know about this semantic (e.g. DBus requests).
next prev parent reply other threads:[~2025-03-12 11:49 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-04 1:12 [RFC PATCH 0/9] Landlock supervise: a mechanism for interactive permission requests Tingmao Wang
2025-03-04 1:12 ` [RFC PATCH 1/9] Define the supervisor and event structure Tingmao Wang
2025-03-04 1:12 ` [RFC PATCH 2/9] Refactor per-layer information in rulesets and rules Tingmao Wang
2025-03-04 19:49 ` Mickaël Salaün
2025-03-06 2:58 ` Tingmao Wang
2025-03-08 18:57 ` Mickaël Salaün
2025-03-10 0:38 ` Tingmao Wang
2025-03-04 1:12 ` [RFC PATCH 3/9] Adds a supervisor reference in the per-layer information Tingmao Wang
2025-03-04 1:13 ` [RFC PATCH 4/9] User-space API for creating a supervisor-fd Tingmao Wang
2025-03-05 16:09 ` Mickaël Salaün
2025-03-10 0:41 ` Tingmao Wang
2025-03-11 19:28 ` Mickaël Salaün
2025-03-26 0:06 ` Tingmao Wang
2025-04-11 10:55 ` Mickaël Salaün
2025-03-04 1:13 ` [RFC PATCH 5/9] Define user structure for events and responses Tingmao Wang
2025-03-04 19:49 ` Mickaël Salaün
2025-03-06 3:05 ` Tingmao Wang
2025-03-08 19:07 ` Mickaël Salaün
2025-03-10 0:39 ` Tingmao Wang
2025-03-11 19:29 ` Mickaël Salaün
2025-03-10 0:39 ` Tingmao Wang
2025-03-11 19:28 ` Mickaël Salaün
2025-03-11 23:18 ` Tingmao Wang
2025-03-12 11:49 ` Mickaël Salaün [this message]
2025-03-26 0:02 ` Tingmao Wang
2025-03-05 4:13 ` kernel test robot
2025-03-04 1:13 ` [RFC PATCH 6/9] Creating supervisor events for filesystem operations Tingmao Wang
2025-03-04 19:50 ` Mickaël Salaün
2025-03-10 0:39 ` Tingmao Wang
2025-03-11 19:29 ` Mickaël Salaün
2025-03-05 5:05 ` kernel test robot
2025-03-04 1:13 ` [RFC PATCH 7/9] Implement fdinfo for ruleset and supervisor fd Tingmao Wang
2025-03-04 1:13 ` [RFC PATCH 8/9] Implement fops for supervisor-fd Tingmao Wang
2025-03-04 1:13 ` [RFC PATCH 9/9] Enhance the sandboxer example to support landlock-supervise Tingmao Wang
2025-03-05 3:36 ` kernel test robot
2025-03-04 19:48 ` [RFC PATCH 0/9] Landlock supervise: a mechanism for interactive permission requests Mickaël Salaün
2025-03-06 2:57 ` Tingmao Wang
2025-03-06 17:07 ` Amir Goldstein
2025-03-08 19:14 ` Mickaël Salaün
2025-03-11 0:42 ` Tingmao Wang
2025-03-11 19:28 ` Mickaël Salaün
2025-03-11 20:58 ` Song Liu
2025-03-11 22:03 ` Tingmao Wang
2025-03-11 23:23 ` Song Liu
2025-03-12 11:50 ` Mickaël Salaün
2025-03-12 10:58 ` Jan Kara
2025-03-12 12:26 ` Amir Goldstein
2025-03-08 18:57 ` Mickaël Salaün
2025-03-06 21:04 ` Jan Kara
2025-03-08 19:15 ` Mickaël Salaün
2025-03-12 6:20 ` Tetsuo Handa
2025-03-24 1:58 ` Tingmao Wang
2025-03-24 10:43 ` Tetsuo Handa
2026-02-15 2:41 ` Tingmao Wang
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=20250312.uo7QuoiZ7iu1@digikod.net \
--to=mic@digikod.net \
--cc=amir73il@gmail.com \
--cc=gnoack@google.com \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=m@maowtm.org \
--cc=nicolas.bouchinet@ssi.gouv.fr \
--cc=repnop@google.com \
--cc=tycho@tycho.pizza \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.