2017-01-26 22:45:31 +01:00
|
|
|
# webview_zygote is an auxiliary zygote process that is used to spawn
|
|
|
|
# isolated_app processes for rendering untrusted web content.
|
|
|
|
|
2017-03-23 22:27:32 +01:00
|
|
|
typeattribute webview_zygote coredomain;
|
|
|
|
|
2017-01-26 22:45:31 +01:00
|
|
|
# The webview_zygote needs to be able to transition domains.
|
|
|
|
typeattribute webview_zygote mlstrustedsubject;
|
|
|
|
|
2018-05-16 23:38:51 +02:00
|
|
|
# Allow access to temporary files, which is normally permitted through
|
|
|
|
# a domain macro.
|
2018-01-30 16:54:33 +01:00
|
|
|
tmpfs_domain(webview_zygote);
|
2017-01-26 22:45:31 +01:00
|
|
|
|
|
|
|
# Allow reading/executing installed binaries to enable preloading the
|
|
|
|
# installed WebView implementation.
|
|
|
|
allow webview_zygote apk_data_file:dir r_dir_perms;
|
|
|
|
allow webview_zygote apk_data_file:file { r_file_perms execute };
|
|
|
|
|
|
|
|
# Access to the WebView relro file.
|
|
|
|
allow webview_zygote shared_relro_file:dir search;
|
|
|
|
allow webview_zygote shared_relro_file:file r_file_perms;
|
|
|
|
|
|
|
|
# Set the UID/GID of the process.
|
2017-11-09 23:51:26 +01:00
|
|
|
allow webview_zygote self:global_capability_class_set { setgid setuid };
|
2017-01-26 22:45:31 +01:00
|
|
|
# Drop capabilities from bounding set.
|
2017-11-09 23:51:26 +01:00
|
|
|
allow webview_zygote self:global_capability_class_set setpcap;
|
2017-01-26 22:45:31 +01:00
|
|
|
# Switch SELinux context to app domains.
|
|
|
|
allow webview_zygote self:process setcurrent;
|
|
|
|
allow webview_zygote isolated_app:process dyntransition;
|
|
|
|
|
|
|
|
# For art.
|
|
|
|
allow webview_zygote dalvikcache_data_file:dir r_dir_perms;
|
|
|
|
allow webview_zygote dalvikcache_data_file:lnk_file r_file_perms;
|
|
|
|
allow webview_zygote dalvikcache_data_file:file { r_file_perms execute };
|
|
|
|
|
2018-11-20 14:31:49 +01:00
|
|
|
# Allow webview_zygote to create JIT memory.
|
|
|
|
allow webview_zygote self:process execmem;
|
|
|
|
|
2017-01-26 22:45:31 +01:00
|
|
|
# Allow webview_zygote to stat the files that it opens. It must
|
|
|
|
# be able to inspect them so that it can reopen them on fork
|
|
|
|
# if necessary: b/30963384.
|
|
|
|
allow webview_zygote debugfs_trace_marker:file getattr;
|
|
|
|
|
|
|
|
# Allow webview_zygote to manage the pgroup of its children.
|
|
|
|
allow webview_zygote system_server:process getpgid;
|
|
|
|
|
|
|
|
# Interaction between the webview_zygote and its children.
|
|
|
|
allow webview_zygote isolated_app:process setpgid;
|
|
|
|
|
2017-09-26 21:58:29 +02:00
|
|
|
# TODO (b/63631799) fix this access
|
|
|
|
# Suppress denials to storage. Webview zygote should not be accessing.
|
|
|
|
dontaudit webview_zygote mnt_expand_file:dir getattr;
|
|
|
|
|
2018-02-05 23:26:04 +01:00
|
|
|
# TODO (b/72957399) remove this when webview_zygote is reparented to
|
|
|
|
# app_process zygote
|
|
|
|
dontaudit webview_zygote dex2oat_exec:file execute;
|
|
|
|
|
2017-03-27 19:57:07 +02:00
|
|
|
# Get seapp_contexts
|
|
|
|
allow webview_zygote seapp_contexts_file:file r_file_perms;
|
2017-01-26 22:45:31 +01:00
|
|
|
# Check validity of SELinux context before use.
|
|
|
|
selinux_check_context(webview_zygote)
|
|
|
|
# Check SELinux permissions.
|
|
|
|
selinux_check_access(webview_zygote)
|
|
|
|
|
2018-01-02 22:15:16 +01:00
|
|
|
# Directory listing in /system.
|
2018-01-03 17:46:05 +01:00
|
|
|
allow webview_zygote system_file:dir r_dir_perms;
|
2018-01-02 22:15:16 +01:00
|
|
|
|
2020-01-30 22:24:20 +01:00
|
|
|
# Read and inspect temporary files (like system properties) managed by zygote.
|
|
|
|
allow webview_zygote zygote_tmpfs:file { read getattr };
|
2018-01-30 16:54:33 +01:00
|
|
|
# Child of zygote.
|
|
|
|
allow webview_zygote zygote:fd use;
|
|
|
|
allow webview_zygote zygote:process sigchld;
|
|
|
|
|
|
|
|
# Allow apps access to /vendor/overlay
|
|
|
|
r_dir_file(webview_zygote, vendor_overlay_file)
|
|
|
|
|
2018-10-18 21:39:35 +02:00
|
|
|
allow webview_zygote same_process_hal_file:file { execute read open getattr map };
|
|
|
|
|
2019-04-11 21:30:51 +02:00
|
|
|
allow webview_zygote system_data_file:lnk_file r_file_perms;
|
|
|
|
|
2019-12-30 06:38:38 +01:00
|
|
|
# Send unsolicited message to system_server
|
|
|
|
unix_socket_send(webview_zygote, system_unsolzygote, system_server)
|
|
|
|
|
2017-01-26 22:45:31 +01:00
|
|
|
#####
|
|
|
|
##### Neverallow
|
|
|
|
#####
|
|
|
|
|
|
|
|
# Only permit transition to isolated_app.
|
|
|
|
neverallow webview_zygote { domain -isolated_app }:process dyntransition;
|
|
|
|
|
|
|
|
# Only setcon() transitions, no exec() based transitions, except for crash_dump.
|
|
|
|
neverallow webview_zygote { domain -crash_dump }:process transition;
|
|
|
|
|
|
|
|
# Must not exec() a program without changing domains.
|
|
|
|
# Having said that, exec() above is not allowed.
|
|
|
|
neverallow webview_zygote *:file execute_no_trans;
|
|
|
|
|
2018-01-30 16:54:33 +01:00
|
|
|
# The only way to enter this domain is for the zygote to fork a new
|
|
|
|
# webview_zygote child.
|
2018-01-30 16:54:33 +01:00
|
|
|
neverallow { domain -zygote } webview_zygote:process dyntransition;
|
2017-01-26 22:45:31 +01:00
|
|
|
|
|
|
|
# Disallow write access to properties.
|
|
|
|
neverallow webview_zygote property_socket:sock_file write;
|
|
|
|
neverallow webview_zygote property_type:property_service set;
|
|
|
|
|
|
|
|
# Should not have any access to app data files.
|
|
|
|
neverallow webview_zygote {
|
|
|
|
app_data_file
|
2018-08-03 00:54:23 +02:00
|
|
|
privapp_data_file
|
2017-01-26 22:45:31 +01:00
|
|
|
system_app_data_file
|
|
|
|
bluetooth_data_file
|
|
|
|
nfc_data_file
|
|
|
|
radio_data_file
|
|
|
|
shell_data_file
|
|
|
|
}:file { rwx_file_perms };
|
|
|
|
|
|
|
|
neverallow webview_zygote {
|
|
|
|
service_manager_type
|
|
|
|
-activity_service
|
|
|
|
-webviewupdate_service
|
|
|
|
}:service_manager find;
|
|
|
|
|
|
|
|
# Isolated apps shouldn't be able to access the driver directly.
|
|
|
|
neverallow webview_zygote gpu_device:chr_file { rwx_file_perms };
|
|
|
|
|
|
|
|
# Do not allow webview_zygote access to /cache.
|
|
|
|
neverallow webview_zygote cache_file:dir ~{ r_dir_perms };
|
|
|
|
neverallow webview_zygote cache_file:file ~{ read getattr };
|
|
|
|
|
|
|
|
# Do not allow most socket access. This is socket_class_set, excluding unix_dgram_socket,
|
|
|
|
# unix_stream_socket, and netlink_selinux_socket.
|
|
|
|
neverallow webview_zygote domain:{
|
|
|
|
socket tcp_socket udp_socket rawip_socket netlink_socket packet_socket key_socket
|
2017-02-06 20:14:58 +01:00
|
|
|
appletalk_socket netlink_route_socket netlink_tcpdiag_socket
|
|
|
|
netlink_nflog_socket netlink_xfrm_socket netlink_audit_socket
|
2017-01-26 22:45:31 +01:00
|
|
|
netlink_dnrt_socket netlink_kobject_uevent_socket tun_socket netlink_iscsi_socket
|
|
|
|
netlink_fib_lookup_socket netlink_connector_socket netlink_netfilter_socket
|
|
|
|
netlink_generic_socket netlink_scsitransport_socket netlink_rdma_socket netlink_crypto_socket
|
2016-12-08 19:35:27 +01:00
|
|
|
sctp_socket icmp_socket ax25_socket ipx_socket netrom_socket atmpvc_socket
|
|
|
|
x25_socket rose_socket decnet_socket atmsvc_socket rds_socket irda_socket
|
|
|
|
pppox_socket llc_socket can_socket tipc_socket bluetooth_socket iucv_socket
|
|
|
|
rxrpc_socket isdn_socket phonet_socket ieee802154_socket caif_socket
|
2017-05-17 18:06:49 +02:00
|
|
|
alg_socket nfc_socket vsock_socket kcm_socket qipcrtr_socket smc_socket
|
2018-11-16 11:48:03 +01:00
|
|
|
xdp_socket
|
2017-01-26 22:45:31 +01:00
|
|
|
} *;
|
|
|
|
|
|
|
|
# Do not allow access to Bluetooth-related system properties.
|
|
|
|
# neverallow rules for Bluetooth-related data files are listed above.
|
2018-04-09 05:07:32 +02:00
|
|
|
neverallow webview_zygote {
|
|
|
|
bluetooth_a2dp_offload_prop
|
2019-03-18 04:07:32 +01:00
|
|
|
bluetooth_audio_hal_prop
|
2018-04-09 05:07:32 +02:00
|
|
|
bluetooth_prop
|
|
|
|
exported_bluetooth_prop
|
|
|
|
}:file create_file_perms;
|