Skip to content

bootc status logs SELinux AVC denial for chcon when run from a sandboxed systemd unit #2703

Backlog

Description

@shivaism

Summary

When bootc status --json runs from a systemd unit with
ProtectSystem=full, PrivateTmp=yes and NoNewPrivileges=yes, SELinux
logs an AVC denial for chcon attempting to set an invalid label. bootc
still returns the status output, so the failure looks harmless, but the
denial appears in the kernel log on every boot.

Environment

  • bootc: 1.17.1
  • OS: Fedora 45 (bootc / ostree image, fedora-bootc base)
  • Kernel: 7.3.6-300.fc45.x86_64
  • SELinux: enabled, enforcing, targeted policy

Steps to reproduce

  1. Create a oneshot unit that runs bootc status --json with:
    [Service]
    Type=oneshot
    ExecStart=/usr/bin/bootc status --json
    ProtectSystem=full
    PrivateTmp=yes
    NoNewPrivileges=yes
    
  2. Start the unit, then check the kernel log for AVC denials.

Note: I have not yet confirmed that this unit reproduces the denial.
Running bootc status directly from a shell did not produce one.

Observed log

From the boot log (paths and PIDs trimmed):

audit[2197]: AVC avc:  denied  { mac_admin } for  pid=2197 comm="chcon"
  capability=33  scontext=system_u:system_r:unconfined_service_t:s0
  tcontext=system_u:system_r:unconfined_service_t:s0 tclass=capability2
  permissive=0
audit: SELINUX_ERR op=setxattr invalid_context="system_u:object_r:invalid_bootcinstall_testlabel_t:s0"
audit[2197]: SYSCALL ... syscall=188 success=no exit=-22 ... comm="chcon"
  exe="/usr/bin/chcon" ...
PROCTITLE: chcon -t invalid_bootcinstall_testlabel_t /tmp/.tmp<random>

The denial appears twice per run, from chcon invoked on a temporary
file under the unit's PrivateTmp directory.

Expected

Either bootc status does not attempt a relabel probe on a read-only or
sandboxed path, or the probe fails quietly without generating an AVC
denial.

Notes

  • The string invalid_bootcinstall_testlabel is present in
    /usr/bin/bootc and /usr/sbin/bootc.
  • bootc status still exits successfully and returns the expected JSON.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions