All of lore.kernel.org
 help / color / mirror / Atom feed
From: Omar Polo <op@omarpolo.com>
To: "Mickaël Salaün" <mic@digikod.net>
Cc: gameoftrees@openbsd.org, Thomas Adam <thomas@xteddy.org>,
	landlock@lists.linux.dev
Subject: Re: GoT Landlock fixes
Date: Thu, 10 Feb 2022 22:52:05 +0100	[thread overview]
Message-ID: <87k0e28jqv.fsf@omarpolo.com> (raw)
In-Reply-To: <1dd9e03e-0f04-4722-0874-fb3b1757b7bb@digikod.net>

Hello,

Mickaël Salaün <mic@digikod.net> writes:

> Hi,
>
> I noticed Omar Polo added support for Landlock to the Linux version of
> Game Of Trees [1]. This is great! However, the handled filesystem
> access is only LANDLOCK_ACCESS_FS_READ_FILE, and it will still be
> allowed to do multiple filesystem-related actions (e.g. write to
> files, remove files…). I don't know much about Game Of Trees but,
> according to the commit message, I think you would like to revoke any
> (currently supported) filesystem access. You should then add the 12
> remaining access rights [2]. There is also a typo in the errno check,
> it should be EOPNOTSUPP (not ENOTSUP). You'll find a small patch
> attached. Let me know if I can help.
>
> In a nutshell, the ruleset's handled_access_fs is required for
> backward and forward compatibility (i.e. the kernel and user space may
> not know each other's supported restrictions), hence the need to be
> explicit about the denied-by-default access rights.

Yes, the original diff had all the actions, but when I picked that up
again before it got committed I got confused and dropped the others (I
was sure the checks not listed there were dropped by default.)  I humbly
apologies to everyone for the incredibly stupid mistake, I don't have
any excuse.

Regarding the ENOTSUP/EOPNOTSUPP mistake, I thought that on linux the
two errno were defined to the same value, but I agree on the change
obviously (this point was raised by Brian too recently.)

Thanks a lot for reviewing the diff and fixing my mistake!

> Regards,
>  Mickaël
>
>
> [1]
> https://git.gameoftrees.org/gitweb/?p=got-portable.git;a=commit;h=97799ccd4b67a81f97039305d4fdd66588da9962
> [2] https://docs.kernel.org/userspace-api/landlock.html#filesystem-flags
>
> [2. text/x-patch; 0001-portable-extend-support-for-Landlock-and-fix-error-h.patch]...


  reply	other threads:[~2022-02-10 22:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-10 17:34 GoT Landlock fixes Mickaël Salaün
2022-02-10 21:52 ` Omar Polo [this message]
2022-02-11 10:39 ` Stefan Sperling
2022-02-11 17:15   ` Mickaël Salaün
2022-02-11 20:11     ` Stefan Sperling
2022-02-14 11:23       ` Mickaël Salaün

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=87k0e28jqv.fsf@omarpolo.com \
    --to=op@omarpolo.com \
    --cc=gameoftrees@openbsd.org \
    --cc=landlock@lists.linux.dev \
    --cc=mic@digikod.net \
    --cc=thomas@xteddy.org \
    /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.