Skip to content

Commit

Permalink
odrefresh: add permission to sigkill child processes
Browse files Browse the repository at this point in the history
(cherry picked from commit 522bcbe9e635f8f099173af1a14b5062cb3b3dac)
Ignore-AOSP-First: cherry-pick from aosp
Bug: 177432913
Bug: 196969404
Test: manually decrease odrefresh compilation timeout, no avc denied
Change-Id: I7dec0a3d82c82b5dea4b5f3f38d9170bb1f40840
(cherry picked from commit 86477d7)
  • Loading branch information
ohodson authored and Android Build Coastguard Worker committed Aug 20, 2021
1 parent 5e88614 commit 51bd925
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions prebuilts/api/31.0/private/odrefresh.te
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ allow odrefresh apex_art_staging_data_file:file create_file_perms;
# Run dex2oat in its own sandbox.
domain_auto_trans(odrefresh, dex2oat_exec, dex2oat)

# Allow odrefresh to kill dex2oat if compilation times out.
allow odrefresh dex2oat:process sigkill;

# Run dexoptanalyzer in its own sandbox.
domain_auto_trans(odrefresh, dexoptanalyzer_exec, dexoptanalyzer)

# Allow odrefresh to kill dexoptanalyzer if analysis times out.
allow odrefresh dexoptanalyzer:process sigkill;

# Use devpts and fd from odsign (which exec()'s odrefresh)
allow odrefresh odsign_devpts:chr_file { read write };
allow odrefresh odsign:fd use;
Expand Down
6 changes: 6 additions & 0 deletions private/odrefresh.te
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ allow odrefresh apex_art_staging_data_file:file create_file_perms;
# Run dex2oat in its own sandbox.
domain_auto_trans(odrefresh, dex2oat_exec, dex2oat)

# Allow odrefresh to kill dex2oat if compilation times out.
allow odrefresh dex2oat:process sigkill;

# Run dexoptanalyzer in its own sandbox.
domain_auto_trans(odrefresh, dexoptanalyzer_exec, dexoptanalyzer)

# Allow odrefresh to kill dexoptanalyzer if analysis times out.
allow odrefresh dexoptanalyzer:process sigkill;

# Use devpts and fd from odsign (which exec()'s odrefresh)
allow odrefresh odsign_devpts:chr_file { read write };
allow odrefresh odsign:fd use;
Expand Down

0 comments on commit 51bd925

Please sign in to comment.