Skip to content

Commit

Permalink
Label /dev/dma_heap/* char devices with dma_device_t
Browse files Browse the repository at this point in the history
In the /dev/dma_heap directory, character devices are created to
allow userspace to allocate dma buffers that can be shared between drivers.

A new dma_device_t type was added.
The change is also backed by an appropriate file transition
for the directory.
  • Loading branch information
zpytela committed May 24, 2021
1 parent 14c17b8 commit a091bcd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions policy/modules/kernel/devices.fc
Expand Up @@ -24,6 +24,8 @@
/dev/crash -c gen_context(system_u:object_r:crash_device_t,mls_systemhigh)
/dev/dahdi/.* -c gen_context(system_u:object_r:sound_device_t,s0)
/dev/dlm.* -c gen_context(system_u:object_r:dlm_control_device_t,s0)
/dev/dma_heap -d gen_context(system_u:object_r:dma_device_t,s0)
/dev/dma_heap/.+ -c gen_context(system_u:object_r:dma_device_t,s0)
/dev/dmfm.* -c gen_context(system_u:object_r:sound_device_t,s0)
/dev/dmmidi.* -c gen_context(system_u:object_r:sound_device_t,s0)
/dev/drm_dp_aux.* -c gen_context(system_u:object_r:xserver_misc_device_t,s0)
Expand Down
2 changes: 2 additions & 0 deletions policy/modules/kernel/devices.if
Expand Up @@ -6555,6 +6555,7 @@ interface(`dev_filetrans_all_named_dev',`
gen_require(`
type device_t;
type acpi_device_t;
type dma_device_t;
type usb_device_t;
type uhid_device_t;
type sound_device_t;
Expand Down Expand Up @@ -6702,6 +6703,7 @@ gen_require(`
filetrans_pattern($1, device_t, dlm_control_device_t, chr_file, "dlm7")
filetrans_pattern($1, device_t, dlm_control_device_t, chr_file, "dlm8")
filetrans_pattern($1, device_t, dlm_control_device_t, chr_file, "dlm9")
filetrans_pattern($1, device_t, dma_device_t, dir, "dma_heap")
filetrans_pattern($1, device_t, sound_device_t, chr_file, "dmfm")
filetrans_pattern($1, device_t, sound_device_t, chr_file, "dmmidi0")
filetrans_pattern($1, device_t, sound_device_t, chr_file, "dmmidi1")
Expand Down
6 changes: 6 additions & 0 deletions policy/modules/kernel/devices.te
Expand Up @@ -88,6 +88,12 @@ dev_node(crypt_device_t)
type dlm_control_device_t;
dev_node(dlm_control_device_t)

#
# Type for /dev/dma_heap/* devices
#
type dma_device_t;
dev_node(dma_device_t)

type dri_device_t;
dev_node(dri_device_t)

Expand Down

0 comments on commit a091bcd

Please sign in to comment.