Giter VIP home page Giter VIP logo

Comments (10)

tarunkapadia93 avatar tarunkapadia93 commented on June 25, 2024 6

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.

stephensmalley avatar stephensmalley commented on June 25, 2024 2

I see two problems with what you show above:

  1. 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).
  2. 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.

williamcroberts avatar williamcroberts commented on June 25, 2024

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.

msfjarvis avatar msfjarvis commented on June 25, 2024

Thanks a lot sir, I'll give that a shot. Appreciate the quick response.

from selinux.

williamcroberts avatar williamcroberts commented on June 25, 2024

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.

msfjarvis avatar msfjarvis commented on June 25, 2024

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.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 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.

msfjarvis avatar msfjarvis commented on June 25, 2024

Erm, been ages since this got resolved, but I appreciate your effort :)

from selinux.

Arunakar-B avatar Arunakar-B commented on June 25, 2024

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.

shravan77 avatar shravan77 commented on June 25, 2024

Hi Stephen. Please can you let me know where am I going wrong.

  1. I downloaded the AOSP build (Android version 6.0.1) for Dragonboard 410c and compiled it.
  2. Flashed the images and checked the status of Selinux using getenforce.
  3. In permissive mode I collected the denials logs using adb logcat command.
  4. 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:
  5. Instead of using /usr/bin/audit2allow I used .external/selinux/prebuilts/bin/audit2allow
  6. I also used other path : ./external/selinux/policycoreutils/audit2allow/audit2allow
  7. 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.

stephensmalley avatar stephensmalley commented on June 25, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.