Comments (10)
go to source code dir
export ANDROID_BUILD_TOP=$(pwd)
adb shell su root dmesg | ./external/selinux/prebuilts/bin/audit2allow -p out/target/product/< device >/root/sepolicy
hope that helps :)
from selinux.
I see two problems with what you show above:
- You set ANDROID_BUILD_TOP from the external/selinux/prebuilts/bin subdirectory instead of from the top-level AOSP source directory. Also, I think you are better off just running lunch to set up your environment; you need more than just ANDROID_BUILD_TOP - you also need ANDROID_HOST_OUT (at least in AOSP master, maybe not in 6.0.1).
- You ran dmesg on the build host, so you aren't going to get denials from your device that way. Note that the earlier examples ran it via adb shell so that they were getting log messages from the device. Also, I think these days you can just grab logcat output and that should include avc: denied messages too, except maybe for early boot messages.
from selinux.
You need to use the one that is built with the Android source tree. To verify which audit2allow should not point to the system installed one but rather to the one in the Android tree.
Example of Bad:
$ which audit2allow
/usr/bin/audit2allow
Example of Good:
$ which audit2allow
/build/wcrobert/aosp/external/selinux/prebuilts/bin/audit2allow
from selinux.
Thanks a lot sir, I'll give that a shot. Appreciate the quick response.
from selinux.
Next time hit the mailing list for seandroid, instructions here:
http://seandroid.bitbucket.org/ForMoreInformation.html
From: Harsh Shandilya [mailto:[email protected]]
Sent: Monday, August 15, 2016 10:06 PM
To: SELinuxProject/selinux [email protected]
Cc: Roberts, William C [email protected]; Comment [email protected]
Subject: Re: [SELinuxProject/selinux] Incompatibility with policy db version 30 (#21)
Thanks a lot sir, I'll give that a shot. Appreciate the quick response.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://github.com//issues/21#issuecomment-240002111, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AQ7bB7Wc9l17iXDkO7SKJt-GgbpPIMquks5qgUUngaJpZM4Jj3Cg.
from selinux.
Thanks again :)
On Tue, Aug 16, 2016, 10:48 PM williamcroberts [email protected]
wrote:
Next time hit the mailing list for seandroid, instructions here:
http://seandroid.bitbucket.org/ForMoreInformation.htmlFrom: Harsh Shandilya [mailto:[email protected]]
Sent: Monday, August 15, 2016 10:06 PM
To: SELinuxProject/selinux [email protected]
Cc: Roberts, William C [email protected]; Comment <
[email protected]>
Subject: Re: [SELinuxProject/selinux] Incompatibility with policy db
version 30 (#21)Thanks a lot sir, I'll give that a shot. Appreciate the quick response.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<
https://github.com/SELinuxProject/selinux/issues/21#issuecomment-240002111>,
or mute the thread<
https://github.com/notifications/unsubscribe-auth/AQ7bB7Wc9l17iXDkO7SKJt-GgbpPIMquks5qgUUngaJpZM4Jj3Cg>.—
You are receiving this because you modified the open/close state.Reply to this email directly, view it on GitHub
#21 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AMuuGoUQAg8eZ4Rc_dnb1HFTra8jXv-8ks5qge6-gaJpZM4Jj3Cg
.
from selinux.
Erm, been ages since this got resolved, but I appreciate your effort :)
from selinux.
Hi all.. I followed the suggestions posted in this page. But I still see the following error.
M93p:~/APQ8016_410C_LA.BR.1.2.7-01010-8x16.0_6.0.1_Marsh_Mallo_P2/external/selinux/prebuilts/bin$ export ANDROID_BUILD_TOP=$(pwd)
M93p:~/APQ8016_410C_LA.BR.1.2.7-01010-8x16.0_6.0.1_Marsh_Mallo_P2/external/selinux/prebuilts/bin$ dmesg | audit2allow -p ../../../../out/target/product/msm8916_64/root/sepolicy
**libsepol.policydb_read: policydb version 30 does not match my version range 15-29
invalid binary policy ../../../../out/target/product/msm8916_64/root/sepolicy**
Pls can you help me in resolving the issue.
from selinux.
Hi Stephen. Please can you let me know where am I going wrong.
- I downloaded the AOSP build (Android version 6.0.1) for Dragonboard 410c and compiled it.
- Flashed the images and checked the status of Selinux using getenforce.
- In permissive mode I collected the denials logs using adb logcat command.
- I tried to create a policy file from denial logs list using audit2allow command. Resulting to the above command, I got following error.
libsepol.policydb_read: policydb version 30 does not match my version range 15-29
I went through following solutions to resolve the issue: - Instead of using /usr/bin/audit2allow I used .external/selinux/prebuilts/bin/audit2allow
- I also used other path : ./external/selinux/policycoreutils/audit2allow/audit2allow
- Applied Android patch for policydb version 30. Followed cherry pick method to apply the patch.
Still I'm seeing the error. I'm also unable to use sedispol and seinfo tools as I'm getting not found message. I'm stuck up here. Pls help.
from selinux.
You need to run lunch (with appropriate arguments). Then your environment will be set up to use the AOSP-built versions of audit2allow and libsepol, not the distribution-provided ones, and you shouldn't need to specify a path at all. If you still have problems, take it up on seandroid-list mailing list.
from selinux.
Related Issues (20)
- semanage_get_lock fails on NFSv4 filesystems
- Python 3.11 support HOT 4
- manual setting HOT 2
- bad gpg signature HOT 4
- checkpolicy compilation error HOT 4
- selinux_restorecon.c comparison between signed and unsigned integer expressions
- Scope of boolean 'httpd_can_network_connect' & Django SELinux permissions
- libsepol:The libsepol package detects memory leaks and segmentation errors when tested by OSS-fuzz. HOT 4
- How Do I Select a Proper Number of Threads for Labeling? HOT 2
- Can use macro parameter for filecon path statment? HOT 1
- restore.c:(.text+0x229): undefined reference to `selinux_restorecon_parallel' HOT 1
- selinux-activate not working on RaspbianOS bullseye (version 11) HOT 1
- "semanage export" does not handle port definition modifications properly
- libselinux: off-by-one in setcon() family
- Question Regarding "semanage boolean": HOT 5
- Non-cached is_selinux_enabled() variant? HOT 1
- selinux 3.6 fails to compile against latest versions of musl HOT 1
- libselinux: selabel_digest -b x/media/db error HOT 1
- libsepol: new "all" op verifier in 3.6 does not check classcommon perms HOT 3
- Should ignoredirs apply to all subdirectories? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from selinux.