public inbox for landlock@lists.linux.dev
 help / color / mirror / Atom feed
From: "Günther Noack" <gnoack3000@gmail.com>
To: landlock@lists.linux.dev
Subject: Does Landlock not work with eCryptfs?
Date: Sun, 19 Mar 2023 16:56:54 +0100	[thread overview]
Message-ID: <20230319.2139b35f996f@gnoack.org> (raw)

Hello!

I have a machine where the home directory is encrypted with eCryptfs,
and it seems that Landlock is not working properly on eCryptfs files
(but the same program works as expected on other mounts)?


## Problem description

Steps to reproduce:

  * Create a directory "subdir" in the current directory
  * Enable Landlock but ask for "subdir" to be readable
  * os.ReadDir(dir)

Observed result:

* os.ReadDir function fails when trying to open the file (verified with strace)

Expected result:

* os.ReadDir should work, because we asked for it to work when enabling Landlock


## Reproduction code

I have uploaded a reproduction program in Go to Github,
which should be understandable also if you are primarily a C user:
https://github.com/gnoack/llecryptfsrepro/blob/main/repro.go

To build and run the reproduction code, run:

  git clone https://github.com/gnoack/llecryptfsrepro
  cd llecryptfsrepro
  go build
  ./llecryptfsrepro  # executes the three steps as above, check source code

You can invoke this binary in different file system types to see the difference.


I have admittedly only checked it with a distribution kernel on
Manjaro Linux: The Linux version is 6.2.2-1-MANJARO.

This looks like a bug to me?
Is this a known issue?

Thanks,
–Günther

             reply	other threads:[~2023-03-19 15:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-19 15:56 Günther Noack [this message]
2023-03-19 21:00 ` Does Landlock not work with eCryptfs? Mickaël Salaün
2023-03-20 17:15   ` Günther Noack
2023-03-20 17:21     ` Mickaël Salaün
2023-03-21 16:36       ` Mickaël Salaün
2023-03-21 17:24         ` Christian Brauner
2023-03-21 18:16           ` Mickaël Salaün
2023-03-23 17:05             ` Günther Noack
2023-03-24 22:45               ` Tyler Hicks (Microsoft)
2023-03-24 22:53             ` Tyler Hicks
2023-03-26 21:19               ` Mickaël Salaün
2023-03-27 21:01                 ` 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=20230319.2139b35f996f@gnoack.org \
    --to=gnoack3000@gmail.com \
    --cc=landlock@lists.linux.dev \
    /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