Landlock news #4#
Here is the fourth Landlock newsletter!
Articles and conferences#
We wrote a detailed article about Landlock explaining the underlying concepts, the implementation, and the community. This was written for the SSTIC conference.
I did a workshop at the Pass the Salt conference to explain how to mitigate security vulnerabilities with Landlock (demonstrated with ImageMagick). Related materials are freely available to do it at home.
Arto Niemi published a “Survey of Real-World Process Sandboxing” at the Conference of Open Innovations Association (FRUCT). Their conclusion: “[…] we found Landlock and minijail [which uses Landlock] to be relatively convenient from a developer perspective. In general, process self-containment and process-wrapping seems to be an order of magnitude easier to configure than MAC policies.”
Researchers from University of Bergamo gave a talk at ASIA CCS conference about Cage4Deno: A Fine-Grained Sandbox for Deno Subprocesses (leveraging Landlock).
They also gave a talk at the RAID conference about NatiSand: Native Code Sandboxing for JavaScript Runtimes (leveraging Landlock).
Eric Leblond gave a talk (in French) at the SSTIC conference about sandboxing with Landlock to mitigate real world security issues.
Günther Noack will give a talk at LSS Europe about Landlock and the new IOCTL support.
I’ll give a talk at OSS Europe to better explain sandboxing with Landlock.
The XZ backdoor#
XZ Utils is a widely used compression tool and library. The main maintainer implemented sandboxing with Landlock, and released a new version 5.6.0 with this feature. In March 2024, a backdoor was found and reported. It was introduced in February by a new maintainer who earned this trust after more than two years of effort.
Among the malicious changes, the attacker disabled Landlock’s support for XZ Utils and released a new version.
The sabotaged configuration check has since been fixed with version 5.6.2, but this effort to stealthily disable sandboxing is a clear sign that Landlock disturbs attackers.
Merged kernel features#
Linux 6.7 (Landlock ABI 4) supports initial network access control with
the LANDLOCK_ACCESS_NET_BIND_TCP
and LANDLOCK_ACCESS_NET_CONNECT_TCP
rights thanks to Konstantin Meskhidze. We can now control inbound and
outbound TCP connections according to the source or the destination
port. This led to kernel code refactoring which opens the way to more
network protocol support.
See user space documentation.
Linux 6.10 (Landlock ABI 5) supports IOCTL control with the new
LANDLOCK_ACCESS_FS_IOCTL_DEV
right thanks to Günther Noack. This
restriction only applies to IOCTL commands implemented by device drivers
(i.e. block or character devices). As other file system access rights,
this can be used to only allow such IOCTL commands on a specified set of
file hierarchies per sandbox.
See user space documentation.
We also added a slight change in all supported kernels to inform system administrators (with kernel logs) how they can configure the system to support Landlock, if a process tried to sandbox itself on a kernel where Landlock is disabled. New documentation will help enable Landlock on systems when it is not already the case.
Since Linux 6.3, we improved documentation and kselftests (user space testing), and added support for KUnit (kernel testing). Part of this work led us to support the UML architecture to easily run application tests in a CI against different kernel versions. With this support we can make sure that backward compatibility works fine for the tested applications. I encourage you to take a look at landlock-test-tools and the related GitHub CI configuration.
Roadmap and ongoing development#
We created GitHub issues to track ongoing and future work.
Feel free to reach out if you want to contribute!
We also plan to improve the website with extended documentation and examples.
Kernel development highlights#
Günther Noack is now an official reviewer of Landlock! After the IOCTL feature, he is now working on improving the documentation, including man pages.
Mikhail Ivanov is working on socket type control. This is an important feature that will make it possible to create sandboxes without any network access, except for an explicit list of allowed protocols. This will nicely complement the TCP port control (and future ones for other protocols). He is also working on controlling TCP listen calls.
Tahera Fahimi was selected as an Outreachy intern to work on IPC restrictions (e.g. abstract unix socket, signals) to better isolate a Landlock domain.
I’m working on bringing audit support to Landlock.
Landlock libraries#
As explained by Günther Noack, the Go library now supports TCP and IOCTL restrictions.
A new version of the Rust crate was released, with support for TCP control and some miscellaneous improvements.
Please update your dependencies and use the latest Landlock ABI version for improved sandboxing.
We are also working on a new minimal C library.
New Landlock user space supports#
Firejail 0.9.74(sandboxer) will be able to use landlock.
setpriv 2.40 (sandboxer).
extrasafe 0.4.0 (sandbox library).
bevy_mod_lockdown (sandbox library).
Cloud Hypervisor (VM monitor) will be sandboxed with Landlock.
Ukuleleweb (wiki server).
websrv 3.2.0 (web server).
egress-eddie 0.5.0 (network filtering).
Suricata 7.0.0 (network security monitoring engine).
sslh 2.1.0 (protocol multiplexer): see mailing list announcement.
wireproxy 1.0.8 (Wireguard client).
Emilua 0.5.0 (Lua runtime): see mailing list announcement.
Polkadot (blockchain SDK).
XZ Utils 5.6.2 (archive manager).
Zathura (document viewer) will be sandboxed with Landlock.
Pacman 7.0.0 (Arch Linux’s package manager).
Thanks to all contributors!
Regards, Mickaël