Enable Landlock LSM support (CONFIG_SECURITY_LANDLOCK) in default kernel configs

Đang mở
#7,801 5 bình luận 1 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
c, linux

Hướng nghiên cứu

Start by comparing the Raspberry Pi kernel defconfigs named in the issue, such as bcm2711_defconfig and bcm2712_defconfig, with upstream Debian’s Landlock configuration. The issue asks whether to enable CONFIG_SECURITY_LANDLOCK by default or compile it in for opt-in through lsm=landlock; review the footprint and LSM ordering implications across the supported configurations. Done when the maintainers choose a policy and the relevant default configurations reflect it.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Describe the bug
Summary

Please consider enabling Landlock (CONFIG_SECURITY_LANDLOCK=y) in the default Raspberry Pi OS kernel configurations, so software relying on Landlock can run without requiring users to build and maintain a custom kernel.

Forum discussion: https://forums.raspberrypi.com/viewtopic.php?t=401959

Motivation

Landlock is a mainline Linux Security Module (since Linux 5.13) that lets unprivileged processes sandbox themselves (restricting filesystem and network access) without needing root privileges, namespaces, or system-wide AppArmor/SELinux policies.

It is enabled by default in upstream Debian (since kernel 5.18), Ubuntu, Fedora, and Arch Linux, and is increasingly used across the Linux ecosystem:

  • Sandboxing & agent runtimes: tools like NVIDIA OpenShell, Firejail, landrun, and CLI coding agents (e.g., Codex CLI / Gemini CLI) use Landlock to isolate untrusted or autonomous workloads at the kernel level.
  • Everyday tools & services: projects such as xz, GNOME LocalSearch, Suricata, Cloud Hypervisor, zathura, and emerging systemd integrations use Landlock for lightweight defense-in-depth.
Current vs. Requested Configuration

Currently, the default defconfigs (e.g., bcm2712_defconfig, bcm2711_defconfig) include:

CONFIG_SECURITY=y
CONFIG_SECURITY_APPARMOR=y
CONFIG_LSM=""

Depending on what trade-offs make the most sense for Raspberry Pi OS, there are two options:

  1. Enabled out of the box (matches upstream Debian):

    CONFIG_SECURITY_LANDLOCK=y
    CONFIG_LSM="landlock"
    

    (Keeps AppArmor opt-in as today, while allowing Landlock-aware applications to work immediately.)

  2. Compiled in, opt-in via cmdline.txt (matching how AppArmor is currently configured):

    CONFIG_SECURITY_LANDLOCK=y
    

    Keeping CONFIG_LSM="" so users who need it can enable it with lsm=landlock in cmdline.txt without compiling a custom kernel.

Footprint & Trade-offs
  • Since LSMs must be built in (=y) rather than as loadable modules, there are trade-offs to weigh regarding kernel image size, boot/startup impact, and runtime memory usage.
  • If the small per-object LSM memory overhead is a concern on memory-constrained 32-bit models, one option would be to only enable it on the 64-bit / newer defconfigs (bcm2711_defconfig, bcm2712_defconfig), or keep it opt-in via lsm=landlock.
Steps to reproduce the behaviour
Device (s)

Raspberry Pi 5, Raspberry Pi 4 Mod. B

System
Logs

No response

Additional context

No response

Ngôn ngữ chính
C
Star
13.4k
Fork
5.5k
Merge trung bình
1 ngày 8 giờ
Pull request đã merge (30 ngày)
37

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của raspberrypi/linux

Tất cả issue của raspberrypi/linux

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.