Skip to content

Commit a2b9d6d

Browse files
committed
systemd: allow non-root access to system dma-heap device
Non-root 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 undesirable. To address this, introduce a dedicated 'dmaheap' system group and provide a udev rule that assigns /dev/dma_heap/system to this group with mode 0660. Services that require access can be assigned to this group, allowing them to use the system dma-heap device without requiring root privileges. Signed-off-by: Murali Krishna Bellamkonda <murabell@qti.qualcomm.com>
1 parent 8f9cf91 commit a2b9d6d

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)