Skip to content

Commit

Permalink
trusty: sepolicy for mock rpmb
Browse files Browse the repository at this point in the history
Enabling mock rpmb module sepolicy which is required for
creating of the creation of mock RPMB in /data on boot up.

Tests Done:
1. Boot the device in MTL nuc.
2. storageproxyd service is running.

Tracked-On: OAM-128292
Signed-off-by: Ravichandra Appegowda <[email protected]>
  • Loading branch information
ARavichandra committed Dec 10, 2024
1 parent 967a218 commit 8f11b8d
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions tee/trusty/mock_rpmb/file.te
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
type rpmb_mock_data_file, file_type, data_file_type;
4 changes: 4 additions & 0 deletions tee/trusty/mock_rpmb/file_contexts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# RPMB Mock
/vendor/bin/rpmb_dev u:object_r:rpmb_dev_mock_exec:s0
/data/vendor/ss(/.*)? u:object_r:rpmb_mock_data_file:s0

1 change: 1 addition & 0 deletions tee/trusty/mock_rpmb/init.te
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
allow init socket_device:sock_file create_file_perms;
10 changes: 10 additions & 0 deletions tee/trusty/mock_rpmb/rpmb_dev_mock_exec.te
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
type rpmb_dev_mock, domain;
type rpmb_dev_mock_exec, vendor_file_type, exec_type, file_type;

init_daemon_domain(rpmb_dev_mock)

#allow rpmb_dev_mock rpmb_mock_data_file:file create_file_perms;
#allow rpmb_dev_mock rpmb_mock_data_file:dir create_dir_perms;

allow rpmb_dev_mock mnt_vendor_file:file create_file_perms;
allow rpmb_dev_mock mnt_vendor_file:dir create_dir_perms;
4 changes: 4 additions & 0 deletions tee/trusty/mock_rpmb/tee.te
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
allow tee socket_device:sock_file rw_file_perms;
allow tee rpmb_mock_data_file:file create_file_perms;
allow tee rpmb_mock_data_file:dir create_dir_perms;
allow tee rpmb_dev_mock:unix_stream_socket connectto;
2 changes: 2 additions & 0 deletions tee/trusty/property.te
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vendor_internal_prop(vendor_trusty_storage_prop)

2 changes: 2 additions & 0 deletions tee/trusty/property_contexts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ro.vendor.trusty.storage.fs_ready u:object_r:vendor_trusty_storage_prop:s0

1 change: 1 addition & 0 deletions tee/trusty/tee.te
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ allow tee block_device:dir search;
allow tee tee_device:blk_file rw_file_perms;
allow tee gsi_metadata_file:dir search;
allow tee metadata_file:dir search;
set_prop(tee, vendor_trusty_storage_prop)

0 comments on commit 8f11b8d

Please sign in to comment.