From: "Dr. Greg" <greg@enjellic.com>
To: penguin-kernel@I-love.SAKURA.ne.jp,
linux-security-module@vger.kernel.org
Subject: TOMOYO and runc containers dislike one another.
Date: Thu, 21 Nov 2024 12:42:07 -0600 [thread overview]
Message-ID: <20241121184207.GA11007@wind.enjellic.com> (raw)
Hi Tetsuo, I hope this note finds your day going well.
The rather lively discussion we had here, after you submitted your
patches to Linus to allow TOMOYO to be implemented as a loadable LSM,
caused us to put some resources into the upcoming V5 release of TSEM,
in order to generalize its modeling capabilities.
As a result of that work, we are now able to implement TOMOYO as a
TSEM loadable module/model plugin that implements the TOMOYO security
model, in an isolated security modeling namespace that is driven by
LSM events that only occur in that namespace.
Essentially a demonstration of workload specified LSM's. A few rough
edges, but it is significantly beyond a proof of concept
implementation.
We don't suggest that it fixes the problem with Linux distributions
not compiling TOMOYO or AppArmor into the kernel. It does however
demonstrate that an LSM can be created that has generic modeling
capabilities that can be implemented with loadable modules in a
namespace specific manner.
We can discuss later, why this type of infrastructure may incent
distributions to include it in their kernels.
The TSEM userspace tools have the ability to create a modeling
namespace that tracks a simple process heirarchy or a runc isolated
container heirarchy. In the process of testing TOMOYO in a container
environment we ran into issues with TOMOYO causing the runc execution
to fail.
We reproduce this in a stock kernel with TOMOYO as a native LSM, so it
doesn't seem specific to our TSEM based implementation of TOMOYO.
We tracked the problem down to the tomoyo_realpath_nofollow() function
failing due to an error return from kern_nopath().
For smoke testing purposes, we are using the minimal default TOMOYO
policy that is used in the absence of userspace policy loading. Given
we are the farthest thing from experts in TOMOYO this may be a
limitation of that internal policy.
We are testing with runc version 1.1.15 which is the most current
release of the 1.1.x series.
Kernel version is 6.10 something.
The path causing the issue is as follows:
/dev/fd/7
Here are the warning messages that runc spits out:
FATA[0000] nsexec[1291]: could not ensure we are a cloned binary: No
such file or directory
ERRO[0000] runc run failed: unable to start container process: waiting
for init preliminary setup: read init-p: connection reset by peer
Since we can generate this in a native TOMOYO implementation we
thought it may be worthwhile to bring this issue to your attention.
It seems odd that no one would have tripped on this given the ubiquity
of runc based container environments.
We would look forward to your thoughts.
Have a good remainder of the week.
As always,
Dr. Greg
The Quixote Project - Flailing at the Travails of Cybersecurity
https://github.com/Quixote-Project
next reply other threads:[~2024-11-21 18:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-21 18:42 Dr. Greg [this message]
2024-11-21 23:22 ` TOMOYO and runc containers dislike one another Tetsuo Handa
2024-11-22 4:12 ` Dr. Greg
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=20241121184207.GA11007@wind.enjellic.com \
--to=greg@enjellic.com \
--cc=linux-security-module@vger.kernel.org \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
/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