platform_system_sepolicy/public/asan_extract.te
Tom Cherry b5ac55a444 asan_extract: add system_file_type to asan_extract_exec
This is on the system partition and thus must be system_file_type:

neverallow check failed at out/target/product/vsoc_x86/obj_asan/ETC/userdebug_plat_sepolicy.cil_intermediates/userdebug_plat_sepolicy.cil.tmp:7703 from system/sepolicy/public/domain.te:950
  (neverallow coredomain base_typeattr_272 (file (entrypoint)))
      <root>
          allow at out/target/product/vsoc_x86/obj_asan/ETC/userdebug_plat_sepolicy.cil_intermediates/userdebug_plat_sepolicy.cil.tmp:16250
	        (allow asan_extract asan_extract_exec (file (read getattr map execute open entrypoint)))

Bug: 155905226
Test: build without above neverallow error
Change-Id: I6987582fcc013c95efe7e6758d96ec089168ea9d
2020-05-06 13:25:28 -07:00

33 lines
1.3 KiB
Text

# asan_extract
#
# This command set moves the artifact corresponding to the current slot
# from /data/ota to /data/dalvik-cache.
with_asan(`
type asan_extract, domain, coredomain;
type asan_extract_exec, exec_type, file_type, system_file_type;
# Allow asan_extract to execute itself using #!/system/bin/sh
allow asan_extract shell_exec:file rx_file_perms;
# We execute log, rm, gzip and tar.
allow asan_extract toolbox_exec:file rx_file_perms;
allow asan_extract system_file:file execute_no_trans;
# asan_extract deletes old /data/lib.
allow asan_extract system_file:dir { open read remove_name rmdir write };
allow asan_extract system_file:file unlink;
# asan_extract untars ASAN libraries into /data.
allow asan_extract system_data_file:dir create_dir_perms ;
allow asan_extract system_data_file:{ file lnk_file } create_file_perms ;
# Relabel the libraries with restorecon.
allow asan_extract file_contexts_file:file r_file_perms;
allow asan_extract system_data_file:{ dir file } relabelfrom;
allow asan_extract system_file:dir { relabelto setattr };
allow asan_extract system_file:file relabelto;
# Restorecon will actually already try to run with sanitized libraries (libpackagelistparser).
allow asan_extract system_data_file:file execute;
')