Skip to content
Snippets Groups Projects
user avatar
Nick Kralevich authored
Require all SELinux domains which have permission to perform ioctls on
/dev/tun explicitly specify what ioctls they perform. Only allow the
safe defaults FIOCLEX and FIONCLEX, which are alternate, uncommon ways
to set and unset the O_CLOEXEC flag.

Remove app's ability to issue *any* ioctls on /dev/tun, period. Add
neverallow assertions (compile time assertion + CTS test) to prevent
regressions.

Limit system_server's ability to perform ioctls on /dev/tun to FIOCLEX,
FIONCLEX, TUNGETIFF, and TUNSETIFF. Testing and source code examination
shows that only TUNGETIFF and TUNSETIFF are used by system_server.

The goal of this change is to put SELinux ioctl controls in place for
/dev/tun, so we don't have to maintain the custom kernel patch at
https://android.googlesource.com/kernel/common/+/11cee2be0c2062ba88f04eb51196506f870a3b5d%5E%21

Delete the neverallow assertion in isolated_app.te. This is already
covered by the assertion present in app_neverallows.te.

Test: cts-tradefed run cts -m CtsHostsideNetworkTests -t com.android.cts.net.HostsideVpnTests
Test: cts-tradefed run cts -m CtsHostsideNetworkTests
Test: cts-tradefed run cts -m CtsNetTestCases
Bug: 111560739
Bug: 111560570
Change-Id: Ibe1c3a9e880db0bee438535554abdbc6d84eec45
619c1ef2
Name Last commit Last update
..
adbd.te
apexd.te
app.te
asan_extract.te
attributes
audioserver.te
blkid.te
blkid_untrusted.te
bluetooth.te
bootanim.te
bootstat.te
bufferhubd.te
cameraserver.te
charger.te
clatd.te
cppreopts.te
crash_dump.te
device.te
dex2oat.te
dhcp.te
display_service_server.te
dnsmasq.te
domain.te
drmserver.te
dumpstate.te
e2fs.te
ephemeral_app.te
fastbootd.te
file.te
fingerprintd.te
flags_heatlh_check.te
fsck.te
fsck_untrusted.te
fwk_bufferhub.te
gatekeeperd.te
global_macros
hal_allocator.te
hal_atrace.te
hal_audio.te
hal_audiocontrol.te
hal_authsecret.te
hal_bluetooth.te
hal_bootctl.te
hal_broadcastradio.te
hal_camera.te
hal_cas.te
hal_configstore.te
hal_confirmationui.te
hal_contexthub.te
hal_drm.te
hal_dumpstate.te
hal_evs.te
hal_fingerprint.te
hal_gatekeeper.te
hal_gnss.te
hal_graphics_allocator.te
hal_graphics_composer.te
hal_health.te
hal_health_storage.te
hal_ir.te
hal_keymaster.te
hal_light.te
hal_lowpan.te
hal_memtrack.te
hal_neuralnetworks.te
hal_neverallows.te
hal_nfc.te
hal_oemlock.te
hal_omx.te
hal_power.te
hal_secure_element.te
hal_sensors.te
hal_system_suspend.te
hal_telephony.te
hal_tetheroffload.te
hal_thermal.te
hal_tv_cec.te
hal_tv_input.te
hal_usb.te
hal_usb_gadget.te
hal_vehicle.te
hal_vibrator.te
hal_vr.te
hal_weaver.te
hal_wifi.te
hal_wifi_hostapd.te
hal_wifi_offload.te
hal_wifi_supplicant.te
healthd.te
hwservice.te
hwservicemanager.te
idmap.te
incident.te
incident_helper.te
incidentd.te
init.te
inputflinger.te
install_recovery.te
installd.te
ioctl_defines