<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>i.MX Processors中的主题 Re: How to Write SE-Linux policy for android System Service?</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/How-to-Write-SE-Linux-policy-for-android-System-Service/m-p/805876#M124387</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thinh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I exactly have same issue as yours, I added everything I can, but still see same violation report. Have you fixed this issue?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 03 Nov 2018 02:06:33 GMT</pubDate>
    <dc:creator>xiaofenglei</dc:creator>
    <dc:date>2018-11-03T02:06:33Z</dc:date>
    <item>
      <title>How to Write SE-Linux policy for android System Service?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-Write-SE-Linux-policy-for-android-System-Service/m-p/805873#M124384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am studying Android system. I am using imx8mq-evk &lt;STRONG&gt;(android 8.1)&lt;/STRONG&gt;.&amp;nbsp;I would like to extend android system service. So I modified android source code in folder "&amp;lt;android root&amp;gt;/frameworks/base/services/core" to add my custom service. After that, I tested by flashing android image to the board; My custom service is denied by &lt;STRONG&gt;selinux&lt;/STRONG&gt;. I got this error&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;10-17 10:08:48.412 2674 2674 I auditd : avc: denied { add } for service=&lt;STRONG&gt;auxdisplay&lt;/STRONG&gt; pid=3763 uid=1000 scontext=u:r:&lt;STRONG&gt;system_server&lt;/STRONG&gt;:s0 tcontext=u:object_r:&lt;STRONG&gt;default_android_service&lt;/STRONG&gt;:s0 tclass=s&lt;STRONG&gt;ervice_manager&lt;/STRONG&gt; permissive=0&lt;BR /&gt;10-17 10:08:48.413 2674 2674 E ServiceManager: add_service('&lt;STRONG&gt;auxdisplay&lt;/STRONG&gt;',5e) uid=1000 - PERMISSION DENIED&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I followed some instructions (&lt;A href="http://androidosp.blogspot.com/2014/11/selinux-seandroid-exceptions-for-system.html"&gt;here&lt;/A&gt; and &lt;A href="http://devarea.com/aosp-creating-a-system-service/#.W8f5fXX7TTd"&gt;here&lt;/A&gt;) to add selinux permission for my custom service. Below are my steps&lt;/P&gt;&lt;P&gt;1. In file &lt;STRONG&gt;service.te&lt;/STRONG&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;EM&gt;type auxdisplayj_service, system_api_service, system_server_service, service_manager_type;&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;2. In file &lt;STRONG&gt;service_contexts&lt;/STRONG&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;EM&gt;auxdisplay u:object_r:auxdisplayj_service:s0&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;3. in file &lt;STRONG&gt;system_server.te&lt;/STRONG&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;EM&gt;allow system_server auxdisplayj_service:service_manager add;&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;4. in file&amp;nbsp;&lt;SPAN style="background-color: #ffffff; color: #666666;"&gt;&lt;STRONG&gt;private/compat/26.0/26.0.cil&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;EM&gt;(typeattributeset auxdisplayj_service_26_0 (auxdisplayj_service))&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;5. In file&amp;nbsp;&lt;SPAN style="background-color: #ffffff; color: #666666;"&gt;&lt;STRONG&gt;prebuild/api/26.0/nonplat_sepolicy.cil&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;EM&gt;(typeattribute auxdisplayj_service_26_0)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;(roletype object_r auxdisplayj_service_26_0)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;(typeattributeset service_manager_type (auxdisplayj_service_26_0))&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;After compiling and flashing android image to the board. &lt;EM&gt;I still get the same error; my service is not allowed. Is there anything wrong in my steps?&lt;/EM&gt; All advice&amp;nbsp;is welcome. Many thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2018 05:00:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-Write-SE-Linux-policy-for-android-System-Service/m-p/805873#M124384</guid>
      <dc:creator>trongthinh</dc:creator>
      <dc:date>2018-10-18T05:00:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to Write SE-Linux policy for android System Service?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-Write-SE-Linux-policy-for-android-System-Service/m-p/805874#M124385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have to allow a context switch from system_server to default_android_service. The SELinux rule should be:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;allow system_server default_android_service:service_manager { add };&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2018 12:38:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-Write-SE-Linux-policy-for-android-System-Service/m-p/805874#M124385</guid>
      <dc:creator>timgruijters</dc:creator>
      <dc:date>2018-10-24T12:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to Write SE-Linux policy for android System Service?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-Write-SE-Linux-policy-for-android-System-Service/m-p/805875#M124386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tim,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #242729; background-color: #ffffff;"&gt;You can't do that. domain.te has this neverallow rule: neverallow * default_android_service:service_manager add; so it will prevent compiling, if you comment out that neverallow rule, you'll fail CTS.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Oct 2018 09:11:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-Write-SE-Linux-policy-for-android-System-Service/m-p/805875#M124386</guid>
      <dc:creator>trongthinh</dc:creator>
      <dc:date>2018-10-26T09:11:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to Write SE-Linux policy for android System Service?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-Write-SE-Linux-policy-for-android-System-Service/m-p/805876#M124387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thinh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I exactly have same issue as yours, I added everything I can, but still see same violation report. Have you fixed this issue?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Nov 2018 02:06:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-Write-SE-Linux-policy-for-android-System-Service/m-p/805876#M124387</guid>
      <dc:creator>xiaofenglei</dc:creator>
      <dc:date>2018-11-03T02:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to Write SE-Linux policy for android System Service?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-Write-SE-Linux-policy-for-android-System-Service/m-p/805877#M124388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Xiaofeng Lei,&lt;/P&gt;&lt;P&gt;I cann't fix this issue. I have to set se-policy to "permissive" to continue debugging my system service.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2018 04:55:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-Write-SE-Linux-policy-for-android-System-Service/m-p/805877#M124388</guid>
      <dc:creator>trongthinh</dc:creator>
      <dc:date>2018-11-07T04:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to Write SE-Linux policy for android System Service?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-Write-SE-Linux-policy-for-android-System-Service/m-p/805878#M124389</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thinh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fortunately, I got the answer from Google here:&amp;nbsp;&lt;A class="link-titled" href="https://groups.google.com/forum/#!topic/android-security-discuss/e-2ZuSy_RS8" title="https://groups.google.com/forum/#!topic/android-security-discuss/e-2ZuSy_RS8"&gt;Google Groups&lt;/A&gt;&amp;nbsp;. You can check if it's helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2018 05:01:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-Write-SE-Linux-policy-for-android-System-Service/m-p/805878#M124389</guid>
      <dc:creator>xiaofenglei</dc:creator>
      <dc:date>2018-11-07T05:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to Write SE-Linux policy for android System Service?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-Write-SE-Linux-policy-for-android-System-Service/m-p/805879#M124390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN class=""&gt;Xiaofeng Lei and Thinh,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Can you post all the changes you did to solve this issue?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;I am facing same issue.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Dec 2019 10:32:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-Write-SE-Linux-policy-for-android-System-Service/m-p/805879#M124390</guid>
      <dc:creator>abhijit_thorat</dc:creator>
      <dc:date>2019-12-16T10:32:02Z</dc:date>
    </item>
  </channel>
</rss>

