Skip to content

Commit fc5802d

Browse files
authored
systemd: enable non-root access to /dev/dma_heap/system via dmaheap group (#1711)
Services such as camera-service and gstd cannot access /dev/dma_heap/system because the device is created with restrictive default permissions. This prevents these services from allocating DMA‑Heap buffers unless they run as root, which is not desirable from a security or deployment perspective. This PR introduces a dedicated dmaheap system group and adds a udev rule that assigns /dev/dma_heap/system to this group with mode 0660. Services that require DMA‑Heap access can be added to this group, enabling safe, non‑root access while maintaining appropriate permission isolation.
2 parents bc91965 + a2b9d6d commit fc5802d

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Assign /dev/dma_heap/system to the dmaheap group
2+
SUBSYSTEM=="dma_heap", KERNEL=="system", GROUP="dmaheap", MODE="0660"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FILESEXTRAPATHS:prepend:qcom := "${THISDIR}/${PN}:"
2+
3+
SRC_URI:append:qcom = " file://99-dma-heap.rules"
4+
5+
# Create a group dmaheap and add this group to /dev/dma_heap/system through
6+
# dma-heap rules.
7+
GROUPADD_PARAM:udev:append:qcom = "; -r dmaheap"
8+
9+
do_install:append:qcom() {
10+
install -d ${D}${nonarch_libdir}/udev/rules.d
11+
install -m 0644 ${UNPACKDIR}/99-dma-heap.rules \
12+
${D}${nonarch_libdir}/udev/rules.d/
13+
}
14+
15+
FILES:${PN}-udev-rules:append:qcom = " ${nonarch_libdir}/udev/rules.d/99-dma-heap.rules"

0 commit comments

Comments
 (0)