Skip to content
Snippets Groups Projects
Select Git revision
  • 583270262c5d09a43ca5ee597d269fdf63a865bb
  • master default protected
  • android-7.1.2_r28_klist
  • pie-cts-release
  • pie-vts-release
  • pie-cts-dev
  • oreo-mr1-iot-release
  • sdk-release
  • oreo-m6-s4-release
  • oreo-m4-s12-release
  • pie-release
  • pie-r2-release
  • pie-r2-s1-release
  • oreo-vts-release
  • oreo-cts-release
  • oreo-dev
  • oreo-mr1-dev
  • pie-gsi
  • pie-platform-release
  • pie-dev
  • oreo-cts-dev
  • android-o-mr1-iot-release-1.0.4
  • android-9.0.0_r8
  • android-9.0.0_r7
  • android-9.0.0_r6
  • android-9.0.0_r5
  • android-8.1.0_r46
  • android-8.1.0_r45
  • android-n-iot-release-smart-display-r2
  • android-vts-8.1_r5
  • android-cts-8.1_r8
  • android-cts-8.0_r12
  • android-cts-7.1_r20
  • android-cts-7.0_r24
  • android-o-mr1-iot-release-1.0.3
  • android-cts-9.0_r1
  • android-8.1.0_r43
  • android-8.1.0_r42
  • android-n-iot-release-smart-display
  • android-p-preview-5
  • android-9.0.0_r3
41 results

netd.te

Blame
  • netd.te 2.29 KiB
    # network manager
    type netd, domain;
    type netd_exec, exec_type, file_type;
    
    init_daemon_domain(netd)
    net_domain(netd)
    
    allow netd self:capability { net_admin net_raw kill fsetid };
    allow netd self:netlink_kobject_uevent_socket *;
    allow netd self:netlink_route_socket *;
    allow netd self:netlink_nflog_socket *;
    allow netd self:rawip_socket *;
    allow netd self:unix_stream_socket *;
    allow netd shell_exec:file rx_file_perms;
    allow netd system_file:file x_file_perms;
    allow netd devpts:chr_file rw_file_perms;
    
    # For /proc/sys/net/ipv[46]/route/flush.
    # XXX Split /proc/sys/net into its own type.
    allow netd proc:file write;
    
    # For /sys/modules/bcmdhd/parameters/firmware_path
    # XXX Split into its own type.
    allow netd sysfs:file write;
    
    # Set dhcp lease for PAN connection
    unix_socket_connect(netd, property, init)
    allow netd system_prop:property_service set;
    
    # Connect to PAN
    domain_auto_trans(netd, dhcp_exec, dhcp)
    allow netd dhcp:process signal;
    
    # Needed to update /data/misc/wifi/hostapd.conf
    # TODO: See what we can do to reduce the need for
    # these capabilities
    allow netd self:capability { dac_override chown fowner };
    allow netd wifi_data_file:file create_file_perms;
    allow netd wifi_data_file:dir rw_dir_perms;
    
    # Allow netd to spawn hostapd in it's own domain
    domain_auto_trans(netd, hostapd_exec, hostapd)
    allow netd hostapd:process signal;
    
    # Allow netd to spawn dnsmasq in it's own domain
    domain_auto_trans(netd, dnsmasq_exec, dnsmasq)
    allow netd dnsmasq:process signal;
    
    # Allow netd to start clatd in its own domain
    domain_auto_trans(netd, clatd_exec, clatd)
    allow netd clatd:process signal;
    
    # Support netd running mdnsd
    # TODO: prune this back further
    allow netd ctl_default_prop:property_service set;
    allow netd device:sock_file write;
    
    ###
    ### Neverallow rules
    ###
    ### netd should NEVER do any of this
    
    # Block device access.
    neverallow netd dev_type:blk_file { read write };
    
    # Setting SELinux enforcing status or booleans.
    neverallow netd kernel:security { setenforce setbool };
    
    # Load security policy.
    neverallow netd kernel:security load_policy;