Skip to content

Add SELinux policy module so confined fprintd can reach the fingerprint broker - #65

Open
frozenSolid wants to merge 1 commit into
standardagents:mainfrom
frozenSolid:selinux-fprintd-broker
Open

frozenSolid wants to merge 1 commit into
standardagents:mainfrom
frozenSolid:selinux-fprintd-broker

Conversation

@frozenSolid

Copy link
Copy Markdown

Problem

On SELinux-enforcing systems with the targeted policy (Fedora, RHEL and derivatives), fprintd
runs confined as fprintd_t. The patched libfprint driver inside fprintd cannot open the
broker's socket, so Touch ID never gets past claiming the device:

$ fprintd-enroll -f right-index-finger
failed to claim device: GDBus.Error:net.reactivated.Fprint.Error.Internal: Open failed with error: fingerprint broker connection failed
avc: denied { write } for comm="fprintd" name="fingerprint.sock"
     scontext=system_u:system_r:fprintd_t:s0 tcontext=system_u:object_r:var_run_t:s0 tclass=sock_file
avc: denied { connectto } for comm="fprintd" path="/run/t1bridge/fingerprint.sock"
     scontext=system_u:system_r:fprintd_t:s0 tcontext=system_u:system_r:unconfined_service_t:s0 tclass=unix_stream_socket

Change

  • packaging/selinux/t1bridge_fprintd.cil: a small CIL policy module (no compiler needed). It
    gives /run/t1bridge/fingerprint.sock a dedicated type, t1bridge_fingerprint_sock_t,
    instead of the generic var_run_t, and allows only:
    • init_t to create/label/remove that socket (systemd owns t1bridge-fingerprint.socket),
      plus tmpfs association for /run;
    • fprintd_t to write/getattr that socket type only;
    • fprintd_t to connectto the socket's owner: init_t before activation and
      unconfined_service_t (the bin_t broker) after.
  • docs/setup.md: a short "SELinux (Fedora, RHEL)" subsection under the import section with
    the symptom, install/verify/remove commands, and what the module does and doesn't change.

No code, PAM, broker sandbox, or socket changes. The module grants nothing beyond the existing,
already-justified fprintd → broker connection. Arch (no SELinux) is unaffected.

A first version allowed fprintd_t to write any var_run_t sock_file. I narrowed it to the
dedicated type before proposing it; both were tested.

Testing

MacBookPro13,3, Fedora 45, kernel 7.2.15-300.fc45, selinux-policy-targeted 45.23-1, SELinux
enforcing, T1Bridge built from 81cbdf8, libfprint/fprintd rebuilt from Fedora's 1.94.100 /
1.94.5 sources with this repository's packaging patches.

  • Without the module: enroll/verify fail with the error above; AVC denials as shown.
  • With the module (this exact file, loaded with semodule -i):
    • t1bridge-fingerprint.socket restarts; ls -Z shows t1bridge_fingerprint_sock_t;
    • enrollment enroll-completed, then sudo and GNOME lock-screen unlock by touch with
      password fallback still working (done while the first, broader var_run_t rule was loaded);
    • with this narrowed module: fprintd-verify claims the device with zero AVC denials, and a
      real touch returns verify-match;
    • semodule -r t1bridge_fprintd restores the original behavior.
  • Docs: the relative link resolves; commands checked against the running system.

🤖 Generated with Claude Code

On SELinux-enforcing systems (Fedora, RHEL) fprintd runs confined as
fprintd_t and cannot open /run/t1bridge/fingerprint.sock, so enrollment
and verification fail with "fingerprint broker connection failed".

Add a CIL module that gives the socket a dedicated type and allows
fprintd to write to and connect through that socket only, with systemd
allowed to create and remove it. Document install, verification and
removal in docs/setup.md.

Tested on MacBookPro13,3, Fedora 45, kernel 7.2.15, SELinux enforcing:
claim with zero AVC denials and verify-match with a real touch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant