Skip to content

Commit

Permalink
Allow unconfined_t read other processes perf_event records
Browse files Browse the repository at this point in the history
Perf events are represented by a file descriptor which can be passed
between processes, e.g. via a UNIX socket or DBus. The perf event's
label is inherited from the creating process at the time of creation.

This permission is required for sysprof, executed from command line,
to get elevated access to perf_event file descriptors provided by
sysprofd daemon which had created the perf_event file descriptors and
passed them to the client.

The domain_read_perf_event_all_domains() interface was added.

Resolves: fedora-selinux#614
  • Loading branch information
zpytela committed May 6, 2021
1 parent 5d0c765 commit 2057106
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions policy/modules/kernel/domain.if
Original file line number Diff line number Diff line change
Expand Up @@ -1806,3 +1806,21 @@ interface(`domain_dyntrans',`

dyntrans_pattern($1, domain)
')

########################################
## <summary>
## Allow read perf_event file descriptors from all domains
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`domain_read_perf_event_all_domains',`
gen_require(`
attribute domain;
')

allow $1 domain:perf_event read;
')
2 changes: 2 additions & 0 deletions policy/modules/roles/unconfineduser.te
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ kernel_rw_unlabeled_rawip_socket(unconfined_t)
kernel_rw_unlabeled_smc_socket(unconfined_t)
kernel_rw_unlabeled_vsock_socket(unconfined_t)

domain_read_perf_event_all_domains(unconfined_t)

files_create_boot_flag(unconfined_t)
files_create_default_dir(unconfined_t)
files_root_filetrans_default(unconfined_t, dir)
Expand Down

0 comments on commit 2057106

Please sign in to comment.