【问题标题】:Build AOSP custom rom构建 AOSP 自定义 rom
【发布时间】:2019-10-03 15:22:35
【问题描述】:

我正在尝试建立强制执行,但我有 7 次违规。我该如何解决?

libsepol.report_failure: neverallow on line 5 of device/motorola/sanders/sepolicy/vendor/ims.te (or line 75926 of
 policy.conf) violated by allow hal_camera_default hal_camera_hwservice:hwservice_manager { add };
libsepol.report_failure: neverallow on line 3 of device/motorola/sanders/sepolicy/vendor/hal_nfc_default.te (or l
ine 75741 of policy.conf) violated by allow hal_secure_element_default hal_secure_element_hwservice:hwservice_man
ager { add };
libsepol.report_failure: neverallow on line 3 of device/motorola/sanders/sepolicy/vendor/hal_nfc_default.te (or l
ine 75741 of policy.conf) violated by allow rild hal_secure_element_hwservice:hwservice_manager { add };
libsepol.report_failure: neverallow on line 5 of system/sepolicy/public/hal_secure_element.te (or line 15685 of p
olicy.conf) violated by allow hal_nfc_default hal_secure_element_hwservice:hwservice_manager { add };
libsepol.report_failure: neverallow on line 5 of system/sepolicy/public/hal_camera.te (or line 14186 of policy.co
nf) violated by allow init hal_camera_hwservice:hwservice_manager { add };
libsepol.report_failure: neverallow on line 521 of system/sepolicy/public/domain.te (or line 10809 of policy.conf
) violated by allow hal_fingerprint_default default_android_hwservice:hwservice_manager { add };
libsepol.report_failure: neverallow on line 519 of system/sepolicy/public/domain.te (or line 10807 of policy.conf
) violated by allow qseeproxy default_android_service:service_manager { add };
libsepol.check_assertions: 7 neverallow failures occurred

【问题讨论】:

    标签: android build android-source selinux


    【解决方案1】:

    您正在处理 neverallow 违规行为:您有一条规则说“永远不允许类型 x 在其他类型/类 action 上执行 y:c”,然后是另一条规则说“这个子类型允许xy:c 上执行action。 SE Linux 编译器将拒绝这些相互矛盾的规则。这可以通过修改neverallow 规则来解决您想要允许的特定子类型的例外情况。

    更准确地说,如果您有以下形式的规则:

    1. neverallow x y:c action;
    2. type z, x;(意思是zx的特例)
    3. allow z y:c action;

    将第一条规则修改为neverallow {x -z} y:class action;,为子类型z做一个例外。

    例子:

    1. Link: neverallow { domain ... -installd} staging_data_file:dir *; 表示不应允许domain 类型的对象访问staging_data_file 类型和dir 类型的对象。但是,它对类型 installd 有一个例外。

    2. Link: type installd, domain;installd 定义为domain 的特例。

    3. Link:allow installd staging_data_file:dir { open ... }; 允许installdstaging_data_file 类型和dir 类的对象执行open 操作。

    【讨论】:

    • 非常感谢,朋友。但是我不能修改源。我需要对树进行修改。有可能吗?
    • 您的意思是您可以修改 device/* 但不能修改 system/* (据我了解,您正在应用一些自定义补丁或为摩托罗拉设备添加了一些自定义文件)?在这种情况下,您可以尝试某人在此答案中给出的方法(使您添加的允许规则更加具体,这样它们就不会触发 neverallow 违规):stackoverflow.com/questions/58956629/…
    猜你喜欢
    • 2021-09-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-18
    • 1970-01-01
    • 1970-01-01
    • 2021-12-28
    • 1970-01-01
    相关资源
    最近更新 更多