五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

selinux相關(guān)學(xué)習(xí)筆記-簡(jiǎn)單selinux部分的解決

2023-10-11 10:35 作者:千里馬學(xué)框架  | 我要投稿

selinux問題判斷:

1 日志查看: logcat -b all 查看所有日志 如果自己程序有類似如下的avc:denied打印,基本上可以認(rèn)為有selinux問題,這里有avc: denied相關(guān)的關(guān)鍵字

?I?Thread-2:?type=1400?audit(0.0:53):?avc:?denied?{?search?}?for?name="leds"?dev="sysfs"?ino=26711?scontext=u:r:platform_app:s0:c512,c768?tcontext=u:object_r:sysfs_leds:s0?tclass=dir?permissive=1

2 再次驗(yàn)證是否selinux影響 可以adb shell setEnforce 0 關(guān)閉selinux限制看看是否功能正常

selinux問題修改方式:

相關(guān)問題日志:

I Thread-2: type=1400 audit(0.0:53): avc: denied { search } for name="leds" dev="sysfs" ino=26711 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:sysfs_leds:s0 tclass=dir permissive=1

這里表示成了一種更加直觀的語句如下:

avc: denied { 操作 } for name="leds" dev="sysfs" ino=26711 scontext=u:r:主體type:s0:c512,c768 tcontext=u:object_r:客體type:s0 tclass=客體類別 permissive=1

最簡(jiǎn)單allow語句:

allow ?主體type ?客體type :客體類別 ?{操作權(quán)限} 手寫方式:

allow?platform_app?sysfs_leds:dir?search

自動(dòng)生成相關(guān)的te的audit2allow工具:

sudo?apt-get?install?policycoreutils
sudo?apt-get?install?policycoreutils-python-utils
test@test:~/tmp$?audit2allow?-i?input.txt?-o?out.txt
ValueError:?You?must?specify?the?-p?option?with?the?path?to?the?policy?file.


The?above?exception?was?the?direct?cause?of?the?following?exception:

Traceback?(most?recent?call?last):
??File?"/usr/bin/audit2allow",?line?381,?in?<module>
????app.main()
??File?"/usr/bin/audit2allow",?line?365,?in?main
????audit2why.init()
SystemError:?<built-in?function?init>?returned?a?result?with?an?error?set

上面錯(cuò)誤需要進(jìn)行修改一下audit2allow源碼: sudo vi /usr/bin/audit2allow

在這里插入圖片描述

屏蔽上面四行代碼

最后工具幫我們寫好如下:

test@test:~/tmp$?audit2allow?-i?input-1.txt?


#=============?platform_app?==============
allow?platform_app?sysfs_leds:dir?search;

selinux的編譯和驗(yàn)證方式:

1、編譯make selinux_policy 2、驗(yàn)證:

adb?push?./out/target/product/XXX/system/etc/selinux/*??/system/etc/selinux/
adb?push?./out/target/product/XXX/vendor/etc/selinux/*??/vendor/etc/selinux/

adb?push?./out/target/product/XXX/system/system_ext/etc/selinux/*??/system/system_ext/etc/selinux/

adb?push?./out/target/product/XXX/system/product/etc/selinux/*??/system/product/etc/selinux/
adb?push?./out/target/product/XXX/root/sepolicy??/
更多framework干貨課程優(yōu)惠獲取相關(guān)可以+V(androidframework007)

在這里插入圖片描述


selinux相關(guān)學(xué)習(xí)筆記-簡(jiǎn)單selinux部分的解決的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
安溪县| 巩义市| 东乌| 嵊州市| 九龙城区| 连江县| 江安县| 永定县| 通州市| 泾阳县| 交城县| 通海县| 汉阴县| 嘉峪关市| 石泉县| 天峨县| 武陟县| 孟州市| 高邮市| 大埔县| 高要市| 通道| 同江市| 弋阳县| 中牟县| 昌宁县| 庆阳市| 甘肃省| 衡水市| 广元市| 民和| 镇雄县| 偏关县| 玉树县| 皮山县| 梨树县| 敖汉旗| 彰化市| 嵊州市| 峨眉山市| 沧源|