landlock.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: "Mickaël Salaün" <mic@digikod.net>
To: Yves Rutschle <landlock@rutschle.net>
Cc: landlock@lists.linux.dev
Subject: Re: Landlock setup
Date: Mon, 7 Nov 2022 19:02:04 +0100	[thread overview]
Message-ID: <78f7af34-cbd7-eb25-60fb-64385d118d90@digikod.net> (raw)
In-Reply-To: <20221107172216.GA10688@rutschle.net>

Hi Yves,

On 07/11/2022 18:22, Yves Rutschle wrote:
> Hello everyone,
> 
> Following Mickael's presentation of Landlock at
> Pass-the-Salt 2022, I intend to add support for it to sslh.
> 
> I'm starting from the beginning: compiling and running the
> example, which so far complains the LSM is not loaded, when
> the kernel tells me it is...
> 
> I'm running a stock Debian where I manually add landlock to
> the command line:
> 
> [    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-5.18.0-3-amd64 root=UUID=79c3bdf6-4be2-46d6-b006-bb17170247b1 ro quiet lsm=landlock

This is correct, but you may also want to enable other LSMs if you are 
using them (e.g. Yama). You should probably stick to the new default 
Debian Sid cmdline: 
https://salsa.debian.org/kernel-team/linux/-/commit/1ef40f40e593a5dc223e9ce171fa8f2cd5aba198

> 
> the kernel indicates the LSM is started:
> 
> [    0.076550] LSM: Security Framework initializing
> [    0.076559] landlock: Up and running.
> 
> 
> Yet running the example fails:
> 
> # LL_FS_RO="/bin:/lib:/usr:/proc:/etc:/dev/urandom" LL_FS_RW="/dev/null:/dev/full:/dev/zero:/dev/pts:/tmp" ./lock bash -i
> Failed to check Landlock compatibility: Function not implemented
> Hint: Landlock is not supported by the current kernel. To support it, build the kernel with CONFIG_SECURITY_LANDLOCK=y and prepend "landlock," to the content of CONFIG_LSM.
> 
> 
> 
> What would I be doing wrong?

Your setup is good and it should work. You can debug a bit more with an 
up-to-date strace (which will print the Landlock syscalls). I guess you 
are running this sample in a strict seccomp environment that denies 
Landlock syscalls. This may be the result of using an old container 
runtime (Docker, Podman and runc are now patched but the related fix may 
not be backported).

  reply	other threads:[~2022-11-07 18:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-07 17:22 Landlock setup Yves Rutschle
2022-11-07 18:02 ` Mickaël Salaün [this message]
2022-11-08 11:27   ` Yves Rutschle
2022-11-08 14:13     ` Mickaël Salaün
2022-11-08 17:15       ` Yves Rutschle
2022-12-16  9:44         ` Mickaël Salaün
2022-12-16  9:53           ` Yves Rutschle
2022-12-16 10:34             ` Mickaël Salaün
2023-01-08 15:29               ` Yves Rutschle

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=78f7af34-cbd7-eb25-60fb-64385d118d90@digikod.net \
    --to=mic@digikod.net \
    --cc=landlock@lists.linux.dev \
    --cc=landlock@rutschle.net \
    /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;
as well as URLs for NNTP newsgroup(s).