Skip to content
This repository was archived by the owner on Aug 14, 2020. It is now read-only.
This repository was archived by the owner on Aug 14, 2020. It is now read-only.

SELinux context for init-script #79

Description

@cjeanneret

After many tests, it seems the init-script issue is due to SELinux context, NOT path as mentioned in #69.

In order to follow it, a new issue is created.

Here are the steps we tested on our own in order to debug this:

  • Set init-script context to u:object_r:userinit_exec:s0 doesn't help (script doesn't even seem to be called)
  • Set init-script context to u:r:init:s0 doesn't help (here again, script doesn't even seem to be called)
  • "su" binary on CM12 comes from Superuser.apk, which doesn't support "--context" option
  • Script doesn't find "su" binary at startup, even with an enforced PATH value
  • We're able to run setenforce 0 on CM12 with default "su" binary
  • We might want to push a custom SELinux policy in order to allow the init-script to run iptables commands
  • Apparently, iptables should be run in "u:r:init:s0" context, as tested by @ahf
  • this documentation might provide some hints: https://source.android.com/devices/tech/security/selinux/customize.html

What should the policy allow:

  • run "iptables" binary in the "u:r:sysinit:s0" context
    This is apparently the only authorization we might need — unsure about that.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions