SEAndroid 記錄

kynge136發表於2016-03-30

LSM: Linux Security Module

對應目錄 :

external/sepolicy/

/device/mediatek/common/sepolicy

class 定義 :security_classes

每個class可用的許可權定義:access_vectors

常用的許可權巨集定義:global_macros

ANDROID中的attribute定義:attribute


object_r  角色名字定義

type域定義 :file_contexts

app所屬域定義:seapp_contexts


type 命令格式:

type type_id[alias  alisas_id, ] [attribute_id]  

[ ]中為可選   如:type shell, domain

其中domain由  attribute domain定義  類似於type A 屬於group domain組的意思 


type A_t  attribute_test

type B_t  attribute_test

寫一個allow語句:  allow attribute_test  C_t:file {read write};

編譯後則會生成如下兩條:

allow A_t C_t:file {read write};

allow B_t C_t:file {read write};


TE的完整格式為:

rule_name source_type target_type : class perm_set


rule_name:

allow    allowaudit:記錄許可權     dontaudit:不記錄某些許可權  neverallow :不允許



當遇到SEAndroid許可權問題時LOG:

avc denied。。。。

相關文章