public inbox for landlock@lists.linux.dev
 help / color / mirror / Atom feed
* Does Landlock not work with eCryptfs?
@ 2023-03-19 15:56 Günther Noack
  2023-03-19 21:00 ` Mickaël Salaün
  0 siblings, 1 reply; 12+ messages in thread
From: Günther Noack @ 2023-03-19 15:56 UTC (permalink / raw)
  To: landlock

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-03-27 21:01 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-19 15:56 Does Landlock not work with eCryptfs? Günther Noack
2023-03-19 21:00 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox