1

I am using Cuttlefish virtual Android device to build and run AOSP.

I am trying to add new native HAL service (binderized), which implements new HIDL interface.

To work on SELinux policy rules for the new HAL service, I want to run Android in permissive mode, inside Cuttlefish virtual device.

I tried adding kernel_cmdline parameter BOARD_KERNEL_CMDLINE += androidboot.selinux=permissive to device's BoardConfig.mk, as instructed here.

But it made Cuttlefish unable to boot, and keep on rebooting.

How do we set selinux mode to permissive when running Android in Cuttlefish virtual device?

Lakindu
  • 1,010
  • 8
  • 14
  • Have you tried temporarily enabling permissive mode? adb shell setenforce 0 – Donal M May 26 '20 at 16:16
  • Yes, setting it to permissive mode using adb shell works as expected. But I need it to be set to permissive during Android boot up. Because HAL service starts during Android boot up. – Lakindu May 26 '20 at 20:09
  • Have you tried modifying the selinux policy configuration to support your new native HAL service? You can see what policy changes are required by temporarily enabling the permissive mode, then using the audit2allow tool. See instructions on its use here: https://source.android.com/security/selinux/validate – Donal M May 27 '20 at 08:04

1 Answers1

1

While launching cvd you can pass a flag which will enable selinux into Permissive mode

launch_cvd -guest_enforce_security=false
Jitendra
  • 1,015
  • 9
  • 24