Skip to content
Snippets Groups Projects
Commit 7b67a617 authored by Bowgo Tsai's avatar Bowgo Tsai
Browse files

Allowing vold to search /mnt/vendor/*

vold will trim rw mount points about daily, but it is denied by SELinux:

root   603   603 W Binder:603_2: type=1400 audit(0.0:11): avc: denied {
search } for name="vendor" dev="tmpfs" ino=23935 scontext=u:r:vold:s0
tcontext=u:object_r:mnt_vendor_file:s0 tclass=dir permissive=0

Allowing vold to search /mnt/vendor/* to fix the denials.

Note that device-specific sepolicy needs to be extended to allow vold
to send FITRIM ioctl. e.g., for /mnt/vendor/persist, it needs:

    allow vold persist_file:dir { ioctl open read };

Bug: 111409607
Test: boot a device, checks the above denial is gone
Change-Id: Ia9f22d973e5a2e295678781de49a0f61fccd9dad
parent 32809859
No related branches found
No related tags found
No related merge requests found
...@@ -1391,6 +1391,7 @@ neverallow { ...@@ -1391,6 +1391,7 @@ neverallow {
coredomain coredomain
-init -init
-ueventd -ueventd
-vold
} mnt_vendor_file:dir *; } mnt_vendor_file:dir *;
# Only apps are allowed access to vendor public libraries. # Only apps are allowed access to vendor public libraries.
......
...@@ -213,6 +213,9 @@ allow vold user_profile_data_file:dir create_dir_perms; ...@@ -213,6 +213,9 @@ allow vold user_profile_data_file:dir create_dir_perms;
# Raw writes to misc block device # Raw writes to misc block device
allow vold misc_block_device:blk_file w_file_perms; allow vold misc_block_device:blk_file w_file_perms;
# vold might need to search or mount /mnt/vendor/*
allow vold mnt_vendor_file:dir search;
neverallow { neverallow {
domain domain
-vold -vold
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment