新增一个hidl service的selinux配置

编程入门 行业动态 更新时间:2024-10-21 19:38:47

新增一个<a href=https://www.elefans.com/category/jswz/34/1699903.html style=hidl service的selinux配置"/>

新增一个hidl service的selinux配置

在安卓系统中,当我们新增了一个hidl service,我们应该增加以下几个selinux相关的配置

1

service.te(定义一个service type)

type xxx_service, service_manager_type;

service_contexts(把对应的service定义为这个type)

xxx u:object_r:xxx_service:s0

2

xxx.te(定义资源type,然后定义一些具体的安全配置)

type xxx,coredomain,domain; 

#定义xxx,继承于coredomain和domain,将代表某一组进程的域名

type xxx_exec,exec_type,file_type;

#定义xxx_exec,继承于exec_type和file_type,将代表某一资源,继承了执行权限

init_domain_domain(xxx)

#具体安全策略

allow 语句

neverallow 语句

file_contexts(使用刚刚定义的那个type)

/system/bin/xxx          u:object_r:xxx_exec:s0

更多推荐

新增一个hidl service的selinux配置

本文发布于:2024-02-16 20:07:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1691329.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:hidl   service   selinux

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!