Skip to content

Commit

Permalink
Allow gpsd use /dev/gnss devices
Browse files Browse the repository at this point in the history
With the 1e668a5 ("Label /dev/gnss[0-9] with gnss_device_t") commit,
a specific label was assigned to the device nodes, but no domain was
allowed to actually use it.

Resolves: RHEL-16676
  • Loading branch information
zpytela committed Dec 7, 2023
1 parent f442292 commit 39425ef
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
2 changes: 2 additions & 0 deletions policy/modules/contrib/gpsd.te
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ corenet_tcp_sendrecv_gpsd_port(gpsd_t)

dev_read_sysfs(gpsd_t)
dev_rw_realtime_clock(gpsd_t)
dev_rw_gnss(gpsd_t)
dev_setattr_gnss(gpsd_t)

domain_dontaudit_read_all_domains_state(gpsd_t)

Expand Down
35 changes: 34 additions & 1 deletion policy/modules/kernel/devices.if
Original file line number Diff line number Diff line change
Expand Up @@ -6643,7 +6643,40 @@ interface(`dev_read_vsock',`
type device_t, vsock_device_t;
')

read_chr_files_pattern($1, device_t, vsock_device_t)
########################################
## <summary>
## Allow read/write the gnss device
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`dev_rw_gnss',`
gen_require(`
type device_t, gnss_device_t;
')

rw_chr_files_pattern($1, device_t, gnss_device_t)
')

########################################
## <summary>
## Allow setattr the gnss device
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`dev_setattr_gnss',`
gen_require(`
type device_t, gnss_device_t;
')

setattr_chr_files_pattern($1, device_t, gnss_device_t)
')

########################################
Expand Down

0 comments on commit 39425ef

Please sign in to comment.