Skip to content

[Bug] Leaked file descriptors to child processes cause pasta(1) SELinux AVC storm and setroubleshootd CPU burn (Fedora, rootless podman) #1771

Description

@DarkGhostHunter

Summary

On Fedora (SELinux enforcing), opening Devsy Desktop makes setroubleshootd burn 50–90% CPU for as long as the app runs. The cause is not Devsy's container management itself but Devsy leaking ~25 open file descriptors (no close-on-exec) into every child process it spawns. Its periodic workspace-status agents run podman, and podman's pasta --version probe inherits those fds; pasta then walks/reads all of them at startup, generating a storm of SELinux denials that setroubleshootd analyzes one by one.

Environment

  • Devsy Desktop AppImage v1.26.0 (devsy --version), provider: podman (rootless), endpoint unix:///run/user/1000/podman/podman.sock
  • Fedora 44 (Atomic, kernel 7.2.14-200.fc44.x86_64), SELinux enforcing/targeted
  • podman 5.8.9, pasta 0^20261002.gcba3570-1.fc44, setroubleshoot-server 3.3.36-3.fc44
  • 1 running dev-container (--network=host — pasta serves no network role here; it is spawned purely by podman's version probe)

Impact (measured)

  • ~16,000 SELinux AVC denials in 15 minutes while Devsy is open; ~25–47 per pasta spawn. 100% of them from comm="pasta" / comm="pasta.avx2".
  • setroubleshootd at 50–90% CPU; closing Devsy returns CPU to normal. This is the user-visible symptom.
  • Status agents hot-loop podman info: ~22 process spawns/sec observed (1,543 podman spawns in a 70s window with the GUI idle in tray), in waves of 5 parallel devsy internal agent workspace status every ~13s. That is significant CPU overhead by itself, independent of SELinux.

Root-cause chain (all verified live)

  1. Devsy's Electron main process holds open: AppImage FUSE-mount files (/tmp/.mount_devsy.*/icudtl.dat, app.asar, *.pak, v8_context_snapshot.bin), Chromium caches under ~/.config/devsy-desktop/ (GPUCache, DawnGraphiteCache, spellcheck .bdic), and /dev/dri/renderD128. None are O_CLOEXEC.
  2. Every child spawned by Devsy inherits that fd table. Fingerprint match: 25/27 of the paths denied to pasta are exactly the fds open in the Electron main process.
  3. Waves of devsy workspace status <ws> (5 workspaces) spawn every ~13s → each spawns nested devsy internal agent workspace status → hot loop of podman info.
  4. podman info runs pasta --version. pasta (passt) scans/reads its inherited fds at startup even in --version mode and walks their paths (getattr on every path component, probe reads) — including through the AppImage FUSE mounts.
  5. pasta_t may not read fusefs_t, config_home_t or dri_device_t → tens of AVCs per spawn → setroubleshootd melts down.

The leak also propagates transitively: anything launched from a process with leaked fds (another Electron AppImage, an editor connected via devsy workspace ssh) passes its own fds down to Devsy's children, widening the denial set.

Minimal repro

# Terminal 1 — watch denials while Devsy Desktop is open:
journalctl -t audit -f | grep 'comm="pasta"'
sudo top   # setroubleshootd CPU climbs within a minute

# Isolated pasta repro (no Devsy needed):
exec 9</some/AppImage/mount/icudtl.dat     # any FUSE-mounted file, no CLOEXEC
pasta --version                            # → AVC on that fd's path

Suggested fixes

  1. Sanitize inherited fds in the Go binary at startup (highest value, one call): as the first thing devsy does before spawning anything —
    #include <linux/close_range.h>
    close_range(3, ~0ULL, CLOSE_RANGE_CLOEXEC);  // Linux ≥ 5.11
    or equivalent fcntl(FD_CLOEXEC) loop. This kills the whole leak-propagation chain (podman, pasta, everything downstream) regardless of how Electron opens its files. A Go shim via syscall.CloseRange/raw unix.CloseRange works too.
  2. Throttle the status agents: exponential backoff + caching instead of re-running podman info 10–22×/sec per agent; or subscribe to podman system events instead of polling. Waves of 5 parallel CLI invocations every 13s are also avoidable with a single batched call.
  3. Possibly related trigger: our dev-container has been looping waiting for devsy agent to be available in its init for hours; the aggressive retry loop may be a symptom of that never-reaching-ready state.

Workaround applied locally

A small SELinux local module allowing pasta_t read/getattr probes on fusefs_t, config_home_t, dri_device_t silences the storm (verified: 1,543 podman spawns with the GUI open → 0 AVCs, setroubleshootd stays asleep). Happy to share it — but the fd leak and the hot loop are the actual defects, and every rootless-podman user on an SELinux distro hits some variant of this with any fd-leaking GUI app.

Activity

  1. coderabbitai commented on Nov 4, 2026

    @coderabbitai
    ⚠️ Possible Duplicate Issue(s)

    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  2. changed the title [-]Leaked file descriptors to child processes cause pasta(1) SELinux AVC storm and setroubleshootd CPU burn (Fedora, rootless podman)[/-] [+][Bug] Leaked file descriptors to child processes cause pasta(1) SELinux AVC storm and setroubleshootd CPU burn (Fedora, rootless podman)[/+] on Nov 4, 2026
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