【问题标题】:SEAndroid: How to fix permissive domains not allowedSEAndroid:如何修复不允许的域
【发布时间】:2017-12-25 09:03:46
【问题描述】:

当我为我的时间戳进程创建一个新的域类型时,我有一些 SEAndroid 问题,但仍然存在与 neverallow 的一些冲突问题。 有人可以给我一个提示或线索吗?请参阅以下说明。

avc 拒绝日志:

[120.810387] type=1400 audit(932699.049:188):avc: denied { execute_no_trans } for pid=3875 comm="system_server" path="/system/bin/sh" dev="mmcblk0p47" ino=791 scontext =u:r:system_server:s0 tcontext=u:object_r:shell_exec:s0 tclass=文件许可=1 [120.827670] 类型=1400 审核(932699.049:188):avc:拒绝 {execute_no_trans} 用于 pid=3875 comm="system_server" path="/system/bin/sh" dev="mmcblk0p47" ino=791 scontext=u: r:system_server:s0 tcontext=u:object_r:shell_exec:s0 tclass=文件许可=1 [120.827684] 类型=1400 审核(932699.069:189):avc:拒绝 {getattr} 用于 pid=3877 comm="sh" path="/system/bin/timestamp" dev="mmcblk0p47" ino=832 scontext=u: r:system_server:s0 tcontext=u:object_r:system_file:s0 tclass=文件许可=1 [120.828287] 类型=1400 审核(932699.069:189):avc:拒绝 {getattr} 用于 pid=3877 comm="sh" path="/system/bin/timestamp" dev="mmcblk0p47" ino=832 scontext=u: r:system_server:s0 tcontext=u:object_r:system_file:s0 tclass=文件许可=1 [120.828300]类型=1400审核(932699.069:190):avc:拒绝{执行}对于pid=3877 comm="sh" name="timestamp" dev="mmcblk0p47" ino=832 scontext=u:r:system_server:s0 tcontext=u:object_r:system_file:s0 tclass=文件许可=1 [120.828593]类型=1400审计(932699.069:190):avc:拒绝{执行}对于pid=3877 comm="sh" name="timestamp" dev="mmcblk0p47" ino=832 scontext=u:r:system_server:s0 tcontext=u:object_r:system_file:s0 tclass=文件许可=1 [120.828607]类型=1400审核(932699.069:191):avc:拒绝{读取打开}对于pid=3877 comm="sh" path="/system/bin/timestamp" dev="mmcblk0p47" ino=832 scontext=u :r:system_server:s0 tcontext=u:object_r:system_file:s0 tclass=文件许可=1 [120.828981]类型=1400审核(932699.069:191):avc:拒绝{读取打开}对于pid=3877 comm=“sh”路径=“/system/bin/timestamp”dev=“mmcblk0p47”ino=832 scontext=u :r:system_server:s0 tcontext=u:object_r:system_file:s0 tclass=文件许可=1 [120.828996]类型=1400审核(932699.069:192):avc:拒绝{execute_no_trans}对于pid=3877 comm="sh" path="/system/bin/timestamp" dev="mmcblk0p47" ino=832 scontext=u: r:system_server:s0 tcontext=u:object_r:system_file:s0 tclass=文件许可=1 [120.845574]类型=1400审计(932699.069:192):avc:拒绝{execute_no_trans}为pid=3877 comm=“sh”路径=“/system/bin/timestamp”dev=“mmcblk0p47”ino=832 scontext=u: r:system_server:s0 tcontext=u:object_r:system_file:s0 tclass=文件许可=1 [120.845587] 类型=1400 审核(932699.089:193):avc:拒绝 {execute_no_trans} 用于 pid=3879 comm="sh" path="/system/bin/dumpsys" dev="mmcblk0p47" ino=570 scontext=u: r:system_server:s0 tcontext=u:object_r:system_file:s0 tclass=文件许可=1

我的时间戳.te:

type timestamp, domain; type timestamp_exec, exec_type, file_type; init_daemon_domain(timestamp)

我的文件上下文:

/system/bin/timestamp        u:object_r:timestamp_exec:s0

我的 system_server.te:

allow system_server timestamp_exec:file { execute_no_trans getattr execute read open };

编译失败日志:

失败:out/target/product/msm8996/obj/ETC/sepolicy_intermediates/sepolicy /bin/bash -c "(out/host/linux-x86/bin/secilc -M true -G -c 30 out/target/product/msm8996/obj/ETC/plat_sepolicy.cil_intermediates/plat_sepolicy.cil out/target/ product/msm8996/obj/ETC/26.0.cil_intermediates/26.0.cil out/target/product/msm8996/obj/ETC/nonplat_sepolicy.cil_intermediates/nonplat_sepolicy.cil -o out/target/product/msm8996/obj/ETC/sepolicy_intermediates/ sepolicy.tmp -f /dev/null ) && (out/host/linux-x86/bin/sepolicy-analyze out/target/product/msm8996/obj/ETC/sepolicy_intermediates/sepolicy.tmp permissive > out/target/product/ msm8996/obj/ETC/sepolicy_intermediates/sepolicy.permissivedomains ) && (如果 [ \"userdebug\" = \"user\" -a -s out/target/product/msm8996/obj/ETC/sepolicy_intermediates/sepolicy.permissivedomains ];然后 echo \"==========\" 1>&2; echo \"错误:用户构建中不允许使用许可域\" 1>&2; echo \"无效域列表:\" 1> &2; cat out/target/product/msm8996/obj/ETC/sepolicy_intermediates/sepolicy.p发射域 1>&2; 1号出口; fi) && (mv out/target/product/msm8996/obj/ETC/sepolicy_intermediates/sepolicy.tmp out/target/product/msm8996/obj/ETC/sepolicy_intermediates/sepolicy)" neverallow 检查在 out/target/product/msm8996/obj/ETC/plat_sepolicy.cil_intermediates/plat_sepolicy.cil:12033 来自 system/sepolicy/private/system_server.te:704 失败 (从不允许 system_server base_typeattr_218(文件(execute_no_trans))) 允许在 out/target/product/msm8996/obj/ETC/nonplat_sepolicy.cil_intermediates/nonplat_sepolicy.cil:7533 (允许system_server_26_0 timestamp_exec(文件(读取getattr执行execute_no_trans打开))) 生成二进制文件失败 构建策略数据库失败

【问题讨论】:

    标签: android-source seandroid


    【解决方案1】:

    请尝试在“type timestamp, domain;”末尾添加“mlstrustedsubject, coredomain”

    -    type timestamp, domain;
    
    +    type timestamp, domain, mlstrustedsubject, coredomain;
    

    【讨论】:

    • 您好 Eric,我已经尝试添加补丁,但对我来说仍然无法使用,非常感谢! ; )'
    • 也为我工作。
    猜你喜欢
    • 2021-08-13
    • 1970-01-01
    • 1970-01-01
    • 2021-05-06
    • 2020-11-04
    • 1970-01-01
    • 2019-06-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多