Skip to content

refpolicy-targeted: Add AudioReach device labels for pipewire_stack - #123

Open
rchiluka29 wants to merge 1 commit into
AudioReach:masterfrom
rchiluka29:selinux/audioreach-device-labels
Open

rchiluka29 wants to merge 1 commit into
AudioReach:masterfrom
rchiluka29:selinux/audioreach-device-labels

Conversation

@rchiluka29

Copy link
Copy Markdown
Contributor

Add a dynamic-layers/selinux entry to extend the pipewire_stack SELinux policy with Qualcomm AudioReach specific device node labels.

/dev/aud_pasthru.* (AudioReach GPR passthrough char devices used by audioreach-graphservices for ADSP communication) and /dev/msm_audio_mem.* (AudioReach shared memory allocator used by ar_osal for ADSP buffer allocation, including the CMA variant /dev/msm_audio_mem_cma) are labeled sound_device_t, consistent with the existing /dev/adsp.* labeling convention in devices.fc. This allows pipewire_t to access them via the existing sound_device_t allow rule without broadening access to the generic device_t.

These device nodes are created by the Qualcomm AudioReach kernel driver and are not present on non-Qualcomm platforms, so this policy is kept in meta-audioreach rather than submitted upstream.

Upstream-Status: Inappropriate [Qualcomm-specific AudioReach device nodes not present on non-Qualcomm platforms]

@lumag

lumag commented May 11, 2026

Copy link
Copy Markdown
Contributor

From: Rohith Chiluka rchiluka@hu-rchiluka-hyd.qualcomm.com

What? Please fix your Git configuration.

Also this PR won't work without extra plumbing, so it wasn't even tested. Please don't open the untested PR.

@rchiluka29
rchiluka29 force-pushed the selinux/audioreach-device-labels branch from 4cba441 to da6a0e9 Compare May 14, 2026 05:55
@rchiluka29

rchiluka29 commented May 14, 2026

Copy link
Copy Markdown
Contributor Author

From: Rohith Chiluka rchiluka@hu-rchiluka-hyd.qualcomm.com

What? Please fix your Git configuration.

Also this PR won't work without extra plumbing, so it wasn't even tested. Please don't open the untested PR.

Thank you for the review. Apologies for the incorrect author email in the previous commit. corrected.
Regarding the "extra plumbing" concern: the dynamic-layers/selinux/ entry is activated via BBFILES_DYNAMIC in conf/layer.conf. This patch extends the pipewire_stack policy introduced in meta-qcom and is intended to be used with both layers active simultaneously.

This has been validated in enforcing mode. Both pipewire and pipewire-pulse run confined under pipewire_t, /dev/aud_pasthru_adsp and /dev/msm_audio_mem are correctly labeled sound_device_t and returns no denials.

@rchiluka29
rchiluka29 force-pushed the selinux/audioreach-device-labels branch from da6a0e9 to 58fb36f Compare May 22, 2026 14:22
@github-actions

Copy link
Copy Markdown

AudioReach/audioreach.triage This pull request has been marked as stale due to 30 days of inactivity.

@github-actions github-actions Bot added the Stale label Jun 22, 2026
@rchiluka29
rchiluka29 force-pushed the selinux/audioreach-device-labels branch from 58fb36f to be9f790 Compare July 1, 2026 12:08
@rchiluka29

rchiluka29 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

This PR has been updated post upstream PR merge.

@rchiluka29
rchiluka29 force-pushed the selinux/audioreach-device-labels branch from be9f790 to d4f658f Compare July 1, 2026 15:42
Label Qualcomm AudioReach-specific device nodes as sound_device_t so
that pipewire_t can access them via the existing dev_read_sound and
dev_write_sound interfaces without requiring access to the generic
device_t.

/dev/aud_pasthru.* is the AudioReach GPR passthrough node used by
audioreach-graphservices for ADSP communication.
/dev/msm_audio_mem.* is the AudioReach shared memory allocator used
by ar_osal for ADSP buffer allocation.

These device nodes are created by the Qualcomm AudioReach kernel
driver and are not present on non-Qualcomm platforms.

Also add selinux to LAYERDEPENDS so that BBFILES_DYNAMIC correctly
activates the dynamic-layers/selinux entries when the selinux layer
is present in the build.

Validated on rb3gen2-core-kit in SELinux enforcing mode:
- /dev/aud_pasthru_adsp and /dev/msm_audio_mem correctly labelled
  sound_device_t after restorecon
- PipeWire playback and record pass with no AVC denials

Upstream-Status: Inappropriate [Qualcomm-specific AudioReach device
nodes not present on non-Qualcomm platforms]

Signed-off-by: Chiluka Rohith <rchiluka@qti.qualcomm.com>
@rchiluka29
rchiluka29 force-pushed the selinux/audioreach-device-labels branch from d4f658f to e373c70 Compare July 1, 2026 15:49
@github-actions github-actions Bot removed the Stale label Jul 2, 2026
@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown

AudioReach/audioreach.triage This pull request has been marked as stale due to 30 days of inactivity.

@github-actions github-actions Bot added the Stale label Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants