Label /dev/ttyGF* as serial_device

In goldfish kernel 3.10, the goldfish_tty device instantiates virtual
serial ports as /dev/ttyGF* (e.g. /dev/ttyGF0), not as /dev/ttyS* as in
goldfish kernel 3.4. However, in the emulator's SELinux security policy,
there is no specific security context assigned to /dev/ttyGF*, and the
one inherited from /dev (u:object_r:device:s0) prevents services such as
qemud and goldfish-logcat from reading and writing ttyGF*. Consequently,
qemud terminates abnormally on the classic x86_64 emulator:

 init: Service 'qemud' (pid XXX) exited with status 1

Fix this issue by assigning /dev/ttyGF* the same security context as
/dev/ttyS*.

Change-Id: Ia7394dc217bd82f566c4d1b7eda3cc8ce3ac612f
Signed-off-by: Yu Ning <yu.ning@intel.com>
This commit is contained in:
Yu Ning
2015-05-18 14:52:22 +08:00
parent c340a30641
commit 4783467922
3 changed files with 3 additions and 2 deletions

View File

@@ -4,6 +4,7 @@
/dev/goldfish_pipe u:object_r:qemu_device:s0
/dev/qemu_.* u:object_r:qemu_device:s0
/dev/socket/qemud u:object_r:qemud_socket:s0
/dev/ttyGF[0-9]* u:object_r:serial_device:s0
/system/bin/qemud u:object_r:qemud_exec:s0
/sys/qemu_trace(/.*)? -- u:object_r:sysfs_writable:s0
/system/etc/init.goldfish.sh u:object_r:goldfish_setup_exec:s0

View File

@@ -6,5 +6,5 @@ domain_auto_trans(init, logcat_exec, goldfish_logcat)
# Read from logd.
read_logd(goldfish_logcat)
# Write to /dev/ttyS2
# Write to /dev/ttyS2 and /dev/ttyGF2.
allow goldfish_logcat serial_device:chr_file { write open };

View File

@@ -4,5 +4,5 @@ type qemud_exec, exec_type, file_type;
init_daemon_domain(qemud)
# Access /dev/ttyS1.
# Access /dev/ttyS1 and /dev/ttyGF1.
allow qemud serial_device:chr_file rw_file_perms;