platform_system_sepolicy/private/fastbootd.te
Hongguang Chen 91a5f4e783 Support TCP based fastbootd in recovery mode.
The IPv6 link-local address is used to avoid expose device to out of
network segment.

BUG: 155198345
Test: manual test.
Change-Id: I0ce8c12de9976c01e57a6433c7fb50235e907dc5
2020-05-15 22:23:42 +00:00

33 lines
979 B
Text

typeattribute fastbootd coredomain;
# The allow rules are only included in the recovery policy.
# Otherwise fastbootd is only allowed the domain rules.
recovery_only(`
# Reboot the device
set_prop(fastbootd, powerctl_prop)
# Read serial number of the device from system properties
get_prop(fastbootd, serialno_prop)
# Set sys.usb.ffs.ready.
get_prop(fastbootd, ffs_config_prop)
set_prop(fastbootd, ffs_control_prop)
userdebug_or_eng(`
get_prop(fastbootd, persistent_properties_ready_prop)
')
set_prop(fastbootd, gsid_prop)
# Determine allocation scheme (whether B partitions needs to be
# at the second half of super.
get_prop(fastbootd, virtual_ab_prop)
# Needed for TCP protocol
allow fastbootd node:tcp_socket node_bind;
allow fastbootd port:tcp_socket name_bind;
allow fastbootd self:tcp_socket { create_socket_perms_no_ioctl listen accept };
# Get fastbootd protocol property
get_prop(fastbootd, fastbootd_protocol_prop)
')