Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c6bd5fc8 authored by Bjoern Johansson's avatar Bjoern Johansson Committed by Android (Google) Code Review
Browse files

Merge changes from topic "emu_wifi_fixes" into pi-dev

* changes:
  Update SELinux rules to support emulator WiFi
  Build emulator images with emulator WiFi HAL
  Update makefiles for WiFi in Treble
  Fix SELinux settings for WiFi in Treble
  Add SELinux configuration for new DHCP programs
  Enable WiFi for arm, arm64 and x86_64
  Add support for WiFi in emulator
parents e57c1d03 ca5bfb1c
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -65,6 +65,17 @@ DEVICE_MATRIX_FILE := device/generic/goldfish/compatibility_matrix.xml
BOARD_SEPOLICY_DIRS += build/target/board/generic/sepolicy
BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true

# Wifi.
BOARD_WLAN_DEVICE           := emulator
BOARD_HOSTAPD_DRIVER        := NL80211
BOARD_WPA_SUPPLICANT_DRIVER := NL80211
BOARD_HOSTAPD_PRIVATE_LIB   := lib_driver_cmd_simulated
BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_simulated
WPA_SUPPLICANT_VERSION      := VER_0_8_X
WIFI_DRIVER_FW_PATH_PARAM   := "/dev/null"
WIFI_DRIVER_FW_PATH_STA     := "/dev/null"
WIFI_DRIVER_FW_PATH_AP      := "/dev/null"

# Enable A/B update
TARGET_NO_RECOVERY := true
BOARD_BUILD_SYSTEM_ROOT_IMAGE := true
+14 −0
Original line number Diff line number Diff line
# Network namespace creation
type createns, domain;
type createns_exec, exec_type, vendor_file_type, file_type;

init_daemon_domain(createns)

allow createns self:capability { sys_admin net_raw setuid setgid };
allow createns varrun_file:dir { add_name search write };
allow createns varrun_file:file { create mounton open read write };

#Allow createns itself to be run by init in its own domain
domain_auto_trans(goldfish_setup, createns_exec, createns);
allow createns goldfish_setup:fd use;
+20 −0
Original line number Diff line number Diff line
# DHCP client
type dhcpclient, domain;
type dhcpclient_exec, exec_type, vendor_file_type, file_type;

init_daemon_domain(dhcpclient)
net_domain(dhcpclient)

allow dhcpclient execns:fd use;

set_prop(dhcpclient, net_eth0_prop);
allow dhcpclient self:capability { net_admin net_raw };
allow dhcpclient self:udp_socket create;
allow dhcpclient self:netlink_route_socket { write nlmsg_write };
allow dhcpclient varrun_file:dir search;
allow dhcpclient self:packet_socket { create bind write read };
allowxperm dhcpclient self:udp_socket ioctl { SIOCSIFFLAGS
                                              SIOCSIFADDR
                                              SIOCSIFNETMASK
                                              SIOCSIFMTU
                                              SIOCGIFHWADDR };
+12 −0
Original line number Diff line number Diff line
# DHCP server
type dhcpserver, domain;
type dhcpserver_exec, exec_type, vendor_file_type, file_type;

init_daemon_domain(dhcpserver)
net_domain(dhcpserver)

allow dhcpserver execns:fd use;

get_prop(dhcpserver, net_eth0_prop);
allow dhcpserver self:udp_socket { ioctl create setopt bind };
allow dhcpserver self:capability { net_raw net_bind_service };
+34 −0
Original line number Diff line number Diff line
# Network namespace transitions
type execns, domain;
type execns_exec, exec_type, vendor_file_type, file_type;

init_daemon_domain(execns)

allow execns varrun_file:dir search;
allow execns varrun_file:file r_file_perms;
allow execns self:capability sys_admin;
allow execns nsfs:file { open read };

#Allow execns itself to be run by init in its own domain
domain_auto_trans(init, execns_exec, execns);

# Allow dhcpclient to be run by execns in its own domain
domain_auto_trans(execns, dhcpclient_exec, dhcpclient);

# Allow dhcpserver to be run by execns in its own domain
domain_auto_trans(execns, dhcpserver_exec, dhcpserver);

# Rules to allow execution of hostapd and allow it to run
allow execns hal_wifi_hostapd_default_exec:file { execute_no_trans };
allow execns self:capability { net_admin net_raw };
allow execns self:netlink_generic_socket { bind create getattr read setopt write };
allow execns self:netlink_route_socket { bind create read write nlmsg_write };
allow execns execns:udp_socket { create ioctl };
allow execns self:packet_socket { create setopt };
allow execns sysfs_net:dir { search };
allowxperm execns self:udp_socket ioctl priv_sock_ioctls;

# Allow execns to read createns proc file to get the namespace file
allow execns createns:file read;
allow execns createns:dir search;
allow execns createns:lnk_file read;
Loading