OSDN Git Service

Label /dev/ttyGF* as serial_device
authorYu Ning <yu.ning@intel.com>
Mon, 18 May 2015 06:52:22 +0000 (14:52 +0800)
committerNick Kralevich <nnk@google.com>
Mon, 18 May 2015 16:55:07 +0000 (09:55 -0700)
commite9ec053e992a2cce6e0688ad1711b015372c24ae
tree805bded3aac2827f917dcc6be697ed43dfea2099
parent09ee0a4252dbfd811f8345ab095c95ab78a1595f
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*.

(cherrypicked from commit 478346792282aba990111d736ba9928c616f9eb6)

Change-Id: Ia7394dc217bd82f566c4d1b7eda3cc8ce3ac612f
Signed-off-by: Yu Ning <yu.ning@intel.com>
target/board/generic/sepolicy/file_contexts
target/board/generic/sepolicy/goldfish_logcat.te
target/board/generic/sepolicy/qemud.te