selinux 问题集锦

本文详细介绍了在Android 8.0及以上版本中如何验证权限编译,包括执行`makeselinux_policy`命令、修改文件上下文以及解决SELinux策略冲突的方法。同时,针对SELinux权限拒绝、onproperty触发问题和开关SELinux的操作进行了说明,并提供了相关链接和解决方案。

1.添加完权限如何编译验证?
android 8.0及以后,android根目录下执行 make selinux_policy,会输出到 
out/target/product/XXXX/system/etc/selinux 和 out/target/product/XXXX/vendor/etc/selinux
push上述两个目录的所有文件到system/etc/selinux和vendor/etc/selinux目录 重启手机即可。

//手动修改某个文件的conext

chcon -v u:object_r:netdiag_exec:s0  mydump

2.问题集锦

out/target/product/xxx/obj/ETC/sepolicy_tests_intermediates/sepolicy_tests )" The following types on /system/ must be associated with the "system_file_type" attribute: verifyusb_exec

解决: 

type verifyusb, domain;
  type verifyusb_exec, system_file_type, exec_type, file_type;
  init_daemon_domain(verifyusb)

libsepol.report_assertion_extended_permissions: neverallowxperm on line 335 of system/sepolicy/public/domain.te (or line 11682 of policy.conf) violated by
allow nds nds:packet_socket { ioctl };

解决: 

allowxperm nds self:packet_socket  ioctl &n

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值